LinkButton + showmodaldialog not working

Posted by CPM on Stack Overflow See other posts from Stack Overflow or by CPM
Published on 2012-06-07T14:42:59Z Indexed on 2012/06/07 16:40 UTC
Read the original article Hit count: 429

What would be the west way to open a window.showModalDialog on linkbutton when updating a form?

I have a linkbutton on form that allows me to update the data, I want to be able to check if the data updatedin this case , parameter status of client is active I want to be able to open a window to fill some more information.

 Public Function OpenWindowRquest(ByVal URL As String) As String
    If accountMode = "1" Then
       Return "window.showModalDialog('" & Page.ResolveUrl(Server.UrlEncode(URL)) & "', window,'resizable:yes; scroll:on; status:yes; dialogWidth:750px; dialogHeight:350px; center:yes');"
                Else
        accountMode = ""
        Return ""
    End If

On aspx side I have

<asp:LinkButton id="UpdateButton" runat="server" commandName="Update" Text="Update" OnClientClick='<%# OpenWindowRequest("myurl.aspx") %>'></asp:LinkButton>

I also tried to call the function OpenWindowRequest on FormUpdating event but it doesnt work, window is not opened.

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about ASP.NET