473,395 Members | 1,468 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

problem when I update an image file in gridview

1
the aspx file as blow
<asp:DetailsView Width="100%" ID="dvOrg" runat="server" DataKeyNames="Id" AutoGenerateRows="False"
OnModeChanging="dvOrg_ModeChanging" OnItemUpdating="dvOrg_OnItemUpdating"
CellPadding="4" GridLines="None" >
<Fields>
<asp:TemplateField SortExpression="Logo" HeaderText="Logo:">
<ItemTemplate>
<asp:Image ID="imgLogo" runat="Server" Width="100px" Height="100px"
ImageUrl='<%# "~/data/OrganizationLogo/" + Eval("Id") + ".jpg" %>' />
</ItemTemplate>
<EditItemTemplate>
<asp:FileUpload ID="fuEditLogo" runat="server" />
200px*200px
</EditItemTemplate>
<asp:CommandField ShowEditButton="True" ValidationGroup="vgOrgEdit" InsertVisible="False">
<ItemStyle HorizontalAlign="Center" />
</asp:CommandField>
</Fields>
</asp:DetailsView>

I use organization id to set the image files name so the name will not change even the file has been update. After I update the image, the gridview still show the old image. I have to click refresh to see the new image.
I use blow code to avoid cache
protected void Page_Load(object sender, EventArgs e)
{
Response.ExpiresAbsolute = DateTime.Now.AddMinutes(-1);
Response.Expires = 0;
Response.CacheControl = "no-cache";
if (!IsPostBack)
{
Initialize();
}
}

I am sure the new image have been saved succussfully. Why it can not been seen at postback.
thank you
May 8 '07 #1
0 917

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Miguel Dias Moura | last post by:
Hello, I have a GridView in my page which is created in runtime. It works fine. My page has 2 Asp Buttons: - The HIDE button makes GridView.Visible = False; - The SHOW button makes...
12
by: Justin | last post by:
I can attach my code if anyone wants to see it however I'll try to ask my question with some mark up code first. I'm having a problem terminating my process while using DoEvents. For example: ...
4
by: =?Utf-8?B?QmFidU1hbg==?= | last post by:
Hi, I have a GridView and a SqlDataSource controls on a page. The SqlDataSource object uses stored procedures to do the CRUD operations. The DataSource has three columns one of which -...
0
by: aj123 | last post by:
I have Table News NewsID, int NewsHeadLint, varcahr(200) OrderNews, int I gridView Display as following query Select ID,NewsHeadLine from News order By OrderNews DESC ---- <asp:GridView...
0
by: SteveT | last post by:
I created an asp.net website which works fine. I then tried to recreate it as a series of Web Application Projects, one project for the data layer, one for the business layer and one for the...
11
by: Ed Dror | last post by:
Hi there, I'm using ASP.NET 2.0 and SQL Server 2005 with VS 2005 Pro. I have a Price page (my website require login) with GridView with the following columns PriceID, Amount, Approved,...
11
by: SAL | last post by:
Hello, I have a Gridview control (.net 2.0) that I'm having trouble getting the Update button to fire any kind of event or preforming the update. The datatable is based on a join so I don't know...
0
by: vinothrao84 | last post by:
Hi, i have the below gridview code in my asp.net c# page. Problem is i having an error saying that "A field or property with the name 'ProfileID, Image' was not found on the selected data...
2
by: doanthithanhnhan | last post by:
I'm working with GridView. But it seems rough. When I add a Command Field (Edit, Update image button type) handly. The OnRowUpdating doesn't fire when I click on Update button. Then I change by...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.