KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Take a look at the following code: <asp:HyperLinkField DataNavigateUrlFields="NameID" DataNavigateUrlFormatString="names.aspx?nameid={0}" DataTextField="name" HeaderText="Name" ItemStyle-Width="100px" ItemStyle-Wrap="true" /> It takes only the name id to navigate to the next page. How will I include the two other parameters which are not in the gridview. The navigate URL I'm using has to take the keyword which is already present in the gridview and the other two parameters from the database table. I tried using all these codes. Nothing did work for me. <asp:HyperLinkField DataTextField="Keyword" DataNavigateUrlFields="Keyword" DataNavigateUrlFormatString="KeywordSrchSumDtl.aspx?Keyword={0}&State={1}&City={2}" HeaderStyle-VerticalAlign="Bottom" ItemStyle-HorizontalAlign="center" /> I cant use the above the code because the state and city are not in the GridView but available in my data table. I tried using the following code too, but it doesn't work: <asp:TemplateField HeaderText="Keyword" ItemStyle-HorizontalAlign="Center" FooterStyle-HorizontalAlign="Center"> <ItemTemplate> <asp:HyperLink ID="link" runat="server" NavigateUrl='<% # "KeywordSrchSumDtl.aspx?Keyword="Eval("Keyword")+"&State="+Request.QueryString["State"]%>' Text='<%# Eval("Keyword") %>'> </asp:HyperLink> </ItemTemplate> </asp:TemplateField> I also tried this: <asp:HyperLink ID="Link1" runat="Server" NavigateUrl='<%#redirectURL()+Server.UrlEncode((Eval("Keyword")).ToString())%>' Text='<%# DataBinder.Eval(Container.DataItem,"Keyword") %>'> </asp:HyperLink> </ItemTemplate> </asp:TemplateField> .aspx.cs return "KeywordSrch
Tags (comma-separated)
Save Edits
Cancel