Ajax中的Javascript [英] Javascript in ajax

查看:76
本文介绍了Ajax中的Javascript的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<big></big>

如何在ajax2.0中使用Javascript获取文本框的elementid

How to Get the elementid for textbox using Javascript in ajax2.0

推荐答案

我想您需要使用JavaScript
获取< asp:textbox xmlns:asp =#unknown"> 服务器控件的ID
如果您的文本框是如下所示的服务器控件:

I guess you need to get the ID of an <asp:textbox xmlns:asp="#unknown"> server control using JavaScript

If your text box is a server control like the following:

<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>



您获得的ID如下:



You get the ID as follows:

var textBoxId = "<%=TextBox1.ClientID %>";


如果您知道呈现的控件ID,则还可以使用:
If you know the rendered control id then you can also use:
var textBoxId = document.getElementById("myTextbox");


这篇关于Ajax中的Javascript的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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