Setting NavigateURL value using data binding.
Posted on 2007-04-08
I am trying to get the value of a database table column and use it to navigate to a different web page. I am using the following syntax which works. It redirects to the new page and passes the value of "refurl" but it does not pass the value of "Story_ID".
<asp:HyperLink id="show_story" runat="server"
NavigateUrl='~/view_story.aspx?refurl=default.aspx&story=<%# DataBinder.Eval(Container.DataItem, "Story_ID") %>
On its own, <%# DataBinder.Eval(Container.DataItem, "Story_ID") %> returns the value stored in Story_ID.
I am trying to use this in a repeater control on a asp.net web page.