hi , iam using asp.net with c#,
in my page iam displaying old image and new image . then iam uploading and updating the images .the new image will be the newlly uploaded and display in new image control and previous image was displaying in new image control will display in
old image control .
the problem is when i am redirecting to othe pages and came back to same page then modified images are not displayed
old images are displaying.... how to solve this problem can you give me example which helps me
<body>
<form id="form1" runat="server">
<div>
<asp:ImageButton ID="New" runat="server" Height="256px" ImageUrl="~/Nectarbig.JPG"
OnClick="ImageButton1_Click" Style="z-index: 100; left: 0px; position: absolute;
top: 0px" Width="336px" />
<asp:ImageButton ID="Old" runat="server" Height="192px" Style="z-index: 101;
left: 424px; position: absolute; top: 56px" Width="288px" />
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Style="z-index: 102;
left: 120px; position: absolute; top: 432px" Text="Button" />
<asp:LinkButton ID="LinkButton1" runat="server" OnClick="LinkButton1_Click" Style="z-index: 105;
left: 880px; position: absolute; top: 24px">nextasp:LinkButton>
<asp:FileUpload ID="FileUpload1" runat="server" Style="z-index: 104; left: 96px;
position: absolute; top: 392px" />
div>
form>
body>
protected void Button1_Click(object sender, EventArgs e)
{
//Label1.Text = "Hello Click Here";
string fn=FileUpload1.PostedFile.FileName;
string[]fi=fn.Split('\\');
string name=fi[fi.Length-1];
FileUpload1.PostedFile.SaveAs(Server.MapPath("images/"+name));
Old.ImageUrl = New.ImageUrl;
New.ImageUrl = "~/images/" + FileUpload1.FileName;
}
protected void LinkButton1_Click(object sender, EventArgs e)
{
Response.Redirect("resizableextender.aspx");
}
Loading
Jaish MathewsPosted Apr 27, 2010, 1:33 PM
You need to keep the selected values in session. Do following steps
OnClick="ImageButton1_Click" Style
top: 0px" Width="336px" />
Becasue we will set the images through code only
2. Add below 2 methods in ur code behind
charan sekharPosted Apr 28, 2010, 2:28 AM
Really This Logic Helps Me.....