views:

92

answers:

1

Hi.. I have a Change Password page that has a H2 HTML tag that says "The password has been successfuly changed". This H2 tag, however, needs to be visible only on success. That is: I want to manually activate it (Visible=true) in the "Change password" button click postback event.

The question is: What's the best way to control this H2 tag visibility via code-behind?

I thought of adding it to a PlaceHolder control so that I can change it's visible property but it does not seems right as it's not the purpose of the control.

PS: I don't want to add it to a panel as the panel will add additional markup to the rendered page.

+3  A: 

I'm fairly certain as long as you have an id attribute and runat="server", that you can access the tag by name and set Visible to true or false.

I did this with a table row (plain old <tr>) in one of my apps.

Edit - to clarify, I do mean "access the tag by name" in your code-behind.

Like, myHeader.Visible = true;

Sapph
That did the trick.. thank you very much.
Ciwee
And congratulations for your first answered question
Ciwee
Happy to help, and thanks! :)
Sapph