Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

declaring new variables & collections

Status
Not open for further replies.

motte

Programmer
May 31, 2001
155
US
Hi everyone,

Where would you declare variables and collections that will be used across different subs. I'd like make them public. Would I just declare them inside my <script> tag ahead of any subs? I was messing with a hashtable and needed to declare it outside of any sub to preserve scope, but I had to add its keys/values while in a sub.

Also, how can I display a variable in a page in the html itself. Can we use the asp <% = foo %> syntax anymore?

I'm taking a class on asp.net but the teacher hasn't mentioned any of the basics yet. I am one who thinks basics are important.

Mike
 
HEy Motte,

I think you'd have to declare them as Session variables, cause when the page is posted back, any variables that are page level would revert back to whatever value they're given initially.

Yes, you can still use the good 'ol <% %> tags in the html. I would suggest too, though, that you ask your instructor about getting you guys to at least play with Visual Studio.NET. YOu can do alot more and alot faster than if you just have the text editor to work with.

Jack
 
Thanks for the info Jack. I did try the inline tags but I couldn't get them to work. Not sure why though.

We will be getting VS.net in soon. She wants to install everything first...plus, I have it at home, but I need the registration key from her. We're allowed to put it on at home if its for school only.

Thanks again,

Mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top