[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Charles Herring

3/23/2002 2:09:00 AM

I would like to set viewstate off on a selection list. All i need is the
selection index. I tried a few experiments. Here is what I found.

1. If i make a selection list with static list items (using the property
builder) and set view state off i can get the selection index when
processing the select event.

2. If i fill the list items in my code, i get an exception on the post back
as it (ms code) is getting a bad index into the list.

Why the difference between static and dynamic lists? Work around?

Thanks.


3 Answers

(Simon Calvert)

3/28/2002 2:34:00 AM

0

Charles Herring

3/29/2002 6:51:00 AM

0

The ViewState is set off all the time. It is set to off at design time in
the IDE in both cases 1 and 2 of the original post.

"Simon Calvert" <simoncalonline@microsoft.com> wrote in message
news:GKM$hAf1BHA.2700@cpmsftngxa07...
> Can you add in the code sample? This may be a case where in the page
> lifecycle you are performing the 'databind' , Page_Load or Init with
> ViewState off.
>
> Simon Calvert
> This posting is provided "AS IS" with no warranties, and confers no
rights.


(Simon Calvert)

3/30/2002 3:19:00 AM

0