Opening an URL

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a button on a ASPX page that need to open URL. Those URL can change dynamically and are mostly files (.xls, .doc) on the server. In Interdev, document.open('URL') use to do the job ! In .NET, I tried response.redirect('URL') with success but I'm not sure if it's the right way. Thank's
 
either.. one is a clientside call, the other requires a post-back and
redirection.
Personally, I avoid the extra server postback if you can and generate the
link to the clientside HREF or redirection

--
Curt Christianson
Owner/Lead Developer, DF-Software
www.Darkfalz.com


Jeff said:
I have a button on a ASPX page that need to open URL. Those URL can change
dynamically and are mostly files (.xls, .doc) on the server. In Interdev,
document.open('URL') use to do the job ! In .NET, I tried
response.redirect('URL') with success but I'm not sure if it's the right
way. Thank's
 
No need to fix what isn't broken!

However, if you want to optimize a bit you can open a new window using
javascript such as this:
a=window.open('Test.aspx','_new')
Here's more info:
http://msdn.microsoft.com/workshop/author/dhtml/reference/methods/open_0.asp
http://www.mozilla.org/docs/dom/domref/dom_window_ref77.html

You could also use the RegisterClientScriptBlock or RegisterStartupScript
functions to help you output the javascript from your server code.
Here's more info on these:
http://msdn.microsoft.com/library/d...UIPageClassRegisterClientScriptBlockTopic.asp
http://msdn.microsoft.com/library/d...UIPageClassRegisterClientScriptBlockTopic.asp

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net




Jeff said:
I have a button on a ASPX page that need to open URL. Those URL can change
dynamically and are mostly files (.xls, .doc) on the server. In Interdev,
document.open('URL') use to do the job ! In .NET, I tried
response.redirect('URL') with success but I'm not sure if it's the right
way. Thank's
 
Back
Top