I recently posed a question here in this forum that when I click on a button registered as asynch trigger for an update panel, the whole page refreshes instead of the update panel only. I have found no answer to my problem as yet.
Reading other posts here in this forum, it appears that a lot of people have the exact same problem. Many have even claimed that their code works on a computer (the development server usually) but not on another. The "UpdateMode=Conditional" is usually the
suggested remedy, but neither I, nor other posters, have found the cure to our problem trying that.
Is it possible that there IS a BUG in the update panel implementation that needs an update patch for VS or AJAX to make it work correctly?
I am working with Windows Vista, VS 2008, framework 3.5 and have no extra patches or downloads installed on my machine (concerning VS or AJAX). Is there some extra patch that I have to install on my machine? Do I have to install a .NET AJAX framework on
my development server or is this required only for the 2.0 framework?
OK, i tried it today but it still refreshes the whole page. Furthermore, it does not display the update progress text as it should.
I saw in some posts about installing a AJAX framework on the server. Should I do that? I tried following one of the examples given in the forum -don't remember exactly which, but I had to add overload the "onBeginRequest" function of Sys.Webpages.Extensions
and I got the "Sys" is undefined error when I tried to run the page on my browser.
Does this mean there is something missing in my installation?
I also tried to catch the "ScriptManager.IsInAsyncPostBack" event, in my page's OnLoad function and the code never got in there, so it does not recognize the click of the button as an async trigger but as a normal page event. To me this seems like a setting
in the server (or web.config) rather than coding issue. Right?
If in the page everything is right then please check if Browser showing you any javascript error, if yes then you need to update your web.config file, there are some handlers and modules that has to be in the web.config file.
If none of the things work for you then please provide the code snippet the i will able to assist you better
I also checked my browser settings as instructed below, but the page written in the code above by amit.jain still does full postabck instead of async, so I guess the browser wasn't the problem (I use IE 7.0). However, the main difference is that I put the
code amit.jain sent in an new page in an existing project (the one I'm having the problems with) and your code in a new empty project (which worked).
Would you say that the problem lies in the web.config after all?
At least I know now that I don't have a problem with the server installs and patches!
fpih
Member
4 Points
20 Posts
Update Panel Refreshing whole Page?
Dec 01, 2008 09:56 AM|LINK
I recently posed a question here in this forum that when I click on a button registered as asynch trigger for an update panel, the whole page refreshes instead of the update panel only. I have found no answer to my problem as yet.
Reading other posts here in this forum, it appears that a lot of people have the exact same problem. Many have even claimed that their code works on a computer (the development server usually) but not on another. The "UpdateMode=Conditional" is usually the suggested remedy, but neither I, nor other posters, have found the cure to our problem trying that.
Is it possible that there IS a BUG in the update panel implementation that needs an update patch for VS or AJAX to make it work correctly?
I am working with Windows Vista, VS 2008, framework 3.5 and have no extra patches or downloads installed on my machine (concerning VS or AJAX). Is there some extra patch that I have to install on my machine? Do I have to install a .NET AJAX framework on my development server or is this required only for the 2.0 framework?
amit.jain
Star
11225 Points
1815 Posts
Re: Update Panel Refreshing whole Page?
Dec 01, 2008 11:57 AM|LINK
Hi try this code , it's working fine for me on 3.5 , and should work for u too
<body>
<form id="form1" runat="server">
<div>
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<br />
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:Label ID="Label1" runat="server"></asp:Label>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="Button1" EventName="Click" />
</Triggers>
</asp:UpdatePanel>
<asp:UpdateProgress runat="server">
<ProgressTemplate>
Updating.............
</ProgressTemplate>
</asp:UpdateProgress>
<br />
<asp:Button ID="Button1" runat="server" Text="Click" Width="56px"
onclick="Button1_Click" />
<br />
<br />
<br />
</div>
</form>
</body>
protected void Button1_Click(object sender, EventArgs e)
{
System.Threading.Thread.Sleep(2000);
Label1.Text = "Ajax Update panel Demo";
}
Check the sample code attached
http://rapidshare.com/files/169158065/WebSite6.rar.html
amiT jaiN
ASP.NET C# VB Articles And Code Examples
fpih
Member
4 Points
20 Posts
Re: Update Panel Refreshing whole Page?
Dec 02, 2008 06:12 AM|LINK
OK, i tried it today but it still refreshes the whole page. Furthermore, it does not display the update progress text as it should.
I saw in some posts about installing a AJAX framework on the server. Should I do that? I tried following one of the examples given in the forum -don't remember exactly which, but I had to add overload the "onBeginRequest" function of Sys.Webpages.Extensions and I got the "Sys" is undefined error when I tried to run the page on my browser.
Does this mean there is something missing in my installation?
I also tried to catch the "ScriptManager.IsInAsyncPostBack" event, in my page's OnLoad function and the code never got in there, so it does not recognize the click of the button as an async trigger but as a normal page event. To me this seems like a setting in the server (or web.config) rather than coding issue. Right?
amit.jain
Star
11225 Points
1815 Posts
Re: Update Panel Refreshing whole Page?
Dec 02, 2008 07:59 AM|LINK
hi fpih
Download and install this service pack , it should ix ur problem , do let me know wheter it solved ur problem or not
http://www.microsoft.com/downloads/details.aspx?FamilyId=333325FD-AE52-4E35-B531-508D977D32A6&displaylang=en
amiT jaiN
ASP.NET C# VB Articles And Code Examples
fpih
Member
4 Points
20 Posts
Re: Update Panel Refreshing whole Page?
Dec 02, 2008 11:10 AM|LINK
I just installed it but still no success [:(]
I see no progress update either... and it's a very simple page, it should work...
stmarti
Contributor
4963 Points
1036 Posts
Re: Update Panel Refreshing whole Page?
Dec 02, 2008 01:45 PM|LINK
Simplify your problem:
- Cehck your browser settings. In firefox enable javascript, in ie6 enable javascript and activex, in ie7 enable javascript and xmhtlrequest object.
- Start vs 2008, create a new empty default web site and press F5 to test the following sample:
navpreet1982
Member
140 Points
35 Posts
Re: Update Panel Refreshing whole Page?
Dec 02, 2008 01:46 PM|LINK
If in the page everything is right then please check if Browser showing you any javascript error, if yes then you need to update your web.config file, there are some handlers and modules that has to be in the web.config file.
If none of the things work for you then please provide the code snippet the i will able to assist you better
Regards
Navpreet Singh
Technical Consultant
http://www.TalentCertification.com
amit.jain
Star
11225 Points
1815 Posts
Re: Update Panel Refreshing whole Page?
Dec 02, 2008 02:13 PM|LINK
Open Internet explorer
GO to tools > Internet options > Security tab
In the scripting section > enable all scriptiong and enable all java ralated things
amiT jaiN
ASP.NET C# VB Articles And Code Examples
fpih
Member
4 Points
20 Posts
Re: Update Panel Refreshing whole Page?
Dec 03, 2008 05:08 AM|LINK
Well,
I tried your example and it worked!
I also checked my browser settings as instructed below, but the page written in the code above by amit.jain still does full postabck instead of async, so I guess the browser wasn't the problem (I use IE 7.0). However, the main difference is that I put the code amit.jain sent in an new page in an existing project (the one I'm having the problems with) and your code in a new empty project (which worked).
Would you say that the problem lies in the web.config after all?
At least I know now that I don't have a problem with the server installs and patches!
amit.jain
Star
11225 Points
1815 Posts
Re: Update Panel Refreshing whole Page?
Dec 03, 2008 06:47 AM|LINK
Yes web.config file is different for AJAX enabled sites and for asp .net web sites
When we create site suing ajax we choose AJAX enabled site from the new web site dialog box
amiT jaiN
ASP.NET C# VB Articles And Code Examples