# [.net] ASP.Net AJAX, not working with DataList?

This topic is 3687 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I have an asp:DataList with data in it including an asp:LinkButton that fires the DataList's item command handler which uses the WebClient.DownloadFileAsync method. I have a WebClient DownloadProgressChanged handler that I want to use to update an asp:Label asynchronously with the ProgressPercentage. I tried putting the label inside of an UpdatePanel, tried putting both the DataList and Label inside the UpdatePanel, and so forth, with no luck. The text on the page for the label does not change, even though when I debug into the DownloadProgressChanged handler the label is being updated accordingly. I know that there are a number of controls that are incompatible with UpdatePanel, I'm wondering if somewhere in this process something is suffering from a limitation. Or is it something else? I added in a button to test out if ajax was working at all, and I was able to update a label ajaxically. With that in mind I decided to switch out the LinkButton in the DataList with a regular Button, which should be compatible, and within the DataList's item command handler I tried updatng a label, but nothing happened. So I'm leaning towards the problem being with the DataList component.

public void DataList1_ItemCommand(object source, DataListCommandEventArgs e)
{
pnlTransfer.Visible = true;
#region instr1
#endregion
if (!System.IO.File.Exists(filename))
{
pnlVideoPlayer.Visible = false;
pnlTransfer.Visible = true;
}
else
{
pnlVideoPlayer.Visible = true;
pnlTransfer.Visible = false;
}
}

{
lblTransfer.Text = "Transferring: " + e.ProgressPercentage.ToString() + "%";
}


                <div id="video_list_div" style="position:absolute; width:300px; top:30px; height:auto">

<asp:Panel ID="pnlVideoList" runat="server"
style="margin-top: 22px" Width="495px" BackColor=LightGray Visible=false>

<asp:DataList id="DataList1" runat="server"
BorderColor="black"
Font-Names="Verdana"
Font-Size="8pt"
AlternatingItemStyle-BackColor="Gainsboro"
OnItemCommand="DataList1_ItemCommand"
Width=100%
>
Videos
<ItemTemplate>

<hr />
<%# DataBinder.Eval(Container.DataItem, "StringValue") %>
CommandName='<%# DataBinder.Eval(Container.DataItem, "ID") %>'
style="color:Black;font:8pt tahoma" runat="server"/><br />
<hr />

</ItemTemplate>
</asp:DataList>

</asp:Panel>

</div>

...
<div id="transferring_div" style="position:absolute; left:700px; top:170px;">

<asp:Panel ID="pnlTransfer" runat="server" Visible=false>
<asp:Label ID="lblTransfer" runat="server" Text="11"></asp:Label>
</asp:Panel>

</div>

</ContentTemplate>
</asp:UpdatePanel>


[Edited by - ferr on November 9, 2008 2:13:22 AM]

1. 1
2. 2
3. 3
4. 4
Rutin
13
5. 5

• 26
• 11
• 9
• 9
• 11
• ### Forum Statistics

• Total Topics
633701
• Total Posts
3013434
×