How To ??? combine appSettings with DataBinder.Eval

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • RobASPNewGuy
    New Member
    • Aug 2007
    • 1

    How To ??? combine appSettings with DataBinder.Eval

    Hi, I'm new to this forum and hope I can get some help.
    I would like to make life easier by combining a appSetting (global variable set in the web.config file) and DataBinder.Eval to create a dynamic link to an image src
    I have been trying alot of different variables, searching the net but no luck yet getting a combo that works. The following code works but I want to change out the "http://localhost/RobAudioVideo/images/" with a call to an appsetting so I only have to make a change in one place when I switch between different servers with different directory structures :

    <img id="Image1" runat="server" width="50"
    visible='<%# IsImageAvailabl e(DataBinder.Ev al(Container.Da taItem, "Image1"),DataB inder.Eval(Cont ainer.DataItem, "Filetype") ) %>'
    src='<%# "http://localhost/RobAudioVideo/images/" & DataBinder.Eval (Container.Data Item, "Image1") %>' />

    I appreciate help swapping out the hardcode & DataBinder with an appSetting and DataBinder call. Thanks Rob
  • jhardman
    Recognized Expert Specialist
    • Jan 2007
    • 3405

    #2
    Hey, Rob,

    Welcome to the Scripts developer network. I hope someone here will be able to help you. First off, what is your version of asp and what is your development platform?

    Jared

    Comment

    Working...