Why 2 Clicks To Use Buttons??

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
 
G

Guest

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")
 
G

Guest

if the opener is a server button, you can not add the attribute "onclick"
because that attribute overwrited by the control.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,598
Members
45,149
Latest member
Vinay Kumar Nevatia0
Top