开发者

How to make PostBack from one page to another and pass parameters?

开发者 https://www.devze.com 2023-03-17 06:31 出处:网络
I need to make PostBack from source page to destination page. Destination page expects several parameters to be past to it. (I don\'t have control over destination, I just know what parameters are exp

I need to make PostBack from source page to destination page. Destination page expects several parameters to be past to it. (I don't have control over destination, I just know what parameters are expected).

For example destination page expects 3 parameters:

param1

param2

param3

My source page has controls with ids param1, param2 and param3, but because I am using master pages my controls get altered to:

ctl00$param1

ctl00$par开发者_开发知识库am2

ctl00$param3

So when I do PostBack destination page doesn't receive parameters it expects. How do I get around that?

What is proper way to do this?

Thanks


You can post to another page using Server.Transfer with

HttpContext.Current.Items["CustomerName"] = "Fred";

The following post outlines your option(s). Cross Page Postback and passing info from source to destination page

more info about HttpContext Items: https://web.archive.org/web/20201202215202/https://www.4guysfromrolla.com/articles/060904-1.aspx

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号