www.webdeveloper.com
Results 1 to 2 of 2

Thread: Trouble with images and database

  1. #1
    Join Date
    Sep 2008
    Posts
    30

    Trouble with images and database

    HI,

    i have an .aspx website, within the site am planing on having a staff directory, i have setup the search, the results and also a more feature to display all there information.

    When you click the More button it is supose to display the text with an image of the person. the images are located on a server and are named via staff ref. below is the code i am trying to use to display but am having no luck so far

    Code:
    <img src='<%# Server.MapPath(@"\\athens\staffimages$\") + Eval("S_STAFFREFERENCE") + Server.MapPath(".jpg") %>' />
    any idea where am going wrong as the Eval section works, i just need the rest to

    thanks

  2. #2
    Join Date
    Sep 2008
    Posts
    30
    Hi,

    i have found help within http://forums.asp.net/

    with someones help i have found this soloution incase anyone comes back to this page

    url = StaffDirectory_photo.aspx?Ref=11111

    Code:
    <img id="StaffPhoto" alt="" runat="server" src="staff_images/default.jpg" height="130" />
    with this in the background

    Code:
    protected void Page_Load(object sender, EventArgs e)
        {
            string Staffreferenceid = Request.QueryString["Ref"];
            string ImgUrl = @"\\athens\staffimages$\" + Staffreferenceid + ".jpg";
            StaffPhoto.Src = ImgUrl;
    
        }
    thanks

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles