open window in ASP.NET

  • Thread starter Thread starter Grey
  • Start date Start date
G

Grey

I know I need to use client side script to open new window,
window.open("URL"). However, the URL in the function is dinamically
generated by server side. How can I open window in client side, but specify
the URL in server side.???

Million thanks
 
Do it from the code behind by streaming the script out thru the response
object

Response.Write("<script>window.open('" + dynamicStringHereURL +
"')</script>")

should work for you.
 
Soemthing like this. Where EditArticles is the id of the hyperlink for
instance that will launch the window.
EditArticles.Attributes.Add("onclick", "window.open( ' " &
YourVariablegoeshere & " ')")

EditArticles.Attributes.Add("href", "javascript:;")
 
Back
Top