I have built a report using a datagrid, and one of the columns is a template column in which I place a hyperlink control. While viewing the report, a user may click on a link to bring that record up in a form where they can make edits/updates.
The hypelink column is tied to the street address, and additionally, I am sending some other values in the string. This works very well except for those cases where the street address contains an ampersand "&". Our buildings location table has a number of entrries that use this as opposed to a typical street address, and it plays havoc with my query strings. Tuncating them after the ampersand, so rather than sending "Smith & Vine", I would get "Smith", for which no match would be found, leaving me with the dreaded "there is no row at position 0." exception.
Does anyone know a way around this? The code I'm using currently is listed below.
Private Sub DataGrid1_ItemDataBound(By
Val sender As Object, ByVal e As System.Web.UI.WebControls.
s) Handles DataGrid1.ItemDataBound
Select Case e.Item.ItemType
Case ListItemType.Item, ListItemType.AlternatingIt
Dim link As HyperLink = DirectCast(e.Item.FindCont
link.NavigateUrl = String.Format("http://dcsdesktopprojects.verizon.com/pcRefresh/editLocationInfo.aspx?Street=
link.NavigateUrl += "&City=" & e.Item.Cells(1).Text & "&State=" & e.Item.Cells(2).Text
link.Text = DataBinder.Eval(e.Item.Dat