popup page in aspx

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

Guest

I have a web form written in aspx. with codes behind in vb. on the submit button, the data is save in the db and also open another page. I write javascript on aspx page. and ButtonAdd.Attributes.Add("onClick", "doPopup();") on the vb code, but nothing happen. page does not open. anyhelp will be great.
 
Check for any popup blocker or antivirus software is running on your system

HTH
Gibs

newbie said:
I have a web form written in aspx. with codes behind in vb. on the
submit button, the data is save in the db and also open another page. I
write javascript on aspx page. and ButtonAdd.Attributes.Add("onClick",
"doPopup();") on the vb code, but nothing happen. page does not open.
anyhelp will be great.
 
here is the code for newWindow() on the aspx page.
function newWindow(url){
link = window.open(url,"Link",,)
return true;
}

The code for button:
private sub ButtonAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
ButtonAdd.Attributes.Add("onClick", "return newWindow(test.htm);")
end sub
Why wouldn't this work
 
Well, for one thing, it doesn't look like valid javascript. I would guess
you need quotes or single quotes around test.htm.

Are you sure you aren't getting a javascript error, but just not seeing it
because your IE settings are set to not display javascript errors?
 
ButtonAdd.Attributes.Add("onClick", "return newWindow(test.htm);"

should b

ButtonAdd.Attributes.Add("onClick", "return newWindow('test.htm');") 'Javascript strings should be inside single/double quotes

If it still doesn't work check the following
1. As Gibs said check there are no pop-up blockers preventing a pop-up for opening.
2, Also like I said earlier make sure Client side Validation is not turned for the button control

Suresh

----- newbie wrote: ----

here is the code for newWindow() on the aspx page
function newWindow(url)
link = window.open(url,"Link",,
return true


The code for button
private sub ButtonAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs
ButtonAdd.Attributes.Add("onClick", "return newWindow(test.htm);"
end su
Why wouldn't this work
 
Back
Top