Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Opening new browser window with URL
Message
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
00711966
Message ID:
00712036
Views:
9
This message has been marked as a message which has helped to the initial question of the thread.
You cannot open a browser windows directly from server side code. Instead, you'll need to send code to the browser to have it open the new window.
Dim scriptString2 As String = "<script language=JavaScript> "
scriptString2 += "javascript:window.open('clinservce.aspx?id'" & lcID & ",'_blank')"
scriptString2 += "</script>"

If (Not Me.IsStartupScriptRegistered("CallNow")) Then
    Me.RegisterStartupScript("CallNow", scriptString2)
End If
(Sorry about this being in VB.NET. I remembered after I created this that you code in C#. It is really easy to convert it. For some reason I thought I needed to provide this in VB.NET.)

Here is a link that shows you all the controls you have for how you want the browser to open (size, scrollbars, titlebar, etc.)

http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/reference/methods.asp

then click on the "open" method

>Hi folks. How do I open a new browser window with a given URL. In my case it will be a string.
>
>
>"clinservce.aspx?id=" + lcID
>
-----------------------------------------

Cathi Gero, CPA
Prenia Software & Consulting Services
Microsoft C# / .NET MVP
Mere Mortals for .NET MVP
cgero@prenia.com
www.prenia.com
Weblog: blogs.prenia.com/cathi
Previous
Reply
Map
View

Click here to load this message in the networking platform