OnClientClick, Javascript and ASP tags

G

GiJeet

Hello, I’m trying to use the OnClientClick event of an ASP button to
call javascript that changes the PostbackUrl property of the button
before it gets sent back to the server. The button is an ASP button,
that is, with the ASP: tag. The OnClientClick code is
OnClientClick="javascript:setpostbackurl(this); In the debugger I can
see the ID of the object passed to the setpostbackurl javascript
function is the correct id but the debugger says it has no child
nodes. Why is this? The PostbackUrl property is contained within
the tags of the ASP:Button so it should be seen as an attribute of the
button but it’s not.

Controls prefixed with the ASP: tag are sever tags correct? But the
attributes should still be able to be set via javascript on the client
no?

Is there a way to set the PostbackUrl on a button with the
OnClientClick and set it’s value before the page gets set back to the
server so it will be directed to the value set on the PostbackUrl ?

I’m new at all this so any help would be appreciated.

TIA
G
 

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,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top