Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Refresh problem on a control
Message
De
13/01/2010 07:16:30
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:
01443638
Vues:
26
>>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.

Paul,

This photo is shown by setting the imageUrl property to an aspx page. The refresh doesn't occur when the aspx photo page is shown and then moving to another record that shows another photo the same way. I wonder if there is something special I need to do to remove the ShowPhoto.aspx page and then recall it. If you move to a record with no image and then back to one with an image it works fine. Any ideas?
Tim
Timothy Bryan
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform