Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    New Coder
    Join Date
    Nov 2006
    Posts
    26
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Displaying Images

    Hi guys,

    For most thisíll appear trivial, however for me, itís taking up a lot of frustrating and misdirected time. Very briefly, Iím building a number of web forms to facilitate the collection of personal data. Once collected, the contents of the database can be filtered etc., in order to display an individualís details in much the same fashion as a CV. My problem is that Iím unable to display an image per individual. The text details are being pulled in via the Ď<%# Eval("blablabla") %>í method.

    Iím new to ASP.NET and have recently read Stephen Waltherís similarly entitled book; unfortunately he doesnít really address this topic. Any advice on how I can display an image within an individualís profile?

    Thanks in advance for any response.

    Max01

  • #2
    Senior Coder nikkiH's Avatar
    Join Date
    Jun 2005
    Location
    Near Chicago, IL, USA
    Posts
    1,973
    Thanks
    1
    Thanked 32 Times in 31 Posts
    Are you using .net 2.0 personalization features, or is this something you rolled on your own and are just storing in the database?

    If this post contains any code, I may or may not have tested it. It's probably just example code, so no getting knickers in a bunch over a typo, OK? If it doesn't have basic error checking in it, such as object detection or checking if objects are null before using them, put that in there. I'm giving examples, not typing up your whole app for you. You run code at your own risk.
    Bored? Visit
    http://www.kaelisspace.com/

  • #3
    New Coder
    Join Date
    Nov 2006
    Posts
    26
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hello,

    Thanks for replying. In answer to your question, no, I'm not using .net 2.0 personalization features; it's something I'm attempting to roll out my own. I'm sure it's a really trivial mistake.

  • #4
    Senior Coder nikkiH's Avatar
    Join Date
    Jun 2005
    Location
    Near Chicago, IL, USA
    Posts
    1,973
    Thanks
    1
    Thanked 32 Times in 31 Posts
    Okay, so you said you want to display an image per individual, and you already have text in a database associated with a person.
    Which part are you unsure how to do?
    Do you already have images for people?
    Are you storing those images but unsure how to get them back? Are they stored as files, or as blobs in the database?
    Are they user uploaded images, or chosen from a set of images you already have?

    At the most basic, a user would upload an image and you would store the path to that image in the database. You could then get that path and output it as just a plain old image tag with a dynamic source using your eval syntax.

    If this post contains any code, I may or may not have tested it. It's probably just example code, so no getting knickers in a bunch over a typo, OK? If it doesn't have basic error checking in it, such as object detection or checking if objects are null before using them, put that in there. I'm giving examples, not typing up your whole app for you. You run code at your own risk.
    Bored? Visit
    http://www.kaelisspace.com/

  • #5
    New Coder
    Join Date
    Nov 2006
    Posts
    26
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi,

    Thanks once more for responding.

    Your last paragraph has nailed the problem; a user uploads details including image from which I must sort into an orderly document so as to make it viewable to third parties. I'm saving the path in the following fashion:

    <asp:ImageField
    DataImageUrlField="FileName"
    DataImageUrlFormatString="~/Photos/{0}"
    DataAlternateTextField="AltText" >
    <ControlStyle Width="300px" />
    </asp:ImageField>

    but, this only works in GridView, and moreover, you can only alter the image size to the detriment of its resolution. I want display each Id's details on a seperate page, not in GridView. Also, <ImageField> is a GridView specific property. Any advice?

    Thanks in advance.

    Max01

  • #6
    Senior Coder nikkiH's Avatar
    Join Date
    Jun 2005
    Location
    Near Chicago, IL, USA
    Posts
    1,973
    Thanks
    1
    Thanked 32 Times in 31 Posts
    I'm not totally clear on your architecture, so bear with me.
    Do you have a database row that has all this information, including the image path, in it? And you now want to display it all on one page for a given person?

    If so, simple query and use Repeater, DetailsView, or ListView and use ItemTemplate to display all pretty and formatted as you desire.
    You can use ImageField or just the Image control.
    http://msdn2.microsoft.com/en-us/lib...ols.image.aspx

    If this post contains any code, I may or may not have tested it. It's probably just example code, so no getting knickers in a bunch over a typo, OK? If it doesn't have basic error checking in it, such as object detection or checking if objects are null before using them, put that in there. I'm giving examples, not typing up your whole app for you. You run code at your own risk.
    Bored? Visit
    http://www.kaelisspace.com/

  • #7
    New Coder
    Join Date
    Nov 2006
    Posts
    26
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thank you Nikki, I'll give it a go.

    Max01


  •  

    Posting Permissions

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