如何在另一个页面中获取一个页面下拉列表值?
问题描述:
hi
如何从一个页面到另一个页面获取选定的下拉值?
这里是一些代码
此代码在一页中
hi
how to get selected dropdown values from one page to another page?
here is some code
this code is in one page
int.TryParse(cmbCompany.SelectedValue, out companyID);
if (DateTime.TryParse(radtxtDateFrom.Text, out dtTemp))
{
startDate = dtTemp;
}
if (DateTime.TryParse(radtxtDateTo.Text, out dtTemp))
{
endDate = dtTemp;
}
以及我希望在另一页中选择的这个值
在第二页我喜欢这样使用
and this selected value i want in another page
in second page i used like this
string strCompanyID = string.Empty;
Int32? companyID;
int Company;
if (Int32.TryParse(strCompanyID, out Company) == true)
companyID = Company;
else
companyID = 0;
这里得到的公司ID只有0 ..可以任何人建议我吗?
谢谢
here am getting companyID as 0 only..can any one suggest me ??
thank you
答
您好,
您的问题看起来像是将值从一个页面传递到另一个页面......对...?
您可以使用 QueryStrings 来实现...
为了更好地了解查询字符串,您可以查看此链接
使用QueryString在页面之间传递变量 [ ^ ]
您可以从一个页面查看此链接以获取传输数据到另一个......
将页面值转移到另一页 [ ^ ]
Hi,
Your Question is looks like pass the values from one page to another page... right...?
you can do it by using QueryStrings...
for better understanding about querystrings you can check this link
Passing variables between pages using QueryString[^]
and you can check this link for transfer data from one page to another ....
Transferring page values to another page[^]
检查这个类似的QA帖子,
将值从DropDownList传递到其他aspx页面 [ ^ ]
Check this similar QA thread,
Pass value from DropDownList to other aspx page [^]