ViewState

J

Jay

How can I get client-side access to a view state variable
I enter on the server using something like
ViewState("MyVar") = 10.


Thanks

Jay
 
T

Teemu Keiski

Well,

you can't get access to server-side variable through client-side unless
server-side action is occurred (of course). So basically you can just print
the value into Label for example:

Label1.Text=ViewState("MyVar")

But it needs pretty much custom logic to get client-side changes into
ViewState to server, if you mean you do a change at client-side and then
send it to the server(i.e normal behaviour of ASP.NET is just that but this
is valid statement is very customized case).

An example of such is Andy Smith's control:
http://www.metabuilders.com/Tools/DynamicListBox.aspx

It can persist client-side changes in it into server-side (Items collection
of DDL).

--
Teemu Keiski
MCP,Designer/Developer
Mansoft tietotekniikka Oy
http://www.mansoft.fi

AspInsiders Member, www.aspinsiders.com
ASP.NET Forums Moderator, www.asp.net
AspAlliance Columnist, www.aspalliance.com
 

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

Members online

No members online now.

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,280
Latest member
BGBBrock56

Latest Threads

Top