asp.net - Function fails to execute in <a> tag but works with LinkButton -
i have static class (ss.u) function (gp) returns true or false. problem function not triggered when use inside <a> tag, works fine inside asp:linkbutton tag. need both of them reasons. here code lines:
1) <asp:linkbutton visible='<%# ss.u.gp("editcontactimage") %>' runat="server" id="lb1" text="editimage"/> 2) <a visible='<%# ss.u.gp("editrelations") %>' runat="server" id="r1">editrelations</a> 3) <a visible='false' runat="server" id="r2">editrelations</a> line 1 , 3 both working while line 2 returns "visible = true". (line 3 included in example showing <a> tag has working property called "visible"). did set breakpoint in gp function noticing line 1 using function.
can cause <a> tag not perform code?
short answer: html controls not support data binding.
detailed answer here: when use runat="server" on normal html
Comments
Post a Comment