raise event from javascript

N

Nikhil Patel

Hi all,
How can I raise the Click event of the LinkButton server control in
Javascript?

Thanks.
 
C

Cirrosi

Yes you can.
First you need a control that have autopostback active (even if hidden) so
that in the page is written a javascript function
__doPostBack(eventTarget,eventArgument) that raise a postback event.
This is a little dirty but work.
Excuse for my bad english.
 
A

alan.washington

Add a linkbutton control (LinkButton1) to a webform. In the page_load add the following line of code:

LinkButton1.Attributes.Add("onclick", "alert('Worked')");

This will just launch a alert box but it should show you how to do what your looking for.

Alan Washington
http://www.aewnet.com
Hi all,
How can I raise the Click event of the LinkButton server control in
Javascript?

Thanks.

User submitted from AEWNET (http://www.aewnet.com/)
 

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,755
Messages
2,569,537
Members
45,023
Latest member
websitedesig25

Latest Threads

Top