Opening new window

I've tried to open a pop-up from an ASP.NET-page with Javascript. This is that part of the code

Dim popupScript As String = "" & "window.open('popup.aspx', 'CustomPopUp', 'width=600, height=400, scrollbars=yes, resizable=yes')" & ""

Page.RegisterStartupScript("PopupScript", popupScript)

But when I try to run this I get a compilation error that says :

Compiler Error Message: BC30648: String constants must end with a double quote.

Can someone please tell me what I'm doing wrong...



Comments

  • [b][red]This message was edited by mangesh004 at 2004-9-1 3:28:20[/red][/b][hr]
    instead of using Page.RegisterStartupScript("PopupScript", popupScript)

    try out response.write(popupscript)

    here is the sample code

    Dim strScript As String = ""
    strScript = ""
    strScript = strScript & "alert('Simple alter message!!!!');"
    strScript = strScript & ""
    Response.Write(strScript)

    this opens a alert

    otherwise if you want to open a popup window on button click you can add attribute to that button, this can be done in a following way

    cmdReports.Attributes.Add("onclick", "window.showModalDialog('popupwindow.aspx', 'mangesh','status:no;dialogWidth:260px;dialogHeight:220px;dialogHide:true;help:no;scroll:no');")

    this code you have to write in the page load event

    -Mangesh


  • : I've tried to open a pop-up from an ASP.NET-page with Javascript. This is that part of the code
    :
    : Dim popupScript As String = "" & "window.open('popup.aspx', 'CustomPopUp', 'width=600, height=400, scrollbars=yes, resizable=yes')" & ""
    :
    : Page.RegisterStartupScript("PopupScript", popupScript)
    :
    : But when I try to run this I get a compilation error that says :
    :
    : Compiler Error Message: BC30648: String constants must end with a double quote.
    :
    : Can someone please tell me what I'm doing wrong...
    :
    :
    :
    :

    Break up your assignmnet string to couple of different string name avaoid long assigmnet
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories