Results 1 to 4 of 4

Thread: RESOLVED!!! Dynamically displaying image from database

  1. #1

    Thread Starter
    Hyperactive Member ARPRINCE's Avatar
    Join Date
    Mar 2003
    Location
    Pinoy in NJ
    Posts
    381

    Question RESOLVED!!! Dynamically displaying image from database

    I have a webpage with a textbox1 and a button. User enters a number and clicks on the button and it will display the corresponding picture from the database.

    How do I code it in such a way that the code below takes that value of my textbox1 instead of a static image id number of 2?

    TIF

    Code:
    <IMG SRC="ShowEmployeePicture.aspx?ImageID=2 " style="Z-INDEX: 101; LEFT: 16px; WIDTH: 56px; POSITION: absolute; TOP: 16px; HEIGHT: 56px"
    				height="56" alt="" width="56">
    VB Code:
    1. Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    2.         'Code (ShowEmployeePicture.aspx ) that accepts the query from the calling page (ShowEmployee.aspx) above.
    3.         Dim iImageID
    4.         iImageID = Request.QueryString("ImageID")
    Last edited by ARPRINCE; May 28th, 2004 at 11:24 AM.

  2. #2
    Frenzied Member Memnoch1207's Avatar
    Join Date
    Feb 2002
    Location
    DUH, Guess...Hint: It's really hot!
    Posts
    1,861
    Have you tried...
    Code:
    IMG SRC="ShowEmployeePicture.aspx?ImageID='" & TextBox1.Text & "'
    Being educated does not make you intelligent.

    Need a weekend getaway??? Come Visit

  3. #3

    Thread Starter
    Hyperactive Member ARPRINCE's Avatar
    Join Date
    Mar 2003
    Location
    Pinoy in NJ
    Posts
    381
    Tried adding that on my HTML code but I'm getting an underline on the textbox1.text.

    tnx

  4. #4

    Thread Starter
    Hyperactive Member ARPRINCE's Avatar
    Join Date
    Mar 2003
    Location
    Pinoy in NJ
    Posts
    381
    OK. Here's my workaround.

    (1) Modified the HTML code by removing the number 2.
    Code:
    <IMG SRC="ShowEmployeePicture.aspx?ImageID="style="Z-INDEX: 101; LEFT ..... >
    (2) Passed my textbox1.text into a session.
    VB Code:
    1. session("S_ImageID")=textbox1.text
    (3) Called the session from the other page.
    VB Code:
    1. Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    2.         'Code (ShowEmployeePicture.aspx ) that accepts the query from the calling page (ShowEmployee.aspx) above.
    3.         Dim iImageID
    4.         iImageID = Val(Session("S_ImageID"))
    Attached Images Attached Images  

Posting Permissions

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



Click Here to Expand Forum to Full Width