通过下拉列表选择值显示gridview

编程入门 行业动态 更新时间:2024-10-09 23:12:21
本文介绍了通过下拉列表选择值显示gridview的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我想使用asp 3.4版本vs2008在下拉列表im中基于所选值显示gridview.

i want to display gridview based on the selected value in drop down list im using asp 3.4 version vs2008

推荐答案

我只能给你这个主意,因为你尝试过..... 1)首先编写一个绑定gridview的函数,说BindData() 2)从if(!Page.IsPostBack)中的页面加载调用它.因此不会在每个回发事件上调用它. 3)从下拉列表的SelectedIndexChange事件中调用相同的函数. 4)将您的下拉列表的autopostback属性设置为true.因此它将回发到服务器. 如有任何疑问,请在评论中回复.... ::) I can give you the Idea only, because you havnt tried for it..... 1) First of all write a function to bind gridview say BindData() 2) Call it from pageload in if(!Page.IsPostBack). So it will not get called on every postback event. 3) Call the same function from the Dropdownlist''s SelectedIndexChange Event. 4) Put your dropdownlist''s autopostback property to true. So it will postback to the server. In case of any question, reply back in comment.......:)

检查相同类型的讨论此处 [ ^ ] Check the same type of discussion here[^]

嗨. 第一的.您应该获取gridview的数据源. 第二.选择数据库,然后选择连接. 第三.您选择语句. 第四.您将在选择状态表中看到按钮"WHERE" 第五.您将在此处看到一个下拉列表.然后选择一个由下拉列表控制的列,然后将出现另一个下拉列表,选择"=".然后您将选择一个来源.选择. "control".那么您将看到"parameter properties"选择您的下拉列表ID.然后选择添加. 就是这样! 希望对您有帮助. 祝你好运. :) -chaosgray- hi. first. you should get the data source of the gridview. second. select database, then select connection. third. you select statement. fourth. you will see from the selecting statemet the button "WHERE" fifth. you will see a dropdown there. then choose a column you are being control by your dropdown, then another dropdown will appear, select "=". then you will choose a source. select. "control". then you will see the "parameter properties" select you dropdown id. then select add. and that''s it!. hope it helps. goodluck. :) -chaosgray-

更多推荐

通过下拉列表选择值显示gridview

本文发布于:2023-11-05 02:59:53,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1559725.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:列表   gridview

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!