Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. file upload and repeater

file upload and repeater

Scheduled Pinned Locked Moved ASP.NET
helpquestion
12 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    m dhu
    wrote on last edited by
    #1

    im using repeater control.had a edit button which redirect to another page(edit.aspx). in edit.aspx i had few textboxes,ddl's and fileupload controls for images.. using sessions im transferring data of employees from repeater page to edit.aspx page. similarly i want to transfer images of that particular employee.. tried using handler.ashx im gettin the last uploaded image(image control) for every employee... help me.... :confused: repeater page

    protected void Repeater1_ItemCommand1(object source, RepeaterCommandEventArgs e)
    {
    }
    if (e.CommandName == "edit")
    {
    // used session to transfer data
    // session["empname"]=dr["empname"]
    }

    edit.aspx

    Image1.ImageUrl = "handler3.ashx?staffID=" + ("staffID");
    TextBox5.Text = Session["headline"].ToString();

    C 1 Reply Last reply
    0
    • M m dhu

      im using repeater control.had a edit button which redirect to another page(edit.aspx). in edit.aspx i had few textboxes,ddl's and fileupload controls for images.. using sessions im transferring data of employees from repeater page to edit.aspx page. similarly i want to transfer images of that particular employee.. tried using handler.ashx im gettin the last uploaded image(image control) for every employee... help me.... :confused: repeater page

      protected void Repeater1_ItemCommand1(object source, RepeaterCommandEventArgs e)
      {
      }
      if (e.CommandName == "edit")
      {
      // used session to transfer data
      // session["empname"]=dr["empname"]
      }

      edit.aspx

      Image1.ImageUrl = "handler3.ashx?staffID=" + ("staffID");
      TextBox5.Text = Session["headline"].ToString();

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      madhukk wrote:

      using sessions im transferring data of employees from repeater page to edit.aspx page.

      Why not just pass it on the URL ?

      madhukk wrote:

      similarly i want to transfer images of that particular employee..

      Where do you store them ?

      madhukk wrote:

      Image1.ImageUrl = "handler3.ashx?staffID=" + ("staffID"); TextBox5.Text = Session["headline"].ToString();

      What are you writing this for ? Is it for your own study ? Will it ever be used by anyone ?

      Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

      M 1 Reply Last reply
      0
      • C Christian Graus

        madhukk wrote:

        using sessions im transferring data of employees from repeater page to edit.aspx page.

        Why not just pass it on the URL ?

        madhukk wrote:

        similarly i want to transfer images of that particular employee..

        Where do you store them ?

        madhukk wrote:

        Image1.ImageUrl = "handler3.ashx?staffID=" + ("staffID"); TextBox5.Text = Session["headline"].ToString();

        What are you writing this for ? Is it for your own study ? Will it ever be used by anyone ?

        Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

        M Offline
        M Offline
        m dhu
        wrote on last edited by
        #3

        im storing in sql server. this is used for my project...

        C 2 Replies Last reply
        0
        • M m dhu

          im storing in sql server. this is used for my project...

          C Offline
          C Offline
          Christian Graus
          wrote on last edited by
          #4

          OK, so you're writing it for yourself, or for someone to use ? Why not just pass the id of the image back to the main page then and load it from there ?

          Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

          1 Reply Last reply
          0
          • M m dhu

            im storing in sql server. this is used for my project...

            C Offline
            C Offline
            Christian Graus
            wrote on last edited by
            #5

            Do you not want to be helped anymore ?

            Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

            M 1 Reply Last reply
            0
            • C Christian Graus

              Do you not want to be helped anymore ?

              Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

              M Offline
              M Offline
              m dhu
              wrote on last edited by
              #6

              passed id to imageurl of image using session... now i got it thanks... and im trying to display thumbnail of the uploaded image. used temporary data table, its working but as i had many uploads its some complicated... any other method to display uploded image as thumbnail in image control... thanks

              C 1 Reply Last reply
              0
              • M m dhu

                passed id to imageurl of image using session... now i got it thanks... and im trying to display thumbnail of the uploaded image. used temporary data table, its working but as i had many uploads its some complicated... any other method to display uploded image as thumbnail in image control... thanks

                C Offline
                C Offline
                Christian Graus
                wrote on last edited by
                #7

                madhukk wrote:

                used temporary data table, its working but as i had many uploads its some complicated... any other method to display uploded image as thumbnail in image control...

                The image is associated with the user, right ? So, just write a http handler that takes the id of the image or the user on the query string, looks up the data and returns it. Make this the URL for your image.

                madhukk wrote:

                passed id to imageurl of image using session...

                I'm not sure why you're asking me for advice, as you appear to, in every step, doing the opposite of what I've suggested. Filling your session with all this data is going to affect performance.

                Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

                M 1 Reply Last reply
                0
                • C Christian Graus

                  madhukk wrote:

                  used temporary data table, its working but as i had many uploads its some complicated... any other method to display uploded image as thumbnail in image control...

                  The image is associated with the user, right ? So, just write a http handler that takes the id of the image or the user on the query string, looks up the data and returns it. Make this the URL for your image.

                  madhukk wrote:

                  passed id to imageurl of image using session...

                  I'm not sure why you're asking me for advice, as you appear to, in every step, doing the opposite of what I've suggested. Filling your session with all this data is going to affect performance.

                  Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

                  M Offline
                  M Offline
                  m dhu
                  wrote on last edited by
                  #8

                  can we display the thumbnail of image before inserting into database....

                  C 1 Reply Last reply
                  0
                  • M m dhu

                    can we display the thumbnail of image before inserting into database....

                    C Offline
                    C Offline
                    Christian Graus
                    wrote on last edited by
                    #9

                    Why would you want to ? What is it that you're trying to do ? If you'd answer this question it might help me make a recommendation.

                    Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

                    M 1 Reply Last reply
                    0
                    • C Christian Graus

                      Why would you want to ? What is it that you're trying to do ? If you'd answer this question it might help me make a recommendation.

                      Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

                      M Offline
                      M Offline
                      m dhu
                      wrote on last edited by
                      #10

                      i want to display the uploaded image once i browse through fileupload control.. but before it is saved in database to check the image uploaded correctly or not..

                      C 1 Reply Last reply
                      0
                      • M m dhu

                        i want to display the uploaded image once i browse through fileupload control.. but before it is saved in database to check the image uploaded correctly or not..

                        C Offline
                        C Offline
                        Christian Graus
                        wrote on last edited by
                        #11

                        You can't do that, because until it exists somewhere on your system, you can't send it back to the client. To send it back as a byte stream requires a seperate page or HTTP handler. It's just not possible.

                        Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

                        M 1 Reply Last reply
                        0
                        • C Christian Graus

                          You can't do that, because until it exists somewhere on your system, you can't send it back to the client. To send it back as a byte stream requires a seperate page or HTTP handler. It's just not possible.

                          Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

                          M Offline
                          M Offline
                          m dhu
                          wrote on last edited by
                          #12

                          using http handler im getting image to a page.. im unable to get all the three images... only 1st image is displayed...

                          //SqlCommand select stmt "select image1,image2,image3 from reviews11 where
                          // staffid=" + staffid
                          SqlDataReader dr = command.ExecuteReader();
                          dr.Read();

                                  context.Response.BinaryWrite((Byte\[\])dr\[0\]);
                                  cnn.Close();
                                  context.Response.End();
                          

                          //another page
                          Image1.ImageUrl = "handler3.ashx?staffID=" +
                          Session["staffid"].ToString();

                          1 Reply Last reply
                          0
                          Reply
                          • Reply as topic
                          Log in to reply
                          • Oldest to Newest
                          • Newest to Oldest
                          • Most Votes


                          • Login

                          • Don't have an account? Register

                          • Login or register to search.
                          • First post
                            Last post
                          0
                          • Categories
                          • Recent
                          • Tags
                          • Popular
                          • World
                          • Users
                          • Groups