Clear data(html) in a usercontrol

  • Thread starter Thread starter boomcreation
  • Start date Start date
B

boomcreation

Hi,

When I load a userControl, I check if I have a variable session.

If my variableSession1 = "A" and do nothing.

but if my variableSession1 = "B", I want clear the html in my control
and write:

"You need to do this or that"

If I use this code:

Current.Session.Abandon()
Current.Response.Write("<TABLE width=""100%"">" & _
"<TR align=""center""><TD><H2>You
need to do this or that"</H2></TD></TR>"
</TABLE>")
Current.Response.End()

all my page is "cleared".

How to clear only the code in my userControl ?

Thanks,
David
 
Hi,

When I load a userControl, I check if I have a variable session.

If my variableSession1 = "A" and do nothing.

but if my variableSession1 = "B", I want clear the html in my control
and write:

"You need to do this or that"

If I use this code:

Current.Session.Abandon()
Current.Response.Write("<TABLE width=""100%"">" & _
"<TR align=""center""><TD><H2>You
need to do this or that"</H2></TD></TR>"
</TABLE>")
Current.Response.End()

all my page is "cleared".

How to clear only the code in my userControl ?

Thanks,
David

You can wrap the controls in your UserControl in a PlaceHolder and
then set the PlaceHolder Visible property to true or false depedning
on your session variable. Then you would have another PlaceHolder or
Label for your "Do this" text and use the Visible property on that to
control it as well.
 
Back
Top