passing parameter using postbackURL property...
-
Dears I’m using VS2005 , if we use postbackURL property button or link button it will pass all controls values in page (form method and encrypted ) to second page and we can get the values in second page by using Request.form[“ControlName”] Now , I need same way to pass the variables values in code behind of page1 to page2 by using postbackURL Can any one explain how I can write do it thanks a lot -- modified at 8:53 Monday 16th October, 2006
-
Dears I’m using VS2005 , if we use postbackURL property button or link button it will pass all controls values in page (form method and encrypted ) to second page and we can get the values in second page by using Request.form[“ControlName”] Now , I need same way to pass the variables values in code behind of page1 to page2 by using postbackURL Can any one explain how I can write do it thanks a lot -- modified at 8:53 Monday 16th October, 2006
Hi, For ex, in Source's (Source.aspx) CodeBehind (C#),
string val_a="abc"; string val_b="def"; LinkButton.PostBackURL="Target.aspx?a=" + val_a + "&b=" + val_b;
You can get the values in Target page(Target.aspx.cs) using,string a = Request.QueryString["a"].ToString(); string b= Request.QueryString["b"].ToString();
Also You may use PreviousPage property of ASP.NET 2.0 The following could be added to Target.aspx:<%@ PreviousPageType VirtualPath="~/Source.aspx" %> TextBox nameBox = PreviousPage.NameBox;
Here,NameBox is the TextBox control in the Source Page. -- modified at 3:31 Monday 16th October, 2006Regards, Jay :)