tyv Posted March 4, 2008 Share Posted March 4, 2008 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 More sharing options...
Reg Edit Posted March 4, 2008 Share Posted March 4, 2008 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.