.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Refreshing datalist in updatepanel

Posted By:      Posted Date: September 22, 2010    Points: 0   Category :ASP.Net

I have a datalist. When a user clicks a button in the datalist I change some properties and then want to refresh the datalist. However, the code below doesnt seem to refresh the datalist. Once I reload the entire page (which I dont want) the changes are visible in the datalist.
I also tried setting the updatemode of the updatepanel to "Conditional" and update manually in the dlPhotos_ItemCommand, but that doesnt work either.

In bold I've marked where I want to refresh the datalist

        <asp:UpdatePanel ID="upnlPhotos" runat="server">

        <cc1:AsyncFileUpload ID="afuPhoto" runat="server" />

        <asp:DataList ID="dlPhotos" DataSourceID="dsPhotos" DataKeyField="id" RepeatColumns="5" RepeatDirection="Horizontal" GridLines="None" runat="server" >
            <asp:Button ID="btnSetThumbnail" CommandName="setthumb" CommandArgument='<%# stri

View Complete Post

More Related Resource Links

AutoPostback in Repeater in UpdatePanel is refreshing the page

Here's quite a weird problem:I've got a TextBox with AutoPostBack="true" and OnTextChanged property set.The textbox is located inside a Repeater, which in turn is located inside an UpdatePanel.Problem is - whenever the TextBox postsback, the whole page gets reloaded, instead of the UpdatePanel only.Here's how the thing looks:<asp:UpdatePanel runat="server"> <ContentTemplate> <asp:Repeater ID="itemsRepeater" runat="server"> <HeaderTemplate> <ul class="lstProducts"> </HeaderTemplate> <ItemTemplate> <li> <asp:TextBox AutoPostBack="true" OnTextChanged="whatever_Click" runat="server" /> </li> </ItemTemplate> <FooterTemplate> </ul> </FooterTemplate> </asp:Repeater> </div> </ContentTemplate> </asp:UpdatePanel> Interesting thing is, if I take the TextBox out of the repeater, it refreshes only the UpdatePanel.So is if I put a Button inside the repeater - only the UpdatePanel gets refreshed.But whenver I place an AutoPostBack-ing control inside the Repeater, the whole page gets refreshed.Any help would be welcomed,Thanks<asp:UpdatePanel runat="server">             &

problem with datalist in updatepanel


Hi! i try to make a search part. there is a textbox which will be used for search context. also, i need to list category names. i don't use dropdownlist because its styles(for example border-style)doesn't change. So i tyr to do like this:i use a label and datalist. when clicking the label, datalist is showing. when i click the category name on datalist, it will be shown on label.(label is not in datalist.)my problem starts at that point. when i click category name on datalist , page is being postback. so i put datalist into updatepanel. but this time , i click category name on datlist,nothing occurs.(category name doesn't shown on label).my code is below:

<asp:UpdatePanel ID="UpdatePanel1" runat="server">

update datalist in updatepanel after asyncfileupload has uploaded a new file


I want to update an updatepanel after the user has uploaded a photo via the asynfileupload control.

Below is my current code. I also tried setting updatemode="conditional" to "false" and then in code-behind call upnlPhotos.update, but without luck...

Upload photo: <cc1:AsyncFileUpload ID="afuPhoto" runat="server" /><br />

<asp:UpdatePanel ID="upnlPhotos" runat="server">

    <asp:DataList ID="dlPhotos" DataSourceID="dsPhotos" DataKeyField="id" RepeatColumns="5" RepeatDirection="Horizontal" GridLines="None" runat="server" >
        <img alt="" src='/images/trouwlocatiefotos/thumbs/<%# Eval("locpath")%>' /><br />            

    <asp:SqlDataSource ID="dsPhotos" SelectCommand="SELECT id,locationid,locpath from location_photos lp where locationid=@locationid" ConnectionString="<%$ConnectionStr

GridView not refreshing in UpdatePanel after selecting LinkButton


I need help with a GridView that appears in an AJAX UpdatePanel. This GridView contains a TemplateField with a LinkButton that displays a text value.  When the link button is clicked, the code behind needs to capture the text value of the button, and then refresh the GridView with an asynchronous postback within the UpdatePanel and display the updated output.

The post-back event is occurring, and I'm able to capture the event in Visual Studio 2010 debugger.  But, the screen contents do not change after this event occurs.  No exception gets thrown, at least from what I can see in debugger.

Portions of the sanitized code appear below.  The GridView actually appears on a page that contains 2 dropdown lists and 2 other GridViews.  There is just one UpdatePanel on this page.

<asp:UpdatePanel runat="server" ID="upMain" ChildrenAsTriggers="false" UpdateMode="Conditional">
        <asp:AsyncPostBackTrigger ControlID="grdProcesses" EventName="RowCommand" />

		<asp:GridView runat="server" ID="grdProcesses" AutoGenerateColumns="false"
		    BorderColor="#7f9db9" BorderStyle="Solid" CssClass="tblBase"

ajax - Nested Datalist in Updatepanel



I need to input nested data (data entry) and i am using datalists for the same. The details include many details and I am managing the same using controls for each in information.

The parent datalist can have max 20 rows with 7 rows in each child datalist. I tried to bind the datalists with max rows, due to which the rendered page size was almost 12MB and it took more than 2 mins to load.

Alternative to this, I put the parent datalist in updatepanel and bound it to one row initially.  Onclick of add button, i implemented an asynchronous postback to add new row to the parent datalist datasource and update the updatepanel to display the datalist.  The new row is displayed properly in datalist, however it gets reset to original datalist after some seconds.

I have no clue about the reason for it. Please help me to resolve the above issue.


UpdatePanel is not a known element - message when upgrading to 1.0 ajax


It worked on one of my old pages.  I change the web.config, renamed all the <asp.

On some aspx page it doesn't recognize the updatepanel.  It only does on one page.  If I create a new aspx page with a different name - then it works.

Should I just create a new web project ajax - then copy all my code into there?  Or is there a way to get those old pages to recognize the new ajax controls?

Gridview inside updatepanel


I am displaying large amount of data in gridview,the gridview placed within updatepanel,every 1sec i am refreshing updatepanel using ajax timer.my problem is while displaying large data the cpu performance is low,pls give idea to increase cpu performance..

datalist image slide show problem


hi friends

i am binding  images dynamically(back end)for a datalist .iam applying a slideshow for it .I am getting a problem to apply slideshow for dyanmically binded images.If the define in a div statically it working perfectly

for example pls go through my code below:

<script type="text/javascript">
$(document).ready(function() {
        fx: 'scrollLeft' // choose your transition type, ex: fade, scrollUp, shuffle, etc...

<div class="slideshow">
        <img src="images/30_dummy.jpg" width="200" height="200" />
        <img src="images/aquarius.gif" width="200" height="200" />
        <img src="images/star.gif" width="200" height="200" />
        <img src="images/the-proud-indian-flag-1.jpg" width="200" height="200" />

I above code works perfectly and the slide show e

Wicked Code: UpdatePanel Tips and Tricks


Jeff Prosise explains when it's better to use UpdatePanel and when it's better to use asynchronous calls to WebMethods or page methods instead.

Jeff Prosise

MSDN Magazine June 2007

How do you insert a google map into an ajax updatepanel?


I have built a site that I am using google maps on.  The default page has a google map with info windows containing links and all works great... until a user clicks on the link in the info window.  Doing so takes them to a community page that I have built.  On this community page, I have an ajax update panel that has 2 panels nested inside of it with the visibility set for one to be on and the other off.  The default panel shows community photos, and the second panel I want to show the google map and common directions to the community.  In testing, my buttons to switch the visibility of the panels works great as it should without postback, but when I try to add the map to its panel, it does not show up.  I am new to ajax as well as google maps and I'm not sure why the same code would work fine on my default page but not the community page.  The only obvious thing I can assume is because the community page map is in an update panel.  

How do you insert a google map into and ajax updatepanel and have it work correctly?  Many thanks in advance. 

ModalPopup/UpdatePanel from codebehind, inconsistent behavior onClick


First post bear with me please:

I have a simple form with a list of linkbuttons, each fires the same onclick event which sets an indicator image.  I have a dummy button with style="display:none" which I have set as the TargetControlID of the modal.

onClick event from the imagebutton, the modal is shown via modal.Show().  The cancel button inside the modalpopup fires an event which turns off the indicator image and hides the modal via modal.Hide(). 

The events fire perfectly, it's very simple!  Although after doing some testing I noticed the modalpopup is not presented after the 6-10th cycle of clicking the open event, then clicking cancel.  The grey background appears but it is behind the main panel and the modal is either presented behind this or is just simply not displaying. 

I spent hours researching various methods, implemented the CancelControlID to see if it was somehow tied to my call of modal.Hide() that fails.

This occurs with an updatepanel only.  The behaviour is much cleaner this way, so I would hope to be able to implement this.  I have basically eliminated everything but these two events!  Please help

UpdateProgress with a dummy updatepanel not working


I have a Submit button and some functionality like updating DB and fetching next page in the button click event. This process takes a long time and I want to display a message saying "Progress...." right after clicking the botton. I want to do the same in 20 other pages. So, best way to do it wd be to put the modalpopup MPE or an Updateprogress in a usercontrol or in master page. I first tried putting both of these on the page itself to test and see and neither worked.

I tried using Update progress control with a dummy updatepanel and giving the Submit button as Asyntrigger to the dummy updatepanel. I have also tried using MPE but it didnt work either. Below is an example of what i did..

<asp:UpdatePanel ID="UpdatePanel1" runat=server><contenttemplate><triggers><asyntrigger ID= "Submit"> /> /> />

<asp:updateprogress ID="Progress1" unat=server AssociatedUpdatePanelID="UpdatePanel1"><Progresstemplate>Progress.... />/>

<asp:button ID= "Submit" runat=server >

I have nothing for updateprogress in code behind. Am i missing or doing somethign wrong here? Any help would be appreciated.

Datalist with embedded Grid or List...Sub Totals issue with iteration


Let me see if one of you can assist with this one...


i have a similar situation, but mine does not use the selected item (item Command). Here is what the form is to do:


1. this is for an educational environment, so we use SID- NOT SSN's, but i use the SID as a filter in the subset as the grouping unique id.

2. I'm trying to inject a sub total row at the last line item of each SID (if more than one item in the report for that SID).

3. I'm looping thru the items in the Datalist Item Command with a for each (item i in Datalist2.Items).

no response when refreshing reportviewer


Hi guys, I've been struggling with this for some time now, but I can't figure out why it's not working. I got a gridview in which I'm selecting a specific row. This gives me a string back, which is used to load some data inside a datatable, using DAL The callback works and it's also giving the correct string to retrieve the wanted data. But when I'm trying to use this fresh data update my reportviewer (.rdlc) nothing happens. For now I'm testing the event with a simple button, but even with the button nothing happens. Does anyone know what I'm missing The DAL is working correct and I'm using .NET 3.5

<rsweb:ReportViewer ID="ReportViewer" runat="server" Font-Names="Verdana" 
                                 InteractiveDeviceInfos="(Collection)"  WaitMessageFont-Names="Verdana" WaitMessageFont-Size="14pt" >
        <LocalReport ReportPath="Office\Reporting\InvoiceReport.rdlc" />                                
    protected void Button1_Click(object sender, EventArgs e)
        string strInvoiceId = "603663";

        tblInvoiceTableAdapter InvoiceAdapt = new tblInvoiceTableAdapter();
        TGU.tblInvoiceDataTable invoiceDt = InvoiceAdapt.GetIn

UpdatePanel in a Webpart


I'm exploring the usage of UpdatePanels in WebParts for MOSS 2007. The code I have so far for adding a test update panel is this:

                LinkButton goButton;
                goButton = new LinkButton();
                goButton.ID = "butGo";
                goButton.Text = "Go";
                goButton.Command += new CommandEventHandler(goButton_Command);
                goButton.Click += new EventHandler(goButton_Click);

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend