Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > How to make a button to have both server side and client event in ASP.NET?

Reply
Thread Tools

How to make a button to have both server side and client event in ASP.NET?

 
 
Lau Alvin
Guest
Posts: n/a
 
      08-12-2004
HI all ,

I want to make a button which have a server side OnClick event in .cs to
update the DB. But I want it to have a client side onclick event to run
a javascript popup too. And the javascript will be run only in some
conditions determine by the input of some webcontrols. Finally the
server side event will depend on the chioce of user in the javascript
popup.

How can i achieve it ?

thX ~

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
Reply With Quote
 
 
 
 
Mark Rae
Guest
Posts: n/a
 
      08-12-2004
"Lau Alvin" <> wrote in message
news:%23PvhX$...

> I want to make a button which have a server side OnClick event in .cs to
> update the DB. But I want it to have a client side onclick event to run
> a javascript popup too. And the javascript will be run only in some
> conditions determine by the input of some webcontrols. Finally the
> server side event will depend on the chioce of user in the javascript
> popup.
>
> How can i achieve it ?


I think you're trying to make life difficult for yourself! I would suggest:

1) The button calls a client-side JavaScript function which loads the popup.

2) The user makes whatever choices you require in the popup then click an OK
button when finished.

3) The OK button in the popup calls a server-side function (or just
submits!) which updates the database and closes the popup.


 
Reply With Quote
 
 
 
 
Alan Z. Scharf
Guest
Posts: n/a
 
      08-12-2004
Lau,

See if this article helps.

http://www.developerfusion.com/show/4505/

Alan


"Lau Alvin" <> wrote in message
news:#PvhX$...
> HI all ,
>
> I want to make a button which have a server side OnClick event in .cs to
> update the DB. But I want it to have a client side onclick event to run
> a javascript popup too. And the javascript will be run only in some
> conditions determine by the input of some webcontrols. Finally the
> server side event will depend on the chioce of user in the javascript
> popup.
>
> How can i achieve it ?
>
> thX ~
>
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!



 
Reply With Quote
 
Lau Alvin Lau
Guest
Posts: n/a
 
      08-12-2004

Thx All ~


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
Reply With Quote
 
Karl
Guest
Posts: n/a
 
      08-13-2004
btnId.Attributes.Add("onclick", "ClientSideFunctionName();") and the normal
way for server-side.

Karl

"Lau Alvin Lau" <> wrote in message
news:...
>
> Thx All ~
>
>
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!



 
Reply With Quote
 
 
 
Reply

Thread Tools

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Button disabled and re-enabled in client side not firing server-side click event. =?Utf-8?B?QmluIFNvbmcsIE1DUA==?= ASP .Net 2 05-27-2008 09:57 AM
Using both server side validation and client side validation =?Utf-8?B?dmlkeWE=?= ASP .Net 1 06-02-2005 09:45 PM
Fire server side event before client side event ASP .Net Web Controls 3 03-18-2005 03:20 PM
Safe to have client-side AND server-side page load event procedures? Fred ASP .Net 2 07-12-2004 06:46 PM
asp:button w/ client side and server side click event Aymer ASP .Net Web Controls 1 09-19-2003 03:10 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57