p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
ASP.NET 1.0 and 1.1 Professional For advanced ASP.NET 1.x coders. Beginning-level questions will be redirected to other forums. NOT for "classic" ASP 3 or the newer ASP.NET 2.0 and 3.5

Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Professional section of the Wrox p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.

Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old July 24th, 2007, 02:18 AM
Authorized User
 
Join Date: Jun 2007
Location: , , .
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Default Call a Button's click event

Hi,
I want to execute the click event of an asp.net button upon clicking an HTML link.
Please help me solve this problem.
--- Sams

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #2 (permalink)  
Old July 24th, 2007, 02:45 AM
Friend of Wrox
Points: 1,903, Level: 17
Points: 1,903, Level: 17 Points: 1,903, Level: 17 Points: 1,903, Level: 17
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2004
Location: , , India.
Posts: 547
Thanks: 0
Thanked 1 Time in 1 Post
Default

Well, there can be 2 types of click event, server side click and client side click event. To understand better, just paste the below HTML to your aspx page:

<table cellSpacing="0" cellPadding="0" width="100%">
                <tr>
                    <td><A runat=server href="#" onserverclick="btnsubmit_ServerClick">Server Side Click</A></td>
                </tr>
                <tr>
                    <td><input id="btnsubmit" type="submit" value="Server Query" runat="server"></td>
                </tr>
                <tr>
                    <td><A href="#" onclick="document.getElementById('btn').onclick()" >Client Side Click</A></td>
                </tr>
                <tr>
                    <td><input id="btn" type="button" value="Client Query" onclick="alert('Client Test')"></td>
                </tr>
            </table>


And on the server side click of "Server Button", write the following in .cs

protected void btnsubmit_ServerClick(object sender, System.EventArgs e)
        {
            Response.Write("BUtton click");
        }


Regards
Mike

Don't expect too much, too soon.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #3 (permalink)  
Old July 24th, 2007, 04:09 AM
Authorized User
 
Join Date: Jun 2007
Location: , , .
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks a lot for your valuable help.

From
Sams

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #4 (permalink)  
Old July 24th, 2007, 04:32 AM
Friend of Wrox
Points: 1,903, Level: 17
Points: 1,903, Level: 17 Points: 1,903, Level: 17 Points: 1,903, Level: 17
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2004
Location: , , India.
Posts: 547
Thanks: 0
Thanked 1 Time in 1 Post
Default

Glad I could be of help.

Regards
Mike

Don't expect too much, too soon.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
call button's click event explicitly sansircar ASP.NET 1.0 and 1.1 Professional 1 January 25th, 2006 01:07 AM
Synchronize a command button's click event Kaustav VB How-To 2 September 20th, 2005 03:25 PM
Click event About DataGridItem jamslast ASP.NET 1.1 0 April 22nd, 2005 02:39 AM
Click Event dkr72 C# 3 December 8th, 2004 06:23 PM
Mouse Click Event roniestein Access 4 December 11th, 2003 04:53 AM



All times are GMT -4. The time now is 06:12 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
© 2008 Wiley Publishing, Inc