Search code examples
c#asp.netimagemap

ImageMap control not changing


I try to set my ImageMap control to diffrent imageurl like this:

ImageMap1.ImageUrl = grapth;
Response.Redirect("~/StockData.aspx");

But for some reason the page ImageMap ImageUrl stays the same.

Any ideas?


Solution

  • When you call Response.Redirect, the browser will issue an entirely new HTTP request, and all state (such as ImageMap1.ImageUrl) associated with the current page is discarded.

    If the current page is already StockData.aspx, then you should simply remove the redirect.