473,387 Members | 3,810 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

persisting ViewState

I have a web usercontrol on the form that dynamically builds itself
and then when an item has been clicked it will allow me to get the
object at the selected index. The problem I'm having is that I need
the items to persist in viewstate so I can pull them out but when a
button on the main form is clicked all the information stored in the
viewstate is lost.

I've tried session too and it won't let me do anything with it at all
(object is set to instance...)
Dec 14 '07 #1
1 1090

"cfps.Christian" <ge*******@otc.eduwrote in message
news:1e**********************************@e10g2000 prf.googlegroups.com...
>I have a web usercontrol on the form that dynamically builds itself
and then when an item has been clicked it will allow me to get the
object at the selected index. The problem I'm having is that I need
the items to persist in viewstate so I can pull them out but when a
button on the main form is clicked all the information stored in the
viewstate is lost.

I've tried session too and it won't let me do anything with it at all
(object is set to instance...)
It's unlikely that the viewstate is "lost". What's more likely is that you
are either not re-creating the usercontrol on post-back (so there are no
controls to be updated with viewstate info), or you are re-creating it
*after* the page controls have been updated with viewstate information
(Page_Init).

Dynamically added controls are not created automatically by asp.net
(obviously), but they *are* updated with viewstate info, provided they exist
when the "viewstate update" occurs (during PageInit).

Dec 14 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: David Anderson | last post by:
I'm having trouble persisting viewstate information for webcontrols I've disabled via javascript. I have a group of textboxes that I enable/disable via a checkbox control that invokes a javascript...
0
by: Tomas Vera | last post by:
Here's another goofy thing. I need to persist the state of items added dynamically to a Panel control between round-trips to the server. I have a web form that contains a TreeView and a...
8
by: John Smith Jr. | last post by:
I am looking for some way to persist a table web control so when page_load event comes up, i can display the table as it was. I tried using ViewState with the rows collection but that didn't work...
1
by: Charlie | last post by:
Hi, Is there a way of persisting state information for a server control without using ViewState? I'm currently using Page.Session() but I don't think this is the best way. What's the preferred...
1
by: lim | last post by:
What is the possible error that occurs when the Page_load event is not triggered during execution. In my page there's some basic server control. Is there any loops holes?
1
by: Alexandre Soares | last post by:
Hi, I've made a collapsible panel custom control. It's pretty simple so far, it extends the Panel class and renders a bar above itself (panel) to show/hide the <div> of the panel on the...
3
by: Stu | last post by:
Hi, I am creating a control in a PlaceHolder like so: Private Sub btnDelete_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDelete.Click Dim ctrl As...
2
by: Chris Ashley | last post by:
My app seems to lose its viewstate completely when I modify the querystring. Anything I can do about this? Cheers, Chris
0
by: =?Utf-8?B?SmltRg==?= | last post by:
We are building some new sites using .NET 2.0. We are trying to implement persisting ViewState site wide to SQL (as opposed to on a per application basis). I have successfully got the ViewState to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.