Groups | Blog | Home
all groups > asp.net > february 2006 >

asp.net : Databind ??


Cowboy (Gregory A. Beamer) - MVP
2/1/2006 6:52:45 AM
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!
***************************


[quoted text, click to view]
Sonu Kapoor
2/1/2006 3:10:38 PM
Can you show us some example code?

Sonu Kapoor [MVP]
---
Adam J Knight
2/1/2006 11:10:33 PM
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

AddThis Social Bookmark Button