How can I respond to events in Server-side script?

Results 1 to 3 of 3

Thread: How can I respond to events in Server-side script?

  1. #1
    Join Date
    Dec 1969
    Posts
    8

    Default How can I respond to events in Server-side script?

    I&#039m new to ASP and am reading "Professional ASP 2.0" from Wrox Press. It suggests that you can click a button and respond to the _onClick event and still have access to server objects like "Request", "Session", "Respond", etc.<BR><BR>When I try it, the only time my event handler is called is when it is written with a client-side script. For example, is this possible:<BR><BR>:<BR>:<BR>&#060;%<BR>sub cmdPressMe_onClick<BR>session("MyVar") = "AnyValue"<BR>end sub<BR>&#037;&#062;<BR>:<BR>:<BR>&#060;input type=button name="cmdPressMe" value="Press Me!"><BR><BR>This won&#039t work for me. Is there another way? When I run something like this, it simply does nothing.<BR><BR>Does anyone have a suggestion? I hope this isn&#039t too stupid: I&#039m still pretty new to the whole thing...<BR><BR>Thanks,<BR>KMR

  2. #2
    Chris Roth Guest

    Default RE: How can I respond to events in Server-side script?

    Client-side and Server-side code will never interact because *all* of the server-side code is completed *before* the client-side code is even started. Your example looks like you are getting Server-side VBScript and Client-side VBScript mixed up.<BR><BR>For what you have as an example, you would have to set the ACTION of your form to submit to another ASP page and have it do this: <BR>&#060;% session("MyVar") = Request.Form("cmdPressMe") &#037;&#062;

  3. #3
    Join Date
    Dec 1969
    Posts
    8

    Default RE: How can I respond to events in Server-side script?

    This makes sense...thanks for your input!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •