response.redirect
-
Hi, Is there another way of directing a user to a new page, when he clicks a button, that is on a different server? I use reponse.redirect, but I heard that is not the best way. Here is an example: The user is on http://intranet/pages/page1.aspx, and when he clicks a button, he loads another page http://server02/pages/page2.aspx in the browser...
-
Hi, Is there another way of directing a user to a new page, when he clicks a button, that is on a different server? I use reponse.redirect, but I heard that is not the best way. Here is an example: The user is on http://intranet/pages/page1.aspx, and when he clicks a button, he loads another page http://server02/pages/page2.aspx in the browser...
There is nothing wrong with Response.Redirect but do you really need to do this in code? Can't you do it on client-side? Such as using a link button? in that case after click the browser is being redirected straight to the other page as opposed to posting back to your application therefore saving an entire postback.
Cheers, Dani
-
There is nothing wrong with Response.Redirect but do you really need to do this in code? Can't you do it on client-side? Such as using a link button? in that case after click the browser is being redirected straight to the other page as opposed to posting back to your application therefore saving an entire postback.
Cheers, Dani
Dani: that's "what's wrong with Response.Redirect()" :)
-------------------------------------------------------- My portfolio & development blog Q:What does the derived class in C# tell to it's parent? A:All your base are belong to us!
-
Dani: that's "what's wrong with Response.Redirect()" :)
-------------------------------------------------------- My portfolio & development blog Q:What does the derived class in C# tell to it's parent? A:All your base are belong to us!
That is wrong with missusing Response.Redirect() (or at least one of them, as we could consider some scenarios where Server.Transfer would be better as well) but not with the feature itself. There are plenty scenarios where it is needed and there is no better alternative.
Cheers, Dani
-
There is nothing wrong with Response.Redirect but do you really need to do this in code? Can't you do it on client-side? Such as using a link button? in that case after click the browser is being redirected straight to the other page as opposed to posting back to your application therefore saving an entire postback.
Cheers, Dani
Hi, The problem I have is that I build up the URL string via code behind functions and variables, and then sending the user to a page in a window with no toolbar, directory, etc. The user should also not see to which page he is being redirected. If he goes "view source" on the new page or check the properties, that is ok... but he should not see the page URL in the status bar or in the location URL field. Will this still work if I use the link button?
-
Hi, The problem I have is that I build up the URL string via code behind functions and variables, and then sending the user to a page in a window with no toolbar, directory, etc. The user should also not see to which page he is being redirected. If he goes "view source" on the new page or check the properties, that is ok... but he should not see the page URL in the status bar or in the location URL field. Will this still work if I use the link button?
You can still use your mehtods to create a dynamic URL and still keep it on client side. For example you could use inline code to output the dynamic string built by your methods. something like: [">My Link](<%=) where instead of the hardcoded string you would call your method (make sure it is protected if you use ASP.NET 2.0 or public if ytou use 1.1). In order to open a window with certain options I think you will need to use window.open
Cheers, Dani
-
You can still use your mehtods to create a dynamic URL and still keep it on client side. For example you could use inline code to output the dynamic string built by your methods. something like: [">My Link](<%=) where instead of the hardcoded string you would call your method (make sure it is protected if you use ASP.NET 2.0 or public if ytou use 1.1). In order to open a window with certain options I think you will need to use window.open
Cheers, Dani
-
Ok, I am not to sure what you mean. Can you maybe give me an example. Yes, for the new window, I use a window.open to open the window.
Sorry, I pasted an example but it was rendered as HTML. Let me try again: <a href="<%=MyFunctionCallHere()%>">My Link</a> hope this works.
Cheers, Dani