SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Thread: Use Controls

  1. #1
    SitePoint Guru Galo's Avatar
    Join Date
    May 2005
    Location
    Holland!
    Posts
    852
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Use Controls

    Hi all,

    I tried to databind an xml file to an repeater control, while this all works ofcourse i wanted to do something that didn't work
    Code:
    if(Eval("type")){foo.bar}
    but this aint working unless the Eval method is within a property of a control, so i was wondering is there any way can achieve to use a property from the xml file in the ascx code ?

    thanks
    Galo
    Business as usual is off the menu folks, ...

  2. #2
    SitePoint Member
    Join Date
    Sep 2007
    Location
    China
    Posts
    13
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    try it like this:

    <&#37;# if(Eval("type")){foo.bar} %>

  3. #3
    SitePoint Wizard
    Join Date
    Feb 2007
    Posts
    1,274
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    the Eval(...) used in templates is a alias for DataBinder.Eval(...). But I suspect that you can just do with querying the xml document using xpath?

  4. #4
    SitePoint Author silver trophybronze trophy
    wwb_99's Avatar
    Join Date
    May 2003
    Location
    Washington, DC
    Posts
    10,576
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    Are you using XML Data Source? If so, you need to use:

    Code:
    <&#37;# XPath(//some/convoluted/freaking/xpath/[@query]) %>


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •