Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Feb 28, 2013 02:31 AM by chetan.sarode
Member
5 Points
34 Posts
Feb 27, 2013 05:05 AM|LINK
Problem,, i am not getting partial page post page,, instead i get full page reload and then i get the next 4 rows inside table on button click. any idea why i am not getting Ajax functionality. <div> <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager> <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional" > <ContentTemplate> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <th width="35%">Last Degree</th> <th width="35%">Institute</th> <th width="20%">Year</th> <th width="30%">Majors</th> </tr> <tr id="rowFields"> <td> <asp:TextBox runat="server" ID="txtDegree" type="text" onblur="if(this.value=='' || this.value==null) this.value=''" onfocus="if(this.value==''){this.value='';}" placeholder="Last Degree*" size="35" /> </td> <td> <asp:TextBox runat="server" ID="txtInstitue" type="text" onblur="if(this.value=='' || this.value==null) this.value=''" onfocus="if(this.value==''){this.value='';}" placeholder="Institute*" size="35" /> </td> <td> <asp:TextBox runat="server" ID="txtYear" onblur="if(this.value=='' || this.value==null) this.value=''" onfocus="if(this.value==''){this.value='';}" Placeholder="Year*" size="12" /> </td> <td> <asp:TextBox runat="server" ID="txtSubjects" onblur="if(this.value=='' || this.value==null) this.value=''" onfocus="if(this.value==''){this.value='';}" placeholder="Subjects*" size="35" /> </td> </tr> <tr> <td> <asp:PlaceHolder ID="PlaceHolderEdu" runat="server"></asp:PlaceHolder> </td> <td> <asp:PlaceHolder ID="PlaceHolderEdu2" runat="server"></asp:PlaceHolder> </td> <td> <asp:PlaceHolder ID="PlaceHolderEdu3" runat="server"></asp:PlaceHolder> </td> <td> <asp:PlaceHolder ID="PlaceholderEdu4" runat="server"></asp:PlaceHolder> </td> </tr> </table> </ContentTemplate> <Triggers> <asp:AsyncPostBackTrigger ControlID="addmoreEdu" EventName="Click" /> </Triggers> </asp:UpdatePanel> <asp:LinkButton ID="addmoreEdu" runat="server" CssClass="linkbutton" onclick="addmoreEdu_Click" CausesValidation="False">Add More</asp:LinkButton> </div>
Star
13201 Points
2490 Posts
Feb 27, 2013 05:09 AM|LINK
Place Your LinkButton inside the update panel and try...
Feb 27, 2013 05:18 AM|LINK
stanly Place Your LinkButton inside the update panel and try...
HI i did place it inside update Panel but still same nothing changes full page Post Back..
Contributor
2134 Points
494 Posts
Feb 27, 2013 06:14 AM|LINK
Hi
Please check the below sample code its work fine...
<%@ Page Title="Home Page" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="TestApp._Default" %> <asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent"> </asp:Content> <asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent"> <asp:ScriptManager ID="smTest" runat="server"> </asp:ScriptManager> <asp:UpdatePanel runat="server" ID="upTest" UpdateMode="Conditional"> <ContentTemplate> <asp:TextBox ID="txtUpdatePanel" runat="server" /> <asp:Button ID="btnUpdatePanel" runat="server" Text="text" OnClick="btnUpdatePanel_Click" /> <asp:Label ID="lblUpdatePanel" runat="server"> </asp:Label> </ContentTemplate> <Triggers> <asp:AsyncPostBackTrigger ControlID="Button1" EventName="Click" /> </Triggers> </asp:UpdatePanel> <asp:TextBox ID="txtPage" runat="server" /> <asp:Button ID="btnPage" runat="server" Text="text" OnClick="btnPage_Click" /> <asp:Label ID="lblPage" runat="server"> </asp:Label> </asp:Content>
and this is code behind
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; namespace TestApp { public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } protected void btnUpdatePanel_Click(object sender, EventArgs e) { lblUpdatePanel.Text = txtUpdatePanel.Text; lblPage.Text = txtPage.Text; } protected void btnPage_Click(object sender, EventArgs e) { lblPage.Text = txtPage.Text; lblUpdatePanel.Text = txtUpdatePanel.Text; } } }
hope this help you to find the issue
Feb 27, 2013 06:51 AM|LINK
Sankalpa Hi Please check the below sample code its work fine... <%@ Page Title="Home Page" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="TestApp._Default" %> <asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent"> </asp:Content> <asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent"> <asp:ScriptManager ID="smTest" runat="server"> </asp:ScriptManager> <asp:UpdatePanel runat="server" ID="upTest" UpdateMode="Conditional"> <ContentTemplate> <asp:TextBox ID="txtUpdatePanel" runat="server" /> <asp:Button ID="btnUpdatePanel" runat="server" Text="text" OnClick="btnUpdatePanel_Click" /> <asp:Label ID="lblUpdatePanel" runat="server"> </asp:Label> </ContentTemplate> <Triggers> <asp:AsyncPostBackTrigger ControlID="Button1" EventName="Click" /> </Triggers> </asp:UpdatePanel> <asp:TextBox ID="txtPage" runat="server" /> <asp:Button ID="btnPage" runat="server" Text="text" OnClick="btnPage_Click" /> <asp:Label ID="lblPage" runat="server"> </asp:Label> </asp:Content> and this is code behind using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; namespace TestApp { public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } protected void btnUpdatePanel_Click(object sender, EventArgs e) { lblUpdatePanel.Text = txtUpdatePanel.Text; lblPage.Text = txtPage.Text; } protected void btnPage_Click(object sender, EventArgs e) { lblPage.Text = txtPage.Text; lblUpdatePanel.Text = txtUpdatePanel.Text; } } } hope this help you to find the issue
OK my code is similiar to this aswell,, then why mine is not working, i have followed all the rules for using update Panel...
Feb 27, 2013 07:39 AM|LINK
Hi Usman,
I checked the code which you posted also but its work fine for me, what is your expected result?
5032 Points
956 Posts
Feb 27, 2013 08:06 AM|LINK
Hi,
here you have placed you linkbutton outside updatepanel, when you click the button it will postback the page. Instead of putting outside try to move the linkbutton
All-Star
43715 Points
4304 Posts
Microsoft
Feb 28, 2013 02:06 AM|LINK
Please make sure set UpdateMode and triggers correctly.
More details, please refer to: http://msdn.microsoft.com/en-us/library/bb386454.aspx .
66589 Points
11270 Posts
Feb 28, 2013 02:31 AM|LINK
Refer this
http://stackoverflow.com/questions/4872210/full-postback-triggered-by-linkbutton-inside-gridview-inside-updatepanel
http://forums.asp.net/t/1290563.aspx/1
http://bloggingabout.net/blogs/rick/archive/2008/04/02/linkbutton-inside-updatepanel-results-in-full-postback-updatepanel-not-triggered.aspx
UsmanRana
Member
5 Points
34 Posts
Update Panel Always Post Back whole Page
Feb 27, 2013 05:05 AM|LINK
Problem,, i am not getting partial page post page,, instead i get full page reload and then i get the next 4 rows inside table on button click. any idea why i am not getting Ajax functionality. <div> <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager> <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional" > <ContentTemplate> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <th width="35%">Last Degree</th> <th width="35%">Institute</th> <th width="20%">Year</th> <th width="30%">Majors</th> </tr> <tr id="rowFields"> <td> <asp:TextBox runat="server" ID="txtDegree" type="text" onblur="if(this.value=='' || this.value==null) this.value=''" onfocus="if(this.value==''){this.value='';}" placeholder="Last Degree*" size="35" /> </td> <td> <asp:TextBox runat="server" ID="txtInstitue" type="text" onblur="if(this.value=='' || this.value==null) this.value=''" onfocus="if(this.value==''){this.value='';}" placeholder="Institute*" size="35" /> </td> <td> <asp:TextBox runat="server" ID="txtYear" onblur="if(this.value=='' || this.value==null) this.value=''" onfocus="if(this.value==''){this.value='';}" Placeholder="Year*" size="12" /> </td> <td> <asp:TextBox runat="server" ID="txtSubjects" onblur="if(this.value=='' || this.value==null) this.value=''" onfocus="if(this.value==''){this.value='';}" placeholder="Subjects*" size="35" /> </td> </tr> <tr> <td> <asp:PlaceHolder ID="PlaceHolderEdu" runat="server"></asp:PlaceHolder> </td> <td> <asp:PlaceHolder ID="PlaceHolderEdu2" runat="server"></asp:PlaceHolder> </td> <td> <asp:PlaceHolder ID="PlaceHolderEdu3" runat="server"></asp:PlaceHolder> </td> <td> <asp:PlaceHolder ID="PlaceholderEdu4" runat="server"></asp:PlaceHolder> </td> </tr> </table> </ContentTemplate> <Triggers> <asp:AsyncPostBackTrigger ControlID="addmoreEdu" EventName="Click" /> </Triggers> </asp:UpdatePanel> <asp:LinkButton ID="addmoreEdu" runat="server" CssClass="linkbutton" onclick="addmoreEdu_Click" CausesValidation="False">Add More</asp:LinkButton> </div>stanly
Star
13201 Points
2490 Posts
Re: Update Panel Always Post Back whole Page
Feb 27, 2013 05:09 AM|LINK
Place Your LinkButton inside the update panel and try...
weblogs.asp.net/stanly
UsmanRana
Member
5 Points
34 Posts
Re: Update Panel Always Post Back whole Page
Feb 27, 2013 05:18 AM|LINK
HI i did place it inside update Panel but still same nothing changes full page Post Back..
Sankalpa
Contributor
2134 Points
494 Posts
Re: Update Panel Always Post Back whole Page
Feb 27, 2013 06:14 AM|LINK
Hi
Please check the below sample code its work fine...
<%@ Page Title="Home Page" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="TestApp._Default" %> <asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent"> </asp:Content> <asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent"> <asp:ScriptManager ID="smTest" runat="server"> </asp:ScriptManager> <asp:UpdatePanel runat="server" ID="upTest" UpdateMode="Conditional"> <ContentTemplate> <asp:TextBox ID="txtUpdatePanel" runat="server" /> <asp:Button ID="btnUpdatePanel" runat="server" Text="text" OnClick="btnUpdatePanel_Click" /> <asp:Label ID="lblUpdatePanel" runat="server"> </asp:Label> </ContentTemplate> <Triggers> <asp:AsyncPostBackTrigger ControlID="Button1" EventName="Click" /> </Triggers> </asp:UpdatePanel> <asp:TextBox ID="txtPage" runat="server" /> <asp:Button ID="btnPage" runat="server" Text="text" OnClick="btnPage_Click" /> <asp:Label ID="lblPage" runat="server"> </asp:Label> </asp:Content>and this is code behind
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; namespace TestApp { public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } protected void btnUpdatePanel_Click(object sender, EventArgs e) { lblUpdatePanel.Text = txtUpdatePanel.Text; lblPage.Text = txtPage.Text; } protected void btnPage_Click(object sender, EventArgs e) { lblPage.Text = txtPage.Text; lblUpdatePanel.Text = txtUpdatePanel.Text; } } }hope this help you to find the issue
UsmanRana
Member
5 Points
34 Posts
Re: Update Panel Always Post Back whole Page
Feb 27, 2013 06:51 AM|LINK
OK my code is similiar to this aswell,, then why mine is not working, i have followed all the rules for using update Panel...
Sankalpa
Contributor
2134 Points
494 Posts
Re: Update Panel Always Post Back whole Page
Feb 27, 2013 07:39 AM|LINK
Hi Usman,
I checked the code which you posted also but its work fine for me, what is your expected result?
prabu.raveen...
Contributor
5032 Points
956 Posts
Re: Update Panel Always Post Back whole Page
Feb 27, 2013 08:06 AM|LINK
Hi,
here you have placed you linkbutton outside updatepanel, when you click the button it will postback the page. Instead of putting outside try to move the linkbutton
Song-Tian - ...
All-Star
43715 Points
4304 Posts
Microsoft
Re: Update Panel Always Post Back whole Page
Feb 28, 2013 02:06 AM|LINK
Hi,
Please make sure set UpdateMode and triggers correctly.
More details, please refer to: http://msdn.microsoft.com/en-us/library/bb386454.aspx .
Feedback to us
Develop and promote your apps in Windows Store
chetan.sarod...
All-Star
66589 Points
11270 Posts
Re: Update Panel Always Post Back whole Page
Feb 28, 2013 02:31 AM|LINK
Refer this
http://stackoverflow.com/questions/4872210/full-postback-triggered-by-linkbutton-inside-gridview-inside-updatepanel
http://forums.asp.net/t/1290563.aspx/1
http://bloggingabout.net/blogs/rick/archive/2008/04/02/linkbutton-inside-updatepanel-results-in-full-postback-updatepanel-not-triggered.aspx
Senior Software Engineer,
Approva Systems Pvt Ltd, Pune, India.