chelvis
11-21-2006, 05:25 PM
I am creating a page with some menus. The value for the menu comes from the database. If there is an ampersand sign (&) in a word, then the letters after the (&) sign is cut off.
For example if the word is say 's&w value fields' then its only displaying the letter 's' and the rest is cut off. I have to escape the & sign but how do I do it since its coming from the database (dynamic) and I dont know which one of them have the & sign. I have to display the words as it is from the database. How do I do this?
Below is my partial code: I have a tablecontrol created and then wrote this code:
string sMName = Request.QueryString["sMName"];
if (Request.QueryString["sMName"] != null)
{
TableCell ModelNameCell = new TableCell();
HyperLink hlModelName = new HyperLink();
hlModelName.NavigateUrl = "../products/.aspx?cid=" + iCID + "&sMName=" + sMName;
hlModelName.Text = sMName;
ModelNameCell.Controls.Add(hlModelName);
BreadCrumbRow.Controls.Add(ModelNameCell);
tblBreadCrumb.Controls.Add(BreadCrumbRow);
}
For example if the word is say 's&w value fields' then its only displaying the letter 's' and the rest is cut off. I have to escape the & sign but how do I do it since its coming from the database (dynamic) and I dont know which one of them have the & sign. I have to display the words as it is from the database. How do I do this?
Below is my partial code: I have a tablecontrol created and then wrote this code:
string sMName = Request.QueryString["sMName"];
if (Request.QueryString["sMName"] != null)
{
TableCell ModelNameCell = new TableCell();
HyperLink hlModelName = new HyperLink();
hlModelName.NavigateUrl = "../products/.aspx?cid=" + iCID + "&sMName=" + sMName;
hlModelName.Text = sMName;
ModelNameCell.Controls.Add(hlModelName);
BreadCrumbRow.Controls.Add(ModelNameCell);
tblBreadCrumb.Controls.Add(BreadCrumbRow);
}