将javascript变量值转换为asp文本框值 [英] convert javascript variable value to asp TextBox value

查看:64
本文介绍了将javascript变量值转换为asp文本框值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨......

我想将javascript变量值设置为asp TextBox值,我尝试了一些方法,但未能做到这一点.....



谢谢.....

Hi....

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



thanks.....

推荐答案

hiii,


函数assignval()
{
var id =''value'';
document.getElementById(``& lt;%= txtUsername.ClientID%& gt;'').value = id;

}


要分配
时调用此函数
请参考此

http://www.jagregory.com/writings/how -to-use-clientids-in-javascript-without-the-ugliness/ [
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/[^]


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...


这篇关于将javascript变量值转换为asp文本框值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆