手风琴窗格中的下拉列表 [英] dropdownlist in Accordion pane

查看:130
本文介绍了手风琴窗格中的下拉列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我在页面上有两个手风琴窗格,其中一个包含一个
下拉列表.我想在页面加载时填充该DropdownList,但为null
如果DropdownList所在的AccordionPane出现引用错误,则为
存在崩溃了.但是,如何填充我的
有一些数据的DropdownList有点差吗?

预先感谢.

Hi,

I have two accordion panes on a page and one of them includes a
DropdownList. I want to fill that DropdownList on page load but null
reference error occurs if the AccordionPane on which the DropdownList
exists is collapsed .Well but how can I fill my
little poor DropdownList with some data?

Thanks in advance.

推荐答案



如果您熟悉Jquery,则可以使用我的代码填充下拉列表

在Web浏览器中加载页面时从浏览器端访问.

Hi,

If you familier with Jquery you can use my code for filling dropdown list

from browser side when page loads in web browser.

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script src="Scripts/jquery-1.4.1-vsdoc.js" type="text/javascript"></script>
    <script src="Scripts/jquery-1.4.1.js" type="text/javascript"></script>
    <script language ="javascript" >
        function f1() {


(" #DropDownList1").html( < option value ='fdgfdg' > gfdg</option>< option value ='dfgg'> gfdg"); } < / 脚本 > < /head > < 正文 f1()" < 表单 =" form1" runat >服务器" > < div > < asp:dropdownlist id =" runat 服务器" xmlns:asp #unknown" < /asp:dropdownlist > < /div > < /form > < /body > < /html >
("#DropDownList1").html("<option value='fdgfdg'>gfdg</option><option value='dfgg'>gfdg"); } </script> </head> <body onload ="f1()"> <form id="form1" runat="server"> <div> <asp:dropdownlist id="DropDownList1" runat="server" xmlns:asp="#unknown"> </asp:dropdownlist> </div> </form> </body> </html>



尝试一下,如果您对此感兴趣的话.

清楚地发布您的要求,这样我会为您提供帮助.


最好的



Just try it ,If you interested in it.

post your requirement clearly thn i''ll help you.


All the Best


能否请您使用手风琴/手风琴窗格的FindControl 方法尝试访问DropDownList.
Could you please try accessing the DropDownList by using FindControl method of the Accordion/Accordion Pane.


这篇关于手风琴窗格中的下拉列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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