Hi,
I am looking into a way to shorten my code and make it simpler. At the moment code looks like
CODE
while (dr.Read())
{
SwString = dr["Page"].ToString();
switch (SwString)
{
case "Home":
Temp = dr["PageText"].ToString();
HomeLbl.Text = Temp.Replace("</br>", Convert.ToString((char)13));
break;
case "About":
Temp = dr["PageText"].ToString();
AboutLbl.Text = Temp.Replace("</br>", Convert.ToString((char)13));
break;
With many more cases to go. I am looking into a way to simply use a field called "PageText" as a label ID. Aka I want to fill in a label called "AboutLbl" with a data from the field "PageText" where field "Page" equals "About".
Can I do something like:
CODE
while (dr.Read())
SwString = dr["Page"].ToString();
Temp = dr["PageText"].ToString();
%SwString%Lbl.Text = Temp.Replace("</br>", Convert.ToString((char)13));
This post has been edited by Elven: 14 Aug, 2008 - 12:23 AM