在javascript中引用asp.net控件 [英] referencing asp.net controls in javascript

查看:66
本文介绍了在javascript中引用asp.net控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好所有

i我试图将一些文本从文本框传递到我的asp.net页面的下拉列表中,我使用的是modal popup extender和vs 2008,我该怎么做才能引用asp在编写javascript时控制?我有弹出显示有两个文本框和两个按钮,当点击确定按钮我想要文本框中的任何内容进入asp下拉列表,那么我将如何去做呢?


谢谢

hello all
i am trying to pass some text from a textbox to a dropdownlist in my asp.net page, i am using the modal popup extender and vs 2008, how do i go about referencing asp controls when writing the javascript? i have the pop up display with two textbox''s and two buttons, when the ok button is clicked i want whatever is in the textboxs to go to the asp dropdown, so how would i go about doing this?

thanks

推荐答案

检查控件在客户端的呈现方式。


如果您可以获取ID和/或名称,访问元素应该相对简单。如果从ASP.NET代码的外观中确定ID /名称并不容易,请使用ASP.NET代码获取客户端ID,并将其与document.getElementById()一起使用。
Check how the controls are rendered on the client-side.

If you can get the IDs and/or names it should be relatively straightforward to access the elements. If it''s not easy to determine the ID/name from what the ASP.NET code looks like, use ASP.NET code to get the client-side ID and use that with document.getElementById().



检查控件在客户端的呈现方式。


如果可以获取ID和/或者名称访问元素应该相对简单。如果从ASP.NET代码的外观中确定ID /名称并不容易,请使用ASP.NET代码获取客户端ID并将其与document.getElementById()一起使用。
Check how the controls are rendered on the client-side.

If you can get the IDs and/or names it should be relatively straightforward to access the elements. If it''s not easy to determine the ID/name from what the ASP.NET code looks like, use ASP.NET code to get the client-side ID and use that with document.getElementById().



我是怎么称呼asp.net服务器控件的?喜欢按钮1点击事件我有me.dropdownlist1.items.add(textbox2.text),驻留在模态弹出框中的文本框...有没有办法通过获取其ID /名称来引用此控件,或者我需要在javascript中重做它吗?

Is that how i call an asp.net server control? like for the button 1 click event i have me.dropdownlist1.items.add(textbox2.text), the textbox that resides in the modal popup...is there a way to reference this control by just getting its id/name, or do i need to redo it in javascript?


显示代码在浏览器中的呈现方式。
Show how the code is rendered in your browser.


这篇关于在javascript中引用asp.net控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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