Accessing original (html tag) value of a control property

H

HoustonFreeways

Suppose I have a datagrid control which defines the showfooter property

<dg:datagridconfirm id="dg_inbox" Runat="server" showfooter=false>

During subsequent postbacks of the page, I change the showfooter value to
true or false depending on the number of items in the datagrid

If me.Items.Count = 0 Then
ShowFooter = True
Else
ShowFooter = False
End If

The question is:
Is there any way I can reference the original value that was set in the tag?
(In this case false).

I realize I can set a viewstate variable when page.isPostBack is false, but
it seems to me there should be some way to access the original tag value.
 
L

Lucas Tam

The question is:
Is there any way I can reference the original value that was set in
the tag? (In this case false).

I realize I can set a viewstate variable when page.isPostBack is
false, but it seems to me there should be some way to access the
original tag value.

That's what viewstate or session variables are for.
 
B

Brock Allen

If you interogate the control in Page_Init, then that value will be the "default"
value. Page_Init fires prior to any data being restored into the control
from a postback.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top