本文介绍了如何将值从页面传递到弹出窗口,然后通过查询字符串弹出到下一页的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想将一页的值传递给第二页,但在第一页上,我想在linkbutton上显示show popup for login。我正在使用listview
//第一页上的mycode linkbuttn在列表视图中
protected void LstvwProSubCat_ItemCommand(对象发件人,ListViewCommandEventArgs e)
{
if (ProfileID == 0 )
{
MpeLogin.Show();
// MessageBox.Show(查看首先需要登录的产品标题);
}
else
{
if (e.CommandName == ProSubCategary)
{
);
string [] args = e.CommandArgument.ToString()。Split( new char [] {' ,'});
int pgid = Convert.ToInt32(args [ 0 ]);
int pcid = Convert.ToInt32(args [ 1 ]);
int psdid = Convert.ToInt32(args [ 2 ]);
Server.Transfer( product_title.aspx?pgid =' + pgid + '& pcid =' + pcid + '& psdid =' + psdid + '跨度>);
}
}
}
//弹出窗口代码
受保护 void BtnATLogin_Command( object sender,CommandEventArgs e)
{
if (e。 CommandName == 登录)
{
string [] args = e.CommandArgument.ToString()。Split( new char [] {' ,'});
int pgid = Convert.ToInt32(args [ 0 ]);
int pcid = Convert.ToInt32(args [ 1 ]);
int psdid = Convert.ToInt32(args [ 2 ]);
Server.Transfer( product_title.aspx?pgid =' + pgid + '& pcid =' + pcid + '& psdid =' + psdid + '跨度>);
}
}
//下一页
string val1 = Request.QueryString [ 0 ];
string val2 = Request.QueryString [ 1 ];
string val3 = Request.QueryString [ 2 ];
解决方案
I want to pass values of one page to 2nd but on 1st page i want show popup for login on linkbutton. i am using listview
//mycode on 1st page linkbuttn in listview
protected void LstvwProSubCat_ItemCommand(object sender, ListViewCommandEventArgs e) { if (ProfileID == 0) { MpeLogin.Show(); //MessageBox.Show("To View Product Title You Need To Login First"); } else { if (e.CommandName == "ProSubCategary") { ); string[] args = e.CommandArgument.ToString().Split(new char[] { ',' }); int pgid = Convert.ToInt32(args[0]); int pcid = Convert.ToInt32(args[1]); int psdid = Convert.ToInt32(args[2]); Server.Transfer("product_title.aspx?pgid='" + pgid + "' & pcid='" + pcid + "'&psdid='" + psdid + "'"); } } }
//code for popup
protected void BtnATLogin_Command(object sender, CommandEventArgs e) { if (e.CommandName == "Login") { string[] args = e.CommandArgument.ToString().Split(new char[] { ',' }); int pgid = Convert.ToInt32(args[0]); int pcid = Convert.ToInt32(args[1]); int psdid = Convert.ToInt32(args[2]); Server.Transfer("product_title.aspx?pgid='" + pgid + "' & pcid='" + pcid + "'&psdid='" + psdid + "'"); } }
//next page
string val1 = Request.QueryString[0]; string val2 = Request.QueryString[1]; string val3 = Request.QueryString[2];
解决方案
这篇关于如何将值从页面传递到弹出窗口,然后通过查询字符串弹出到下一页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!