J
Jeff User
Hi
I thought I would try a hashtable for storing key and title value
pairs. For instance,
public class MyBasePAgeClass
{
Hashtable TitleHash = new Hashtable();
........
private void Page_Load(object sender, System.EventArgs e)
{
TitleHash.Add("home","Home");
TitleHash.Add("dbs","Create / Drop Databases");
.........
Then, later on, I evaluate the key (sent back when next page is
requested).
if (key ="dbs") then display the title
"Create / Drop Databases", etc..
This is a web app (asp/c#).
I am using 1 aspx.cs file as a base class for all my other web pages.
It contains common functions, etc..
So, I declare and populate the table in the base class and therefore
it is accessible to all web pages. Now, this means that the table has
to be rebuilt everytime a post is made and a new page generated.
1) Is this the best way to make a structure like this available to all
web pages?
There will probably be around 15 or 20 entries.
Is there a benefit to using hashTable over 2D string array or would an
array be better?
Thanks
Trying to improve
Jeff
I thought I would try a hashtable for storing key and title value
pairs. For instance,
public class MyBasePAgeClass
{
Hashtable TitleHash = new Hashtable();
........
private void Page_Load(object sender, System.EventArgs e)
{
TitleHash.Add("home","Home");
TitleHash.Add("dbs","Create / Drop Databases");
.........
Then, later on, I evaluate the key (sent back when next page is
requested).
if (key ="dbs") then display the title
"Create / Drop Databases", etc..
This is a web app (asp/c#).
I am using 1 aspx.cs file as a base class for all my other web pages.
It contains common functions, etc..
So, I declare and populate the table in the base class and therefore
it is accessible to all web pages. Now, this means that the table has
to be rebuilt everytime a post is made and a new page generated.
1) Is this the best way to make a structure like this available to all
web pages?
There will probably be around 15 or 20 entries.
Is there a benefit to using hashTable over 2D string array or would an
array be better?
Thanks
Trying to improve
Jeff