Wrox Programmer Forums
|
ASP.NET 2.0 Professional If you are an experienced ASP.NET programmer, this is the forum for your 2.0 questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 10th, 2009, 02:40 AM
Authorized User
 
Join Date: May 2007
Posts: 95
Thanks: 5
Thanked 0 Times in 0 Posts
Default Update panel problem

i have a gridview inside an update panel. and i have a submit button outside the update panel. Now during the add/edit/delete event of my operations , my page is partially posting back. The problem is if the user clicks on edit button, then my submit button which is outside the update panel should get visible = false. and when the row is finally updated then it should come visible and if all the rows are deleted and only footer remains then submit should again become invisible. Any idea, how to do this when page is partially getting updated!
i have written the code but due to partial page updation it is not working.
Please guide me how to deal with this...

Code:
 public void gridDWApp_RowEditing(Object sender, GridViewEditEventArgs e)
    
        {

            btnSubmit.Visible = false;
            dtDWApp = new DataTable();
            gridDWApp.EditIndex = e.NewEditIndex;
            dtDWApp = (DataTable)ViewState["vdtDWApp"];
            gridDWApp.DataSource = dtDWApp ;
            gridDWApp.DataBind();
        }
-- Abhishek
 
Old August 14th, 2009, 10:43 AM
Authorized User
 
Join Date: Aug 2009
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to amitranjan286 Send a message via Yahoo to amitranjan286
Smile

Hi abhishek, put your gridview and and button inside the update panel and in the trigger of upanel add the click event of the button, that will something like this
<asp:UpdatePanel>
<ContentTemplate>
Here will be your grid view and edit/delete/save button html tags
</ContentTemplate>
<Triggers>
<AsyncronusPostback Event="Click" ControlID="btnSave">
<AsyncronusPostback Event="Click" ControlID="btnEdit">
<AsyncronusPostback Event="Click" ControlID="btnDelete">
<Triggers>
</asp:UpdatePanel>

You can add triggers from UI using trigger property of update panel fromporperties windows.too

Hope it will help





Similar Threads
Thread Thread Starter Forum Replies Last Post
Dropdown in update panel deb1980 ASP.NET 2.0 Professional 0 June 16th, 2009 06:42 AM
Update panel in .net 2.0 DIlip Kumar Sittu .NET Framework 2.0 1 July 18th, 2008 06:44 AM
Javascript Update Panel. blink18jew ASP.NET 1.0 and 1.1 Basics 0 June 30th, 2007 06:46 AM
ViewState problem when adding a panel to a panel koekie17 C# 3 February 20th, 2006 09:17 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.