At 16:16 05-05-2002 -0400, you wrote: >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?
Obviously ASPX has several advantages over ASP, what I was referring to specifically was MS's attempt to make the gap between conventional desktop programming and the web smaller, resorting to html/web controls. Plus, I have yet to see one *realistic* example of using DataGrids, for example, with real "some-designer-did-it" webdesign. It's pretty easy to say "you just data-bind it and that's all. paging? just set a flag, etc.". That's not the real world, unfortunatelly. In the real world, either you resort to intercepting the OnDataItemBound - and the code gets messy, or you use Repeaters (and then VS.NET doesn't let you use Design View anymore), etc. Back to the point, the post-back (rather: form-post) mechanism frequently breaks the browser back button (need to repost), and I don't fancy having a giant VIEWSTATE in the QueryString to solve this. I also think there's a lack of documentation in some areas related to dynamic creation of controls and register of event handlers (see, for example, Control.AddedControl and System.Data.Common.DbDataRecord, both of which I've had to use and which are, according to the docs, "not intended to be used directly from your code."). This is my first real project with ASPX after several years with ASP and similar technologies, and it's been frustrating. Back to the point: any info about the ViewState question I initially asked? joćo martins >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. You can read messages from the DOTNET archive, unsubscribe from DOTNET, or subscribe to other DevelopMentor lists at http://discuss.develop.com.