launching window in frame with a button control

  • Thread starter Thread starter Dave
  • Start date Start date
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
 
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.
 
Back
Top