asp.net应用程序如何基于dropdownlist的值显示转发器控件 [英] asp.net application how to display repeater controls based on the value of dropdownlist

查看:55
本文介绍了asp.net应用程序如何基于dropdownlist的值显示转发器控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我在索引页面中使用了3个asp:repeaters.我想使用顶部的下拉列表设置所有这3个asp:repeaters的可见性.例如:说我有一个包括音乐,通用,体育等所有主题的下拉列表.
基于这些值,asp:repeaters应该在其中显示值.这是针对博客网站的.
我将值插入数据库中,但在检索它们以显示在转发器中时却遇到问题.我陷入了检索查询以及如何使用下拉列表动态更改asp:repeater值的问题.

任何建议对我都会有帮助.

在此先感谢您.

hello everyone,

i am using 3 asp:repeaters in my index page.I want to set the visibility of all these 3 asp:repeaters using a dropdownlist at the top. example: say i have a dropdownlist of all the subjects like music,general,sports etc.
Based on these values the asp:repeaters should display the value inside them.this is for a blog site.
i ve the values inserted in the database but while retrieving them to display in the repeaters i am having an issue.i am stuck in the retrieve query and how to use the dropdownlist to change the values of asp:repeater dynamically.

Any suggestions will be helpful to me .

Thanks in advance.

推荐答案

您正在页面中使用3个重复控件,然后可以为两个重复/div添加style ="display:none",并且仅显示一个div .

通过组合在js中添加onchange事件并分配函数,您可以在其中获得组合的选定值,然后隐藏所有重复器,并仅显示具有div.style.display ="属性的相应div/repeter
you are using 3 repeter controls in page then you can add style="display:none" for two repetes / div and show only one div.

with combo add onchange event in js and assign function in which you get then selected value of combo and then hide all repeters and show only respective div/repeter with div.style.display="" property


这篇关于asp.net应用程序如何基于dropdownlist的值显示转发器控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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