0

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.

CPM
  • 213
  • 2
  • 7
  • 23

1 Answers1

0

Your linkbutton is not rendered correctly. Please set your OnClientClick property in the code behind at Page_Prerender. Furthermore you have different method names in markup and code, you mispelled "Rquest".

UpdateButton.OnClientClick = OpenWindowRquest("myurl.aspx")
Ihor Deyneka
  • 1,326
  • 1
  • 19
  • 37