Jump to content

Multiple variables in ASP files


tyv
 Share

Recommended Posts

Hi, Can I put multiple variables in an ASP file? For instance: <html><body><%dim namefilter this list name="Donald Duck"response.write("My name is: " & name)%><%dim namefilter that list name="Darkwing Duck"response.write("My name is: " & name)%></body></html>I am using ASP files, Javascript, HTML and my database is MS SQL. Thanks for any help you can offer. tyv

Link to comment
Share on other sites

Hi, Can I put multiple variables in an ASP file? For instance: ...
Yes you can, but not more than once with the same name! A variable declaration is global in your page (unless withina function). So in your example you would either need to reuse the same variable without declaring it again:
<%dim namename="Donald Duck"response.write("My name is: " & name)%><%name="Darkwing Duck"response.write("My name is: " & name)%>

or alternatively, in cases where you need a separate variable, declare it with a different name:

<%dim namename="Donald Duck"response.write("My name is: " & name)%><%dim name2name2="Darkwing Duck"response.write("My name is: " & name2)%>

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...