Databind ??

A

Adam J Knight

Hi all,

I am trying to bind a value to a hyperlink control.

For some reason it isn't working.

What have i missed?
<asp:HyperLink ID="lnkQuestions" NavigateUrl='Questions.aspx?ID=<%#
DataBinder.Eval(Container.DataItem,"ID")%>' Runat="server">view
questions</asp:HyperLink>

The databinding expression isn't working..it just displays as a string.

If i take it out of the Hyperlink control ...it works fine???

Cheers,
Adam
 
G

Guest

If you need string concatenation, why not bind in the CodeBehind? It is
easier to employ and less error prone than "simple binding".

Now, as for why it is not working. Examine the following:
http://samples.gotdotnet.com/quickstart/aspplus/doc/webdatabinding.aspx

Protected Sub Page_Load(Src As Object, E As EventArgs)
DataBind()
End Sub


--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Staff online

Members online

Forum statistics

Threads
473,774
Messages
2,569,598
Members
45,151
Latest member
JaclynMarl
Top