In my application I have the user click on a row in a data grid to drilldown to the detailed data then displayed on the resulting page. I use this line in the datagrid to make this happen.
<a style="COLOR: black; TEXT-DECORATION: none" href='TestList.aspx?Res=1&Type=Desc&Name=
<%# ((DataRowView)Container.DataItem)["Description"]%>'>
<%# ((DataRowView)Container.DataItem)["Description"]%>
</a>
Everything works fine and I get the results I want until the variable passed from the C# code behind passes a variable with an apostrophe in it. For instance when ((DataRowView)Container.DataItem)[“Description”] returns Brewmister’s Ale it it build the query string as:
“http:/ Brewmister”
instead of
“http:/ Brewmister’s Ale”
Any suggestions will be greatly appreciated.
Thank You,
iRead
<a style="COLOR: black; TEXT-DECORATION: none" href='TestList.aspx?Res=1&Type=Desc&Name=
<%# ((DataRowView)Container.DataItem)["Description"]%>'>
<%# ((DataRowView)Container.DataItem)["Description"]%>
</a>
Everything works fine and I get the results I want until the variable passed from the C# code behind passes a variable with an apostrophe in it. For instance when ((DataRowView)Container.DataItem)[“Description”] returns Brewmister’s Ale it it build the query string as:
“http:/ Brewmister”
instead of
“http:/ Brewmister’s Ale”
Any suggestions will be greatly appreciated.
Thank You,
iRead