You'll need EnablePartialRendering="true" as an attribute to your ScriptManager tag. Otherwise the entire page will refresh instead of just the UpdatePanel.
Also, it looks like the thumbnails are inside the UpdatePanel and the larger image is outside the UpdatePanel. Didn't you want it the other way around? The content inside the UpdatePanel is what will be reloaded every time you choose a new artist, so I think you want the large image in there, and the thumbnails outside of the UpdatePanel where they don't have to be reloaded each time.
Thanks Steve. Sorry haven't got back sooner but have been away.
Have included EnablePartialRendering="true" and made sure that the update panel surrounds just the control I want updated but still the thumbnails slowly get 'rebuilt' every time.
Can you see anything wrong with this now.
<atlas:ScriptManagerID="ScriptManager1"runat="server"EnablePartialRendering=true/><uc1:control_ArtistHeaderID="Control_ArtistHeader1"runat="server"/><uc2:controlLogo_BriefProfileID="ControlLogo_BriefProfile1"runat="server"/><atlas:UpdatePanelID=up1Mode=Alwaysrunat=server> <ContentTemplate> <uc3:controlMainContentID="ControlMainContent1"runat="server"/>***This is where the larger image gets displayed ***
</ContentTemplate></atlas:UpdatePanel>(click on thumbnails for larger view)<uc4:controlThumbnailsID="ControlThumbnails1"runat="server"/>**** I want the thumbnails to be all the works of a particular artist so they should only change when artistID changes
You need to set up a trigger on the update panel that points to an event on ControlThumbnails1. (Presumably that control raises an event when you click a thumbnail... attach to that.)
Thanks Steve. Can you help me with one last thing. How to raise an appropriate event from the thumbnail click?
I have a repeater full of thumbnails generated from record ID's of a database table and I'd like to catch this record ID upon clicking a specific thumbnail. I used to do this by making the thumbnails hyperlinks but I'm sure there is a more efficicient approach particularly as I want Atlas to do it's 'magic' based on this click.
eg: of the generation of thumbnail images is below.
<
asp:RepeaterID="Repeater1"runat="server"DataSourceID="AccessDataSource1"><ItemTemplate><imgsrc="DisplayImage.aspx?FileID=<%# Eval("FileID") %>&Size=3"/></ItemTemplate><SeparatorTemplate> |</SeparatorTemplate></asp:Repeater>Thanks,
Geoff
Take a look at <asp:ImageButton />.
Thanks Steve. I'm trying that already but run into another problem.
I'm generating all images from a database and the page that renders them is straight code called DisplayImage.aspx.
I don't seem to be able to get correct syntax for the ImageButton.
For example, I can successfully render images with <img src="http://pics.10026.com/?src=DisplayImage.aspx?FileID=99" > but
<asp:ImageButtonID="ImageButton1"runat="server"ImageUrl="DisplayImage.aspx?FileID=99"/>
fails. I get syntax errors and whatever I do doesn't fix it until I give it an absolute address to a real image, say a .jpg.
Can you pass this to another evangelist angel perhaps?
Sorry, nothing jumps out at me from your example.
Try one of the more general ASP.NET forums; I don't think this is really an Atlas question anymore.
hello.
why are you using a page? i think you should use a handler to perform this kind of work. i've built a small sample that loads an image from disk and the image button is able to show it without any problems...btw, i remember a small problem i once had when i tried to load the images maintained in the norwthwind db: they were stored as ole objects and due to that i had to discard the 1st 78 bytes. btw, here's the simple handler i've built to load those images:
public class ImageHandler : IHttpHandler
{
public void ProcessRequest (HttpContext context)
{
if( string.IsNullOrEmpty( context.Request.Params ["ID"] ) )
throw new ArgumentNullException( "O ID da imagem é necessário para obter a imagem a partir da base de dados" );
int id = Convert.ToInt32( context.Request.Params ["ID"] );
using( SqlConnection cnn = new SqlConnection( WebConfigurationManager.ConnectionStrings ["northwindNormal"].ConnectionString ) )
{
SqlCommand cmd = new SqlCommand( "select Picture from Categories whereCategoryID=@.CategoryID", cnn );
cmd.Parameters.AddWithValue( "@.CategoryID", id );
cnn.Open( );
byte [] img = ( byte [] )cmd.ExecuteScalar( );
context.Response.ContentType = "image/jpeg";
context.Response.OutputStream.Write( img, 78, img.Length );
}
}
public bool IsReusable
{
get {
return false;
}
}
}
Thanks Luis. I agree with Steve that this is no longer an Atlas question but the problem still remains even when I use a Handler to apply an imageURL to an ImageButton I cannot make an ImageButton function in the repeater.
In the code below I get the thumbnail images OK but no properly formed imageButtons. Instead I get the Text words 'Submit Query'.
<
asp:RepeaterID="rptImages"runat="server"DataSourceID="OtherImages"> <ItemTemplate> <imgsrc="Handler.ashx?ImageID=<%# Eval("imageID") %>&Size=3" /> <asp:ImageButtonrunat=serverImageUrl='Handler.ashx?ImageID=<%# Eval("imageID") %>&Size=3'/> </ItemTemplate></asp:Repeater>Can you try it and see?
Thanks, Geoff
hello.
well, if you get the text, then that means that the handler isn't returning the expected bytes. btw, what does fiddler show you?
No comments:
Post a Comment