.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

Update updatepanel

Posted By:      Posted Date: September 07, 2010    Points: 0   Category :ASP.Net
Hi,I have user control in my page and i want to update updatepanel on this user control when click on linkbutton on my page.*notice: linkbutton is not inside of user control.

View Complete Post

More Related Resource Links

Run a javascript function after UpdatePanel.Update()


I thought that adding the javascript within the ContentTemplate would cause it to run every time the UpdatePanel was updated.  For example, I would assume that for the following:

<atlas:UpdatePanel ID="UpdatePanel1" runat="server" Mode="Conditional" >
        Hello from inside the update panel!!!!
        <asp:Button ID="foo" runat="server" OnClick="foo_Click" Text="Click me to postback!" />
        <script type="text/javascript">alert('Javascript, baby!');</script>

 would cause the function alert() to run every time the UpdatePanel returns from the button click.  This is not the case, however.

How do I do this?  My update panel contains a scrolling Div and I

perform UpdatePanel.Update from different page

I have Page_A.aspx and Page_B.aspx Page_A.aspx has a text box and a Send button. Page_B.aspx has a Label control on it, inside an UpdatePanel I want that when I type something in Page_A.aspx and click Send, the text of Label on Page_B.aspx should be  updated with the text box text and the UpdatePanel should be updated. Is this possible? Page_A.aspx:<asp:TextBox runat="server" ID="ssMessage"></asp:TextBox> <asp:Button runat="server" ID="ssSendButton" Text="Send" OnClick="SendMessage" />   Page_B.aspx:<asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager> <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional"> <ContentTemplate> <asp:Label runat="server" ID="ssCommonRoom"></asp:Label> </ContentTemplate> </asp:UpdatePanel>  

Height Doesn't Resize After Update with UpdatePanel in IE



On a page I made, I have a pretty standard update panel. In the update panel are radio buttons that trigger the update panel to change it's view (list or grid) based on which radio is selected. This works great in every browser except IE8. IE8 doesn't seem to want to update the height of the panel when it's refreshed causing the content are to stay rather large or to not be large enough.

You can see it here:


<asp:UpdatePanel ID="uplVideos" ChildrenAsTriggers="true" UpdateMode="Conditional" runat="server">
                    <div id="plVideosControls">
                	    <span style="font-weight: bold; line-height: 26px;">Display Mode:  </span>
                        <asp:RadioButtonList ID="rblVideosDisplay" CssClass="rblVideosDisplay" 

                            <asp:ListItem Text="Table" Value="table" />

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

Nested updatepanel updating all the update panel



I have one update panel which is having tPlaceholder which is loading dynalically.

<asp:UpdatePanel ID="UpdatePanel_ForumContent" runat="server" UpdateMode="Conditional">
            <asp:PlaceHolder ID="ForumTopicPlaceHolder" runat="server" Visible="true"></asp:PlaceHolder>

in the CS file on page load, adding Placeholder dynalically

 Control ForumTopicTabControl = LoadControl("Topic.ascx");
                Assembly objAssembly = BuildManager.GetCompiledAssembly("~/Topic.ascx");
                Type objType = objAssembly.GetType("Blogs_ForumTopic");
                PropertyInfo objProperty = objType.GetProperty("TableName");
                objProperty.SetValue(ForumTopicTabControl, dr["TopicTableName"].ToString(), null);
                objProperty = objType.GetProperty("HeaderName");
                objProperty.SetValue(ForumTopicTabControl, dr["Name"].ToString(), null);
                objProperty = objType.GetProperty("HeaderDesc");
                objProperty.SetValue(ForumTopicTabControl, dr["Description

Execute jquery function after updatepanel.update


I want to execute following function after I have called updatepanel.update:

Public Sub StartScroller()
        Me.Page.ClientScript.RegisterClientScriptBlock(Me.[GetType](), "startscroll", "$(document).ready(function () {$('.scrollable').scrollable();});", True)
    End Sub

It doesnt work. I also tried RegisterStartupScript. I would expect the scrollable() method to be executed. But it doesnt.

    <asp:UpdatePanel ID="upnlCompareLocations" runat="server">
<a class="prev browse left"></a>
<div class="scrollable">   
   <!-- root element for the items -->
   <div class="items">

        <asp:ListView ID="repLocationsToCompare" ItemPlaceholderID="itemsGoHere" DataSourceID="XMLDSCompare" GroupItemCount="4" runat="server">
                <asp:PlaceHolder runat="server" ID="itemsGoHere"></asp:PlaceHolder>
                    <%# XPath("title&

update another updatepanel when current updatepanel is updated


I have a button "ibtnDelete" in updatepanel 1 "upnlCompareLocations" and when its clicked I want to update updatepanel 1 AND updatepanel 2 "upnlOverview":

    <asp:UpdatePanel ID="upnlCompareLocations" runat="server">
        <asp:ListView ID="repLocationsToCompare" ItemPlaceholderID="itemsGoHere" runat="server">
                    <asp:ImageButton Text="Delete" ID="ibtnDelete" ImageUrl="~/images/delete.gif" CommandName="deletecompare" CommandArgument='<%# string.Format("{0}",DataBinder.Eval(Container.DataItem, "id"))%>' runat="server" />

Slow updatepanel.update() in IE6/7, fast in firefox?! tried fix.


I have an update panel with about 5 slider extenders, 10 textboxes, and 3 dropdown bullet list.  When a slider is moved, a partial postback occurs, that which the server also updates another textbox with a value by first setting the textbox (.text = somevalue) and then calling the updatepanel.update().

I find out that this command updatepanel.update() significantly causes IE6 and IE7 browser to lag about 1-1.5 seconds longer when updating the values in the textbox.  It is sort of unacceptable.

I have applied this fix already: http://support.microsoft.com/kb/2000262

but it is not helping.

However, I must say, this problem is not occuring in FireFox 3.6.  In fact, it has no lag whether or not the fix is used.  The problem only occurs in IE6 and IE7.

Any idea why an updatepanel is slow to refresh?


Update parent updatepanel from within usercontrol?

I have an updatepanel (updatemode="conditional"), within this updatepanel I have a modalpopup and in the modal popup I have a usercontrol that contains another updatepanel (updatemode="conditional").

What I wanna do now is...
In the inner updatepanel I have a form, when posted, this form will check if the fields are valid and if not send a error message.
If they are valid and all is fine then update the outer updatepanel.

Now it works fine to update the inner updatepanel on error. But how do I update the outer panel?

Dynamic images appear blank (white) after UpdatePanel update


I have a GridView within an UpdatePanel.  The UpdatePanel refreshes on a Timer.

On that GridView is a column of preview images that are dynamically created by resizing the original images.

I lazy load the images after the page has loaded using the Javascript below:

    var urls = '';

    function saveImageUrl(imgID, url) {
        urls = urls + imgID + '|' + url + ';';

    function postLoadImages() {
        if (urls != '') {
            var images = urls.split(';');
            for (var i = 0; i < images.length - 1; i++) {
                var subparts = images[i].split('|');
                $get(subparts[0]).src = 'Code/ImageHandler.ashx?s=tip&url=' + subparts[1];
            urls = '';

I call the saveImageUrl() function in the RowDataBound event of the GridView:

     var script = string.Format("saveImageUrl('{0}', '{1}');", previewImage.ClientID, imageUrlHiddenField.Value);
     ScriptManager.RegisterStartupScript(Page, Page.GetType(), Guid.NewGuid().ToString(), script, true);

On the initial page load, the HttpHandler is hit and the images load as expected.

However, when the GridView is ref

UpdatePanel on update fires _PageLoad twice


 I have two updatepanel in a page which use a master page. the two updatepanels update mode is conditional

          1st updatepanel update mode = conditional and childreenAstrriger = false

          2nd updatepanel update mode = conditional

When i click any element in the fist updatepanel it update the second update panel with .Update() method.

When i click second update panel only second one will update (its ok).

All Works fine when i run from server as i excepted.

          But when i run from visual studio(8) the first update panel works normally, but when i clicked any element in the second update panel, I put a break point in _PageLoad(), i notified that _PageLoad() events fire twice. First time it is as NotIsPostBack and in the second time as IsPostBack (what i excepted is  single _PageLoad() events fires and is IsPostBack but this was not what when i run from VS(8) but from server all things ok)  (i have a grid in second update panel and it have preRender event also with RowCommand , updating...etc.)

Call a Javascript after an updatepanel has finished update



I want a Javascript function to be called automatically after the UpdatePanel has finished updating its contents. I don't want to use:


and then call a JS function. This is because I have more than one update panels and I'll have to write all the condions to check which UpdatePanel was actually called and then do something. Can something be done using Triggers in UpdatePanel. Kindly let me know how this can be done.

It would be great of you could post a sample code too.

Thanks in advance.

ASP.Net Gridview Edit Update Cancel Commands

In ASP.Net 2.0, GridView Control also provides the functionality to edit and update the data retrieved from the database using CommandField template. You can cancel the action using Cancel Command of the CommandField. GridView consists of events that can be used to perform the actions like edit, update and cancel upon the Data items displayed in the ASP.Net GridView Data Control.

How to format and update GridView and DataGrid rows using JQuery

The behavior described in this question is as expected. When you set text of a cell in grid, it directly affects HTML that is going to be rendered. When you set text value of a cell, it means that you are setting innerText of the cell. The column that GridView creates for command fields (Edit, Delete and Select) are a (anchor) or button elements. So you can see what will happen if you set text value in that cell. It will wipe out those link or button controls and replace them with simple text string.

Update Vs SystemUpdate

Many of you might noticed that share point ListItem has Update() method as well as SystemUpdate().

What is the difference between these two methods and why MOSS has two different APIs for updating an ListItem

SqlCommand.ExecuteNonQuery() returns -1 when doing Insert / Update / Delete

Sometimes you end up with a return value of -1 when using the SqlClient.SqlCommand.ExecuteNonQuery method.

Why is that?

Well, the ExecuteNonQuery method is there for statements for changing data, ie. DELETE / UPDATE /INSERT, and the returned value are the number of rows affected by that statement.

When checking the documentation we can see that there are some conditions that return -1.

For UPDATE, INSERT, and DELETE statements, the return value is the number of rows affected by the command.

When a trigger exists on a table being inserted or updated, the return value includes the number of rows affected by both the insert or update operation and the number of

rows affected by the trigger or triggers. For all other types of statements, the return value is -1. If a rollback occurs, the return value is also -1.

>>>How to update multiple rows of gidview by one click



I want to add multiple rows of a gridview if the data for multiple fields are same.

Idea for this is that a user may search a record with some parameter e.g. Sector, plot.

For example 15 records being displayed in gridview.

There should be checkbox before every row and if user wants to update Plot and Flat No that is same for 10 rows out of 15 so he will check the rows and update.

For this a dialog box should appear asking for the parameter i.e. Plot and Flat or something else next time may be it will be City or country. Moreover, there is already an Edit button to update records, when user click it another page open for the record to be updated and whatever he wants to update, it updates.

Hope everone understand the scenario.

I don't want to disturb the already provided Edit functionality and want to provide same record to be updated.

Any idea in this regard would be appreciated.

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