Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Retrieve a value set by javascript in asp.net 1

Status
Not open for further replies.

hjmc

Technical User
Nov 20, 2002
38
GB
I have initialised the value of an ASP:LABEL (called "myhiddenControl" in code below) from within a client side javascript routine.

srceEl = document.getElementById ("myhiddenControl");
srceEl.innerHTML = "TESTER";

I can see this on the screen and it works.

But when I postback, the value of the label is not being carried back to the server.

Can someone suggest what I may have missed out.

Thanks
 
Hi

I have changed my ASP:LABEL to a ASP:TEXTBOX and used this

srceEl = document.getElementById ("hiddenControl");
srceEl.value = rowValue;

Again I can see the value in the text box but not when I postback. (By postback I mean clicking a button and looking at the value in the textbox in the click handler.)

Am I still doing something wrong?
 
Hi ca8msm,

I am so sorry for being rude and not thanking you. I did get this working exactly as you pointed out.

Once again Thanks as I do rely on you guys.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top