|
| JavaScript Problem: Window.Open |
|
|
|
|
| Messages |
|
Related Types |
This message was discovered on microsoft.public.dotnet.general.
Responses highlighted in red are from those people who are likely to be able to contribute good, authoratitive information to this discussion. They include Microsoft employees, MVP's and others who IMHO contribute well to these kinds of discussions.
| Jan Zacek |
Hi folks,
My problem is that I need to open new window (of some size, tollbars etc.) by clicking linkbutton. Is it possible? I can't find!
My solution is include JavaScript to source HTML, but then the page cannot be displayed in Design Mode in VS.NET.
Help please.
Thanx, Jan
|
|
|
| |
|
| |
| |
| Ken Cox [Microsoft MVP] (VIP) |
You can put something like this in your codebehind file:
Private Sub Page_Load _ (ByVal sender As System.Object, ByVal _ e As System.EventArgs) Handles MyBase.Load If Not IsPostBack Then Dim sb As New System.Text.StringBuilder() sb.Append("<script ") sb.Append("language='javascript'>") sb.Append("window.open('http://www.aspalliance.com/kenc/hits.aspx',") sb.Append("'game','toolbar=no,") sb.Append("addressbar=no,menubar=no,") sb.Append("width=300,height=300');") sb.Append("</script>") RegisterStartupScript("stp", sb.ToString) End If End Sub
Ken MVP [ASP.NET]
"Jan Zacek" <Click here to reveal e-mail address> wrote in message news:uhANjoc1BHA.2856@tkmsftngp05... [Original message clipped]
|
|
|
| |
|
|
| |
|
| |
| Victor Garcia Aprea (VIP) |
Hi Jan,
If you dont want to write your javascript at design time, you could do this:
LinkButton1.Attributes.Add("onclick","Javascript:window.open('blah.htm');");
in your Page_Load method,
HTH, -Victor.
-- To contact me remove 'NOSPAM'. Please post all questions to the newsgroup and not by private mail.
"Jan Zacek" <Click here to reveal e-mail address> wrote in message news:uhANjoc1BHA.2856@tkmsftngp05... [Original message clipped]
|
|
|
| |
|
|
| |
|
| |
| Ken Cox [Microsoft MVP] (VIP) |
Oops. You wanted it on a button click. Try this one:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim sb As New System.Text.StringBuilder() sb.Append("<script ") sb.Append("language='javascript'>") sb.Append("window.open('http://www.aspalliance.com/kenc/hits.aspx',") sb.Append("'poll','toolbar=no,") sb.Append("addressbar=no,menubar=no,") sb.Append("width=300,height=300');") sb.Append("</script>") RegisterStartupScript("stp", sb.ToString) End Sub
Ken MVP [ASP.NET]
"Jan Zacek" <Click here to reveal e-mail address> wrote in message news:uhANjoc1BHA.2856@tkmsftngp05... [Original message clipped]
|
|
|
| |
|
|
| |
|
|
|
|
|
|
|
|
BootFX
Reliable and powerful .NET application framework. |
|
|
|
|
|
|