file upload and repeater
-
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(); -
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();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.
-
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.
-
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.
-
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.
-
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.
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
-
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
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.
-
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.
-
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.
-
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.
-
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..
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.
-
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.
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();