Sometimes a piece of HTML code needs a script variable inserting in it. This is done by a small piece of inline scripting. Inline script has the script start and end tags in the same line with maybe a single write statement between them. It is important to use semicolons at the end of the inline statements, as there are no new line codes to tell the script server that the statement has finished.

Example

<input type=hidden name=”userid” value=”<script runat=”server”>write(request.userid);</script>”>  

 

Note that the value is enclosed in quotes, and that a semicolon terminates the write statement. This piece of code is passing the ‘userid’ variable back to the page to be used again when the user accesses the next page.

Comment on this topic

Topic ID: 150061