Re: Difference between windows and web applications
-
Dear All, I am new to ASP.Net. In windows application, a particular form can be called by a previous form. (eg. form2 is called from form1 - the entry point to form2 is from form1 only.) In web application, my understanding is that form2 can be called from brower address bar by typing the address of form2. How it can be done as in windows application. Please forgive me, if it is a wrong site for the question. Thanks, Aung.
-
Dear All, I am new to ASP.Net. In windows application, a particular form can be called by a previous form. (eg. form2 is called from form1 - the entry point to form2 is from form1 only.) In web application, my understanding is that form2 can be called from brower address bar by typing the address of form2. How it can be done as in windows application. Please forgive me, if it is a wrong site for the question. Thanks, Aung.
From one page to another, you want to use Response.Redirect, or Server.Transfer. There isn't the same concept of individual pages really being aware of each other, as in a windows application though.
-
Dear All, I am new to ASP.Net. In windows application, a particular form can be called by a previous form. (eg. form2 is called from form1 - the entry point to form2 is from form1 only.) In web application, my understanding is that form2 can be called from brower address bar by typing the address of form2. How it can be done as in windows application. Please forgive me, if it is a wrong site for the question. Thanks, Aung.
You must use Response.Redirect("Name of second page") or Server.Transfer("Name of second page") both will do the same thing i-e from form1 moves u to form2 to read more about this Google it.
-
Dear All, I am new to ASP.Net. In windows application, a particular form can be called by a previous form. (eg. form2 is called from form1 - the entry point to form2 is from form1 only.) In web application, my understanding is that form2 can be called from brower address bar by typing the address of form2. How it can be done as in windows application. Please forgive me, if it is a wrong site for the question. Thanks, Aung.
-
Thanks for the answers. I would like to know is that - if it is called directly from browser address bar, show an error message and redirect to previous page. - if it is to be done at page load event, it is a correct practice. Thanks Aung.
You'll have trouble being able to tell the difference about where your page has come from in this instance. Not entirely sure what you mean by the page load...
-
Thanks for the answers. I would like to know is that - if it is called directly from browser address bar, show an error message and redirect to previous page. - if it is to be done at page load event, it is a correct practice. Thanks Aung.
Hi ! First of, you need the information from request header HTTP_Refferer, directly or wrapped in the Request object. Here is the interesting discussion about it. http://bytes.com/forum/thread646457.html[^] Regards, Gennady
-
Hi ! First of, you need the information from request header HTTP_Refferer, directly or wrapped in the Request object. Here is the interesting discussion about it. http://bytes.com/forum/thread646457.html[^] Regards, Gennady
-
Dear All & Gennady, Thanks, I have read the discussion and it helps me to understand on the way of web application. As a beginner, I just tried to understand more of ASP.Net. Thanks, Aung.
BTW, you may do it programmatically too. Say, in the Page_Load of the first page you may set the session variable session("FirstPage") = 1 and in the Page_Load of the second page you may check this variable:
if (session("FirstPage")==1) { // You're on the right way } else { // Accessing directly to second page }
This is in the case when you use Server.Transfer, that preserves session. Response.Redirect - doesn't. Regards, GennadyMy English is permanently under construction. Be patient !!
modified on Tuesday, November 18, 2008 2:53 AM
-
BTW, you may do it programmatically too. Say, in the Page_Load of the first page you may set the session variable session("FirstPage") = 1 and in the Page_Load of the second page you may check this variable:
if (session("FirstPage")==1) { // You're on the right way } else { // Accessing directly to second page }
This is in the case when you use Server.Transfer, that preserves session. Response.Redirect - doesn't. Regards, GennadyMy English is permanently under construction. Be patient !!
modified on Tuesday, November 18, 2008 2:53 AM