I have a web page that has this code below.
When I click on the link, the details page doesn't display any detail information of that particular record. I tried different ways but it's still not working yet.
The data of my company name is something like this:
Company A - 12
Company B
Company C 12-33
The code for hyperlink is below. If I replace the CompanyName with companyID then the detailed page works perfect. It just doesn't work when I replace CompanyID with CompanyName.
<asp:TemplateField>
<ItemTemplate>
<asp:HyperLink ID="Details1" Text="Details" runat="server"
NavigateUrl='<%# Eval("CompanyName", "~/CustomerDetails.aspx?CompanyName=" + Server.UrlEncode(Eval("CompanyName").ToString())) %>' />
</ItemTemplate>
</asp:TemplateField>
The URL string that is displayed on the URL block is:
http://companyname/CustomerDetails.aspx?CompanyName=xxx yy 12-2
What am I missing here?
Thanks so much.