launching window in frame with a button control

D

Dave

Hi,

I am using the following code to try to open a window in a target
frame using a button control that is in the original frame. It does
not work unless I click the button twice. If anyone can help I'd
appreciate it. This is on a standard webform.

.......................................
Private Sub btTools_Click(ByVal sender As System.Object, ByVal e_ As
System.EventArgs) Handles btTools.Click

btTools.Attributes.Add("onClick", "window.open('reps.aspx', 'main' )")

End Sub
........................................

Thanks,
Dave
 
J

Jacky Kwok

Dave said:
Hi,

I am using the following code to try to open a window in a target
frame using a button control that is in the original frame. It does
not work unless I click the button twice. If anyone can help I'd
appreciate it. This is on a standard webform.

......................................
Private Sub btTools_Click(ByVal sender As System.Object, ByVal e_ As
System.EventArgs) Handles btTools.Click

btTools.Attributes.Add("onClick", "window.open('reps.aspx', 'main' )")

End Sub
.......................................

Thanks,
Dave


You should place the code in the "Page_Load" but not btTools_Click.

Your code just will set the client side "onClick" AFTER your click the
button. Hence, before first click on the button, teh client side
"onClick" has nothing.
 

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,156
Latest member
KetoBurnSupplement
Top