asp script within the <sub> tag

Results 1 to 2 of 2

Thread: asp script within the <sub> tag

  1. #1
    Join Date
    Dec 1969

    Default asp script within the <sub> tag

    Can a subroutine in a asp page be programmed to perform server side scripting? My experience so far tell me the anything within the &#060;function&#062; and &#060;sub&#062; can only contain client side variables. If insert any &#039&#060;%&#039 within the tags, it will be executed regardless if I trigger the function or sub. Is there anyway I can overcome this? I only want the server side script within the function to be executed when I trigger off the event.

  2. #2
    Back to basics... Guest

    Default RE: asp script within the <sub> tag

    This is *almost* a clone of a response I posted in the Database Q&A just minutes ago:<BR><BR>You have a fundamental misunderstanding of the relationship between client-side coding/scripting (typically, JavaScript and HTML or DHTML) and server-side coding/scripting as is done with ASP.<BR><BR>ASP can not see *ANYTHING* that happens in the browser until and unless you ask it to produce the next page. Typically, you do this by submitting a &#060;FORM...&#062; or invoking a URL via an HREF. Then, and only then, the info from the page is available to ASP via Request.Form or Request.QueryString, at which point ASP is ready to produce the *NEXT* page to be displayed. ASP *CAN NOT* affect the current page as it sits in the user&#039s browser.<BR><BR>So if you want something to conditionally happen based on a client-side event, the condition *must* be tested and the appropriate code path must be selected entirely in client-side code. Note that ASP could, for example, dump in two versions of the code, and then the client-side code could select one or the other, but once ASP has written the HTML page it can *not* make further changes to it.<BR><BR>[There is an oddball exception to this known as Remote Scripting, but I can&#039t suggest that you even think about that option until after you have successfully mastered the basics.]<BR><BR>So go get yourself a *good* ASP book (see Scott&#039s book, on the left, for example) and learn the principles.<BR><BR>Good luck.<BR>

Posting Permissions

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