Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Refresh problem on a control
Message
De
11/01/2010 19:08:22
Timothy Bryan
Sharpline Consultants
Conroe, Texas, États-Unis
 
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Versions des environnements
Environment:
ASP.NET
OS:
Windows Server 2008
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01442880
Message ID:
01443348
Vues:
30
>>I have a web I am currently working on that I have published a first pass on. One of my pages contains a control which displays bio content along with a photograph. Both the bio content and the photo come from a SQL Server 2008 database. If there is no photo available, a placeholder photo is displayed. The problem is when you click on one bio name you see the photo but when you click on another the photo doesn't change. However if you click on a name which does not have a photo it changes to the placeholder. Once you get that, you can click back on a name with a photo and get it. I am struggling to see what is causing this behavior. I am posting some of my code if someone else sees why that might happen. The bio content portion always is displayed properly. Both the photo and the bio are on the same control.
>>Thanks
>
>>
>>            if (this.oContent.Entity.HasValues)
>>            {
>>                this.lblName.Text = this.oContent.Entity.ContentName;
>>                this.lblTitle.Text = this.oContent.Entity.ContentDescription;
>>                this.BioContent.Text = this.oContent.Entity.ContentText;
>>
>>                // Get the photo if there is one
>>                if (this.oContent.Entity.ContributorID != null)
>>                {
>>                    Session["contactid"] = this.oContent.Entity.ContributorID.ToString();
>>                    this.imgBoardPhoto.ImageUrl = @"~/ShowPhoto.aspx";
>>                }
>
>
> One issue - if the entity doesn't have any values, you're not setting the image to anything.
>
>It looks like you might be using Telerik's controls for this. If you're using their Ajax control you need to make sure that the treeview is set-up to update the image control (if you go into the Ajax builder you would select the treeview control on the left of the builder and the image control on the right). If you don't do that it won't automatically refresh.

Hi Paul,

Thanks for responding. I am using the Telerik controls and the Telerik Ajax Manager. I have a placeholder on the page with the Ajax Manager set to update the placeholder based on the menu changes on the left. There is a control that is added to the placeholder and that is what is refreshed. The bio content refreshes, so the control is being refreshed but only the image is not. I don't think there is a way for the Ajax manager to refresh individual parts of the control unless I am missing something.

You are right I am not doing anything with the image when the entity doesn't have a value. It is the ones that do have a value that are not getting updated and there must be something in this as it refreshes when it goes back and forth between bios with no photo and bios with a photo. It just doesn't refresh when moving between two records that both have data in the photo.
thanks
Tim
Timothy Bryan
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform