Why 2 Clicks To Use Buttons??

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi all,
i was wondering why my buttons need 2 clicks to work. first time it just
refreshes the window, and then the second time it will work... I am using
ASP.NET and webforms buttons....
The weird part is that some of my buttons work fine, with 1 click, and a
bunch don't... usually when i'm using that button to open another page is
when it won't work...
Someone told me before to use HTML buttons, and i did that, with the
run-at-server option, but it still doesn't work...

What should i do???
thanks
 
Public Shared Sub OpenNewWindow(ByVal opener As
System.Web.UI.WebControls.WebControl, ByVal pagePath As String)
Dim y As String

y = "window.open('" & pagePath & "')"
opener.Attributes.Add("OnClick", y)
opener.Dispose()
opener = Nothing
y = ""
End Sub

OpenNewWindow2(cmdWorksheet, "imgViewer.aspx")
 
if the opener is a server button, you can not add the attribute "onclick"
because that attribute overwrited by the control.
 
Back
Top