views:

11

answers:

1

Hi I am getting data in ViewData on my view in my asp.net MVC application. I want to change the value of control dynamically. so I have write the Jquery for this. But How to get data from ViewData and and update it dynamically? how can i change the View Data data from j query and assign it to control ?

A: 

u can assign value of viewdata value to ur javascript variable at the top of ur page then u can use this variable in setting ur control values

var vdval = '<%=ViewData["key"]%>';

then use vdval to set ur control values

Muhammad Adeel Zahid