asp.net button.Attributes.Add (script not working)...why?

K

KathyB

Hi, I have an asp:button id="btnList" in an asp.net page. In the page
load event (If NOT Postback), I have the following:

btnList.Attributes.Add("onclick", "<script
language='javascript'>window.open('Scanned.aspx', 'Serial Numbers',
'width=200 , height=300, toolbar=no');</script>")

I get no syntax errors, but when I run the page and click the button,
it simply posts back to itself. I made validate false, but don't see
any other

I know this is simple, but PLEASE tell me why???

Thanks, Kathy :)
 
Joined
Sep 19, 2008
Messages
1
Reaction score
0
Regards

Hai Kathy

Try to use like this,
btnList.Attributes.Add("onclick","javascript:window.open('Scanned.aspx', 'Serial Numbers',
'width=200 , height=300, toolbar=no');");

This May help u.
 

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

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top