Showing posts with label image. Show all posts
Showing posts with label image. Show all posts

Wednesday, March 28, 2012

ASP.NET AJAX Showcase image rollover ?

I was wondering if anyone knew how the image roll-over was accomplished on the ASP.NET AJAX Showcase page?

http://ajax.asp.net/showcase/default.aspx?tabid=47

Thanks

http://forums.asp.net/1671436/ShowThread.aspx

Prior to making your own post, I recommend searching the forum for existing posts which may answer your question. Smile

ASP.NET AJAX Hovermenu question

I dynamiccally add hovermenu's to every image in a panel. When i hover the items with the hovermenu, the hovermenu appears. In IE 7, it's works perfectly. However, in IE 6 the hovermenu shows a white square next to the hovermenu exactly the same size as the original one. Does anyone knows how to disable this other white square.

arjen1984

Hi,

Here is a rough sample, it's working fine on IE 6.

<%@. Page Language="C#" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><script runat="server"> protected void Page_Load(object sender, EventArgs e) { int i = 0; for (; i < 5; i++) { Image img = new Image(); img.ImageUrl = "images/MS.JPG"; img.ID = "img" + i.ToString(); Panel1.Controls.Add(img); AjaxControlToolkit.HoverMenuExtender hme = new AjaxControlToolkit.HoverMenuExtender(); Panel1.Controls.Add(hme); hme.PopupPosition = AjaxControlToolkit.HoverMenuPopupPosition.Right; hme.ID = "hme" + i.ToString(); hme.TargetControlID = img.ID; hme.PopupControlID = "Panel2"; } }</script><html xmlns="http://www.w3.org/1999/xhtml" ><head runat="server"> <title>Untitled Page</title> <script type="text/javascript"> </script></head><body> <form id="form1" runat="server"> <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager>   <asp:Panel ID="Panel1" runat="server" Height="50px" Width="125px"> <asp:Panel ID="Panel2" runat="server" Height="50px" Width="125px"> <asp:LinkButton ID="LinkButton1" runat="server">LinkButton</asp:LinkButton><br /> <asp:LinkButton ID="LinkButton2" runat="server">LinkButton</asp:LinkButton> </asp:Panel> </asp:Panel> </form></body></html>

You are absolutely right about that, it shows perfectly. This is when you have 1 page. Now I have a master/details page. In this is goes all wrong.

Can someone give me a hint?

Monday, March 26, 2012

ASP.NET AJAX and Image Problem

Hi all.

I am using AJAX Tab Control to display a grid view in one tab and an IMAGE in another tab.

The image is created within the program and saved to "images" folder using Serve.MapPath.

Everytime the TAB index is changed, I do postback and call the code to create IMAGE. The image displays the value of dropdown box.

When I click the IMAGE TAB for the first time it is displaying the value of dropdown box correctly. But when I select another value and click the IMAGE TAB again it is not updating the image... it still shows the old image. But I am sure that the IMAGE is updated with new value (i can open the image from "images" folder manually and see the new value).

I am also sure that the page is posted back and new image is created (debugging revelas this).Even I change the tabs and come back to the image tab, it still shows old image..even thought the ImageUrl is pointing to the new (updated) image.

But when i press F5 (refresh) it is displaying the updated image with new value.

Can anyone help me solve this ? I dont want the user to press F5 everytime they select new value from dropdown box. I want the user to select new value and then press the TAB and display the new Image.

Thanks,

Chandra

Use this. it will work.

i think the cached output shown everytime.

to clear it, add the following code in the code behind.

Response.Expires = 0;

Response.Cache.SetNoStore();

Response.AppendHeader("Pragma","no-cache");

it will work.


Hi

Thanks for the reply. I have another problem! it works well in FIREFOX but not in IE!!

how can I solve this browser issues ?

Chandra.


Add the following line on top of the Page_Load event handler and your ASP.NET page will not be cached in the users browsers:

Response.Cache.SetCacheability(HttpCacheability.NoCache)

it will work.

Wednesday, March 21, 2012

ashx image not updating in UpdatePanel

Hi there


I have an update panel containing an image. The image source is pointing to a .ashx file..

<asp:UpdatePanel ID="GraphUpdatePanel" runat="server" UpdateMode="always">
<Triggers>
<asp:AsyncPostBackTrigger ControlID="GraphUpdateTimer" EventName="Tick" />
</Triggers>

<ContentTemplate>
<div>
<img alt="graph" style="width: 120px; height: 100px" id="imgGraph" runat="server" src="http://pics.10026.com/?src=VUMeter.ashx" />
</div>

</ContentTemplate>
</asp:UpdatePanel>

I also have a tick function outside of the update panel

<asp:Timer ID="GraphUpdateTimer" Interval="1000" runat="server" Enabled="true" OnTick="GraphUpdateTimer_Tick">
</asp:Timer

My GraphUpdateTimer tick event changes the src attribute of the iimage to include some query strings, e.g.

imgGraph.Src = "VUMeter.ashx?x=1&y=2";

The tick event is hit every second as I would expect but the ProcessRequest in the .ashx file is not hit...!?!?!?

Any ideas why?

Please help (it's doing my nut!!!!)

Thanks

Mike

Hi

I can see nothing wrong with that code, try installing fiddlerhttp://www.fiddlertool.com/fiddler/ to see if the request is being sent to the VUMeter.ashx file after the tick event. Is the graph being written out correctly on first load of the page?

Cheers Si


Hi

Upon the 1st page load I can see the ashx call, but following that initial call, all I see are the main pages, and no more ashx entries...

POST http://192.168.202.141/AudioSoft/Maintenance/NotImplemented.aspx?AppName=Maintenance
200 OK

GET http://192.168.202.141/AudioSoft/Maintenance/VUMeter.ashx?recorder=RADARSCREEN&channel=-1
200 OK

POST http://192.168.202.141/AudioSoft/Maintenance/NotImplemented.aspx?AppName=Maintenance
200 OK

POST http://192.168.202.141/AudioSoft/Maintenance/NotImplemented.aspx?AppName=Maintenance
200 OK

POST http://192.168.202.141/AudioSoft/Maintenance/NotImplemented.aspx?AppName=Maintenance
200 OK

POST http://192.168.202.141/AudioSoft/Maintenance/NotImplemented.aspx?AppName=Maintenance
200 OK

POST http://192.168.202.141/AudioSoft/Maintenance/NotImplemented.aspx?AppName=Maintenance
200 OK

POST http://192.168.202.141/AudioSoft/Maintenance/NotImplemented.aspx?AppName=Maintenance
200 OK

POST http://192.168.202.141/AudioSoft/Maintenance/NotImplemented.aspx?AppName=Maintenance
200 OK

(NotImplemented.aspx is my page name and the ashx file is called/set from there)

Mike


Ok, this could be a browser caching issue, did you say your definatley changing the querystring everytime? if not it could be the browser checking the cache, seeing it's got the image file already in the cache(as it's got the same url), so does not need to load it. I'd look at setting the content-expiry on the ashx file. Check here(you may need to modify this slightly)

http://www.gloo.ru/gloom.another_asp_net_hack_static_image_cache._l_en.wiki.aspx

Cheers Si


Hi

It does look like this was the problem.

I solved it by just tagging DateTime.Now to the query string so that it was different each time.


All works now!

Many thanks

Mike