Computer Science

Response examples in ASP

The Response object is used to print the data that we process on the screen, or to register it in cookies or send the user to another page.

Some examples are:

<% Response.Write “A text string”%>
<% Response.Write variable%>

Which have the task of printing a message or variable value in the generated HTML document. This method is so commonly used that there is an abbreviation of it to make it easier to write:

<% = variable%> is the same as <% response.write variable%>

It is important to specify the fact that printing in the HTML document does not necessarily mean viewing on the screen since we could use these tags to create certain HTML tags. Here is an example of what it is meant to say:

<% path = “”%>
<img src = “<% = path%>”>

Another example would be how to redirect with Response object:

<% Response.Redirect “MSIE4.asp”%>

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Check Also
Back to top button