Click here to Skip to main content
15,894,460 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi....

I want to get the javascript variable value to asp TextBox value I try some ways but faild to do that.....



thanks.....
Posted

hiii,


function assignval()
{
var id='value';
document.getElementById( '<%= txtUsername.ClientID %>').value=id;

}

and
call this function when you want to assign

please refer this

http://www.jagregory.com/writings/how-to-use-clientids-in-javascript-without-the-ugliness/[^]
 
Share this answer
 
VB
hey Jagadeesh 

Find your Text box inside Java script Function by following way.
 var textBox= document.getElementById("Your ASP TextBox Id");

and just assign your javascript Variable value to that textbox variable

like:
textBox = your javascript value;
it working ....
all the best...
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900