如何使用Java脚本从母版页访问Web用户控件中控件的值? [英] How to access value of a control in Web User Control from a master page using java script ?

查看:73
本文介绍了如何使用Java脚本从母版页访问Web用户控件中控件的值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好先生

我已经在asp .Net中设计了一个WebUser控件.UserControl中有一个名为"ddlCity"的DropDowList控件.我已经在内容页面中使用了该用户控件.因此,如何使用Javascript从母版页访问UserControl中的DropDownList的值.先生,请帮我.


谢谢
最好的问候
Sashi Meher

Hello Sir

I have designed a WebUser Control in asp .Net.There is a DropDowList control called ''ddlCity'' in the Usercontrol. I have used that user control in a content page. So how can i access the value of the DropDownList which is in Usercontrol from the Master page using Javascript. Plz help me Sir.


thank you
Best Regards
Sashi Meher

推荐答案

DropDownList的值,该值位于使用Javascript从母版页的Usercontrol中
一旦构建了整个页面,就没有HTML格式的主页面内容页面用户控件.将所有内容合并在一起,并形成HTML的单个页面.因此,从母版页访问usercontrol的控件将与在母版页上访问的控件相同.

试试:
value of the DropDownList which is in Usercontrol from the Master page using Javascript
Once the whole page is constructed, there is no master page-content page-user control in HTML format. All are clubbed together and a single page in HTML is formed. Thus, accessing a control of usercontrol from master page would be same as accessing a control on master page.

Try:
var dllcontrol = document.getElementById("<%=ddlCity.ClientID %>");


这篇关于如何使用Java脚本从母版页访问Web用户控件中控件的值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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