G
Guest
Hi,
I have a page which displays a list of items retrieved from a database as
hyperlinks and bound using Databinder.Eval. I would now like to set the
navigateURL property to be a page plus a querystring containing an id, but
when I try to do this is always gives me errors regarding the attribute not
being well formed.
The code I have in place is:
<asp:HyperLink ID="hlQuestion" runat="server" Text='<%# DataBinder.Eval
(Container.DataItem, "QuestionTitle") %></asp:HyperLink>
I have tried adding theNavigateURL like this:
<asp:HyperLink ID="hlQuestion" runat="server"
NavigateUrl="~/displayreplies.aspx?qid=" + '<%# DataBinder.Eval
(Container.DataItem, "QuestionID") %>'
Text='<%# DataBinder.Eval (Container.DataItem, "QuestionTitle") %>'>
</asp:HyperLink>
but it doesn't like it. I have tried other combinations but nothing seems
to work.
Can anyone show me how it should be done?
I have a page which displays a list of items retrieved from a database as
hyperlinks and bound using Databinder.Eval. I would now like to set the
navigateURL property to be a page plus a querystring containing an id, but
when I try to do this is always gives me errors regarding the attribute not
being well formed.
The code I have in place is:
<asp:HyperLink ID="hlQuestion" runat="server" Text='<%# DataBinder.Eval
(Container.DataItem, "QuestionTitle") %></asp:HyperLink>
I have tried adding theNavigateURL like this:
<asp:HyperLink ID="hlQuestion" runat="server"
NavigateUrl="~/displayreplies.aspx?qid=" + '<%# DataBinder.Eval
(Container.DataItem, "QuestionID") %>'
Text='<%# DataBinder.Eval (Container.DataItem, "QuestionTitle") %>'>
</asp:HyperLink>
but it doesn't like it. I have tried other combinations but nothing seems
to work.
Can anyone show me how it should be done?