Accessing original (html tag) value of a control property

  • Thread starter Thread starter HoustonFreeways
  • Start date Start date
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.
 
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.
 
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.

-Brock
DevelopMentor
http://staff.develop.com/ballen
 

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

Back
Top