how to pass values to another aspx page without redirecting to that page?
-
i'm newbee. i tried to pass values but every time i'm usint server.transfer or response.redirect. is is possible to pass the values to that page without displaying that page.
-
For that you need to use Session. Once you store value in Session you can use it on any page. There are many alternatives of session, Like you can use cookies, Application object or Cache. HTH
Jinal Desai - LIVE Experience is mother of sage....
yes what you said is correct. but can you tell me how to send to that page with out calling that page. actually my problem is : i'm having two aspx pages namely page1 and page2 page1 has 'print' button and checkbox. so i need to send the information to page2 when print button is clicked whether checkbox is checked or not? so can you please elaborate your answer. thank you very much. regards, dittu
-
yes what you said is correct. but can you tell me how to send to that page with out calling that page. actually my problem is : i'm having two aspx pages namely page1 and page2 page1 has 'print' button and checkbox. so i need to send the information to page2 when print button is clicked whether checkbox is checked or not? so can you please elaborate your answer. thank you very much. regards, dittu
ok I got your point. But without calling the page it is not possible to pass the value. (It is possible to call page methods using AJAX, but that is for the same page.) Because when you call the page, the page is compiled at the same time, not before or after. So I think it is not possible. HTH
Jinal Desai - LIVE Experience is mother of sage....
-
yes what you said is correct. but can you tell me how to send to that page with out calling that page. actually my problem is : i'm having two aspx pages namely page1 and page2 page1 has 'print' button and checkbox. so i need to send the information to page2 when print button is clicked whether checkbox is checked or not? so can you please elaborate your answer. thank you very much. regards, dittu
You can use QueryString or CrossPage PostBack for this purpose. Just google it. You will get a lot of examples and codes.
dittu7 wrote:
how to send to that page with out calling that page.
BTW, what do mean by without calling that page?
Anurag Gandhi.
http://www.gandhisoft.com
Life is a computer program and every one is the programmer of his own life. -
You can use QueryString or CrossPage PostBack for this purpose. Just google it. You will get a lot of examples and codes.
dittu7 wrote:
how to send to that page with out calling that page.
BTW, what do mean by without calling that page?
Anurag Gandhi.
http://www.gandhisoft.com
Life is a computer program and every one is the programmer of his own life.what exactly i was asking is how to send a value from page1 to page2 with out redirect to page2. if we use query string we write as: in page1: Server.Transfer("page2.aspx?value=checked") in page2: string str= Request.QueryString("value") in the above senario page2 is displaying on the browser which should not occur. so kindly you please send me some suggestions for that thanks dittu
-
what exactly i was asking is how to send a value from page1 to page2 with out redirect to page2. if we use query string we write as: in page1: Server.Transfer("page2.aspx?value=checked") in page2: string str= Request.QueryString("value") in the above senario page2 is displaying on the browser which should not occur. so kindly you please send me some suggestions for that thanks dittu
-
what exactly i was asking is how to send a value from page1 to page2 with out redirect to page2. if we use query string we write as: in page1: Server.Transfer("page2.aspx?value=checked") in page2: string str= Request.QueryString("value") in the above senario page2 is displaying on the browser which should not occur. so kindly you please send me some suggestions for that thanks dittu
then why you use page2? i think you want to call some function from Page2 to Page1 page class are public partial class. so you can call that from Page1 for example public partial class _Page1() { PageLoad() { _Page2 objPage2=new _Page2(); DataTable dt=objPage2.BindData(false); } } public partial class _Page2() { DataTable BindData(bool x) { } } But this is not a good practice
Raju.M
-
i'm newbee. i tried to pass values but every time i'm usint server.transfer or response.redirect. is is possible to pass the values to that page without displaying that page.
-
what exactly i was asking is how to send a value from page1 to page2 with out redirect to page2. if we use query string we write as: in page1: Server.Transfer("page2.aspx?value=checked") in page2: string str= Request.QueryString("value") in the above senario page2 is displaying on the browser which should not occur. so kindly you please send me some suggestions for that thanks dittu
You mean to say that you wish to execute Page2.aspx but don't want to display on the browser. Use Server.Execute for the same. In Page1:
Server.Execute(“page2.aspx?value=checked”);
Page2 seems fine. Hope this will help.
Anurag Gandhi.
http://www.gandhisoft.com
Life is a computer program and every one is the programmer of his own life.