i have user defined control call in aspx page. want change attributes on vb.net code side. top of aspx page control -
<%@ register src="lightbox.ascx" tagname="abc" tagprefix="uc1" %> calling control in body - <uc1:abc id="abc" runat="server" />
vb.net page_load -
if session("ased") = true abc.attributes.add("visible", "true") else abc.attributes.add("visible", "false") end if
on debug mode see code change values according session on control not pick "false" or "true" attribute. shows control anyways.
for server side controls, should able use visible
property
if session("ased") = true abc.visible = true else abc.visible = false end if
if have use attribute, should using "display"
if session("ased") = true abc.attributes.add("display", "block") else abc.attributes.add("display", "none") end if
Comments
Post a Comment