I am not a big fam of ViewState/PostBack.  I think for intranet apps it
is fine, but for real web applications, it bloats the code too much.  If
you think of ViewState as just a Client-Side cache, it doesn't scale
well.  

Using ASPX like ASP would not be a good think IMHO, but using ASPX is
different from having to use WebForms with ViewState.  BTW, you can
disable ViewState in WebForms and just not expect postback's for event
handing.  I would do Client-Side scripts for that.

Opinions?  

Thanks,

Shawn Wildermuth
[EMAIL PROTECTED] 

> -----Original Message-----
> From: dotnet discussion [mailto:[EMAIL PROTECTED]] 
> On Behalf Of Joćo Pedro Martins
> Sent: Sunday, May 05, 2002 2:54 PM
> To: [EMAIL PROTECTED]
> Subject: [DOTNET] ViewState uses control hierarchy?
> 
> 
> Hello,
> 
> 
> I am having a problem which seems to be explainable
> if ViewStates uses not only the IDs but also the
> position of each control in the ASPX control tree
> to find the corrent viewstate info:
> 
> I have an aspx with a set of 10 linkbuttons,
> inside an html table cell (basically, page
> numbers), and at the end a "Last Page" Link
> button.
> Another cell has a "Next Page" LinkButton.
> All of these have ViewState = True.
> 
> Like this:
> TR
>    TD
>      1 2 3 4 5 6 7 8 9 Last Page
>    TD
>      Next Page
> 
> My OnPreRender code sets the CommandName for
> both the LastPage and NextPage buttons,
> and hiddes some of the page numbers when
> appropriate. Here I mean setting Visible=False,
> not Enable=False.
> 
> When I try to navigate the results, and while debbuging
> the OnCommand event handler, I find that altough 
> NextPage.CommandName has in it the value I set it to, 
> LastPage.CommandName has NOT, it uses the value I set in the HTML.
> 
> I tried putting each of these LinkButtons into
> separate TD's, and now LastPage.CommandName has a
> correct value.
> 
> So: does ViewState use the Control Tree to store the
> values??? and if we change it from page to page we
> will have problems?
> 
> I'll have to set some of those TD's to .Visible=false
> in order to get the layout I want, and I'm worrying
> the problem will just come back.
> 
> I am seriously frustrated with all this 
> webforms/postback/viewstate things. I start to feel I should 
> just use ASPX like I used to program ASP.
> 
> joćo martins
> 
> Sorry about the cross-posting.
> --
> Joćo Pedro Martins
> [EMAIL PROTECTED]
> |create|it|
> http://www.create.pt
> http://www.usabilidade.com
> 
> You can read messages from the DOTNET archive, unsubscribe 
> from DOTNET, or subscribe to other DevelopMentor lists at 
> http://discuss.develop.com.
> 

You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

Reply via email to