JavaScript - how to bind a value at run time - Asked By nadeem shaikh on 09-Apr-12 08:12 AM

hi i am using a  java script function in my project

the function returns a set of values which i want to bind with different asp control like (LABEL, TEXT BOXES) etc

i dont know how to do this . i am able to print the list of values in html page but cant able to do this

           these control are on modal popup control  and i want to pop this control up with values returning from java script function
                i am using asp with vb.net

please help me its urgent for me


thanks in adwance
Venkat K replied to nadeem shaikh on 09-Apr-12 12:06 PM
assign the value to a hidden control textbox and add a "runat=Server" attribute to that hidden control which can be accessed in the code behind file.

then assign the value of the hidden control to the lable / textbox you need.


Somesh Yadav replied to nadeem shaikh on 10-Apr-12 12:19 AM
try this,

http://alternateidea.com/blog/articles/2007/7/18/javascript-scope-and-binding
Jitendra Faye replied to nadeem shaikh on 10-Apr-12 01:52 AM
Yes, you can make changes to the server control using javascript but the problem is that once you will make postback the changes which you have made using javascript that will be lost.

to make changes use this code-

document.getElementById("controlName").value= "your value";

Jitendra Faye replied to nadeem shaikh on 10-Apr-12 01:52 AM
Yes, you can make changes to the server control using javascript but the problem is that once you will make postback the changes which you have made using javascript that will be lost.

to make changes use this code-

document.getElementById("controlName").value= "your value";

nadeem shaikh replied to Venkat K on 10-Apr-12 07:34 AM
thanks for your reply

               but stilll i am not getting it, i am having reminder/scheduler type application, in my application user can set reminder for himself or for some other person also and that will be saved in database .
   now i want to display that reminder in pop up control at the time given by the user. and i am able to take these reminder from database and but the problrm is that if there will be more than one reminder for 1 user then the function returns the more than 1 row and i want to display these row one by one after specific time in a single popup . but when i am trying to loop these rows it will return either first row or last row and the timer which i am using is working properly but for the same row only.

                      so how do i resolve this ????

    and sorry for long description