Hello All.
I keep asking for help with this on the www.asp.net forums and nobody seems
to be able to help. What I'm trying to accomplish is very simple. I simply
want to create a Hyperlink Column in a Datagrid and reformat the text output
of the column. The helper function seems to be working but the hyperlink
column isn't properly being render into html. The actual hyperlink web
control is showing up in the html when tested on two unique servers.
I'd be grateful if someone here could help! Thanks!
-Shane Fowlkes
Test Page: http://www.vrmca.com/membership/producers.aspx
My Code:
*************** *************** *************** ******
Function EncryptSpaces(C ompany As String) As String
Company = Replace(Company ," ","%20")
Return Company
End Function
....etc.....
<form runat="server">
<asp:datagrid id="dgProducers " runat="server"
HorizontalAlign ="Center"
...etc.....
Width="90%">
<columns>
<asp:TemplateCo lumn HeaderText="Com pany">
<ItemTemplate >
<asp:HyperLin k NavigateUrl ='<%# "memdetails.asp x?org=" &
EncryptSpaces(C ontainer.DataIt em("Company")) %>'>
<%# Container.DataI tem("Company") %>
</asp:HyperLink>
</ItemTemplate>
</asp:TemplateCol umn>
<asp:BoundColum n HeaderText="# of Members" DataField="Coun tOfMember" />
</columns>
</asp:datagrid>
</form>
*************** *************** ****
And the HTML comes out like.....
<td>
<asp:HyperLin k NavigateUrl
='memdetails.as px?org=Hard%20R ock%20Concrete% 20LLC'> Hard Rock Concrete
LLC</asp:HyperLink>
</td>