拥有3个下拉控件的Appliction主页面要获取此值并填充我的gridview,但是gridview在其他页面中 [英] Appliction master page having 3 drop down control in want to take this value and fill my gridview but gridview are in other page

查看:52
本文介绍了拥有3个下拉控件的Appliction主页面要获取此值并填充我的gridview,但是gridview在其他页面中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我使用C#.in在具有3个下拉控件的Appliction母版页面中使用asp.net4.0工作,我想使用此值并填充我的gridview,但是gridview在其他页面中


i m working in asp.net4.0 with C#.in Appliction master page having 3 drop down control in want to take this value and fill my gridview but gridview are in other page

推荐答案

您可以通过多种方式进行此操作
首先
使用((dropdownlist)master.findcontrol [控件名称"]).selectedvalue

将其用于所有三个下拉列表


您可以将dropdownlist的selectedvalue存储在会话变量中
像这样

session ["firstdropdownlist"] = dropdownlist1.selectedvalue
像这样在其他下拉列表中

然后在页面上是必需的

if(session ["firstdropdown"]!= null)
{
字符串值= convert.tostring(session ["firstdropdown"])
}
there are serveral ways you can do this
first
use ((dropdownlist)master.findcontrol["name of your control"]).selectedvalue

use this for all your three dropdownlist

or
you can store selectedvalue of dropdownlist in session variable
like this

session["firstdropdownlist"] = dropdownlist1.selectedvalue
like this for other dropdownlists

and then on the page it is required

if(session["firstdropdown"] != null)
{
string value = convert.tostring(session["firstdropdown"])
}


这篇关于拥有3个下拉控件的Appliction主页面要获取此值并填充我的gridview,但是gridview在其他页面中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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