Showing posts with label nested. Show all posts
Showing posts with label nested. Show all posts

Monday, March 26, 2012

Intended behaviour for updateProgress??

I have 2 updatePanel, one nested inside another and 2 updateProgress. The 1st updateProgress is inside the outer updatePanel but outside the inner updatePanel. The 2nd updateProgress is inside the nested 2nd updatePanel.

When I click a button inside the 2nd nested updatePanel, both updateProgress controls display. Is this the intended behaviour?

UpdateProgresses aren't tied to an update panel unless you set them to be using the AssociatedUpdatePanelID property.

I have posted the code to duplicate this issue herehttp://forums.asp.net/thread/1556109.aspx

Has anyone heard anything about a fix for this?

Saturday, March 24, 2012

Invalid Cast Exception on DynamicPopulateExtender

Hi

I have a DynamicPopulateExtender nested within a repeater control, which is in turn populated from a code behind class. When the DynamicPopulateExtender fires, I get an invalid cast exception:

" Unable to cast object of type 'ASP.gallery_aspx' to type 'System.Web.UI.WebControls.RepeaterItem'. "

This is being caused by the dynamic context key - I've tried passing a literal string and it works. Any suggestions? Here's the code:

In 'gallery.aspx'

<script runat="server">

<System.Web.Services.WebMethod()> _
Public Function GetSinglePhoto(ByVal ContextKey As String) As String


Dim sbHTML As New StringBuilder

sbHTML.Append("<img src="http://pics.10026.com/?src=)
sbHTML.Append(Chr(34))
sbHTML.Append("photos/")
sbHTML.Append(ContextKey)
sbHTML.Append(Chr(34))
sbHTML.Append(" />")

Return sbHTML.ToString

End Function

</script>

...............

then

.................

<asp:Panel runat="server" ID="thumbnails">
<asp:Repeater ID="repGallery" runat="server">


<ItemTemplate>


<img src="http://pics.10026.com/?src=<%#DataBinder.Eval(Container.DataItem, "ImageFile")%>"Alt="<%#DataBinder.Eval(Container.DataItem, "AltText")%>"class="gallery"/>


<atlasToolkit:DynamicPopulateExtender ID="dp" runat="server">
<atlasToolkit:DynamicPopulateProperties
TargetControlID="mainpic"
PopulateTriggerControlID="thumbnails"
ServiceMethod="GetSinglePhoto"
ContextKey='<%#DataBinder.Eval(Container.DataItem, "ImageFile")%>'
UpdatingCssClass="dynamicPopulate_Updating" />
</atlasToolkit:DynamicPopulateExtender>


</ItemTemplate>
</asp:Repeater>
</asp:Panel>

............

and method to poulate repeater, in the code behind

...............

Private Sub GetPhotos()
Dim dv As DataView = _
CType(sdsGallery.Select(DataSourceSelectArguments.Empty), DataView)

For Each drv As DataRowView In dv
drv("ImageFile") = ConfigurationManager.AppSettings("GalleryFolder") & drv("ImageFile")
Next

repGallery.DataSource = dv
repGallery.DataBind()
End Sub

Please reply with acomplete, self-contained sample page that demonstrates the problem so that we can investigate the specific behavior you're seeing. Thank you!