How to use - Eval("SomeItem") in a code-behind

Discussion in 'ASP .Net' started by Paul, Mar 16, 2006.

  1. Paul

    Paul Guest

    I am using Visual Studio.net 2005 (and asp.net 2.0)
    Let's say that in a Web Project, I have created a (Dataset?) called
    SomeDataset.xsd.
    On it I have a TableAdapter called SomeTableTableAdapter and a query called
    GetSomeInfoQuery.

    In an aspx page I used an ObjectDataSource, and chose as the business object
    SomeDataSetTableAdapters.SomeTableTableAdapter, then the method
    GetSomeInfoQuery.
    On the aspx side of the page I have a have a FormView with various objects
    (labels) displayed that use the Eval("SomeItem") syntax to render.

    Question: How would I assign a label value programmatically in the
    codebehind?
    I tried Label.text=Eval("Something1") copying it form the source of the aspx
    page, but it did not work.

    In asp.net 1.1, there was a whole riggamarole that was necessary, writing
    class files etc, then instantiating them in the page.aspx.vb... Is there an
    easier way to do it in asp.net 2?

    TIA,

    Paul
     
    Paul, Mar 16, 2006
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ben Miller [msft]

    Re: Code Behind vs. no code behind: error

    Ben Miller [msft], Jun 27, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    594
    Alphonse Giambrone
    Jun 28, 2003
  2. Daniel Manes

    Code-Behind Pain in the Behind!

    Daniel Manes, Jun 10, 2005, in forum: ASP .Net
    Replies:
    11
    Views:
    669
  3. Niclas

    databinder.eval in code behind

    Niclas, Dec 5, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    11,792
    Karl Seguin
    Dec 5, 2005
  4. pedestrian via DotNetMonster.com

    ASP.NET 2.0: To use or not to use code behind?

    pedestrian via DotNetMonster.com, Sep 27, 2006, in forum: ASP .Net
    Replies:
    5
    Views:
    345
    Steven Nagy
    Sep 28, 2006
  5. John

    Non-code behind to code behind

    John, Feb 19, 2007, in forum: ASP .Net
    Replies:
    2
    Views:
    491
    =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
    Feb 19, 2007
Loading...

Share This Page