<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.asp.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>ASP.NET AJAX Discussion and Suggestions</title><link>http://forums.asp.net/1007.aspx</link><description>This forum is the place for ASP.NET AJAX 'getting started' questions, general questions that don't fit in one of the other forums about AJAX </description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>Re: Ajax update panel &amp; Double postback.</title><link>http://forums.asp.net/thread/3235559.aspx</link><pubDate>Tue, 16 Jun 2009 01:53:06 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3235559</guid><dc:creator>singlewind</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3235559.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1007&amp;PostID=3235559</wfw:commentRss><description>&lt;p&gt;Yes. This is bug only happend in firefox, when you enable or disable buttons in UpdatePanel. &lt;/p&gt;&lt;p&gt;The golden rules is alaways disable button, or have some method handel the duplicate submit.&amp;nbsp; &lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Ajax update panel &amp; Double postback.</title><link>http://forums.asp.net/thread/2128393.aspx</link><pubDate>Wed, 23 Jan 2008 20:04:53 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2128393</guid><dc:creator>echo7x</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2128393.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1007&amp;PostID=2128393</wfw:commentRss><description>&lt;p&gt;I have had a similar problem with the UpdatePanel and double postbacks.&amp;nbsp; However these double postbacks occured in all browsers.&amp;nbsp; I was able to finally figure out the problem and it was caused by double wireing up of the controls to the code behind event.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;For example:&lt;/p&gt;
&lt;p&gt;At the top of the page i had:&lt;/p&gt;&lt;font size="2"&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#ff0000" size="2"&gt;AutoEventWireup&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;=&amp;quot;false&amp;quot;&lt;/p&gt;&lt;/font&gt;
&lt;p&gt;then my button:&lt;/p&gt;
&lt;p&gt;&lt;font color="#0000ff" size="2"&gt;&amp;lt;&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;asp&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;:&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;Button&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#ff0000" size="2"&gt;ID&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;=&amp;quot;btnSave&amp;quot;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#ff0000" size="2"&gt;runat&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;=&amp;quot;server&amp;quot;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#ff0000" size="2"&gt;Text&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;=&amp;quot;Save&amp;quot;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#ff0000" size="2"&gt;OnClick&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;=&amp;quot;btnSave_Click&amp;quot;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;/&amp;gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#000000"&gt;then the actual code behind&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#000000"&gt;&lt;font color="#0000ff" size="2"&gt;
&lt;p&gt;Protected&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;Sub&lt;/font&gt;&lt;font size="2"&gt; btnSave_Click(&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;ByVal&lt;/font&gt;&lt;font size="2"&gt; sender &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;As&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;Object&lt;/font&gt;&lt;font size="2"&gt;, &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;ByVal&lt;/font&gt;&lt;font size="2"&gt; e &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;As&lt;/font&gt;&lt;font size="2"&gt; System.EventArgs) &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;Handles&lt;/font&gt;&lt;font size="2"&gt; btnSave.Click&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;p&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#000000"&gt;The problem was that the button had an OnClick specified, and in the code behind it also had the Handles btnSave.click.&amp;nbsp;&amp;nbsp; By removing the Handles btnSave.click I was able to remove the extra postback.&amp;nbsp; You could also change the AutoEventWireup to True and then just remove the OnClick reference on the button.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#000000"&gt;I hope this help&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#000000"&gt;echo7&lt;/font&gt;&lt;/p&gt;&lt;/font&gt;</description></item><item><title>Re: Ajax update panel &amp; Double postback.</title><link>http://forums.asp.net/thread/2096947.aspx</link><pubDate>Tue, 08 Jan 2008 15:06:18 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2096947</guid><dc:creator>gt1329a</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2096947.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1007&amp;PostID=2096947</wfw:commentRss><description>&lt;p&gt;&lt;a href="http://encosia.com/2007/01/16/css-style-as-ajax-progress-indicator/"&gt;The example here&lt;/a&gt; includes disabling a button trigger for the duration of a partial postback and then re-enabling it at the end.&amp;nbsp; Might be of use to you, in replacing that code.&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Ajax update panel &amp; Double postback.</title><link>http://forums.asp.net/thread/2096212.aspx</link><pubDate>Tue, 08 Jan 2008 09:18:58 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2096212</guid><dc:creator>Mike55</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2096212.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1007&amp;PostID=2096212</wfw:commentRss><description>&lt;p&gt;I managed to locate the actual source of my problem; it was the following piece of vb.net/javascript code that caused the problem:&lt;/p&gt;&lt;pre class="coloredcode"&gt;&lt;span class="cmt"&gt;&amp;#39;Prevent the user from double clicking on the save button.
&lt;/span&gt;    &lt;span class="kwd"&gt;Private Sub&lt;/span&gt; PreventDoubleClick()
        &lt;span class="kwd"&gt;Dim&lt;/span&gt; sb &lt;span class="kwd"&gt;As&lt;/span&gt; System.Text.StringBuilder = &lt;span class="kwd"&gt;New&lt;/span&gt; System.Text.StringBuilder()
        sb.Append(&lt;span class="st"&gt;&amp;quot;if (typeof(Page_ClientValidate) == &lt;span class="cmt"&gt;&amp;#39;function&amp;#39;) { &amp;quot;)
&lt;/span&gt;        sb.Append(&amp;quot;&lt;/span&gt;if (Page_ClientValidate() == false) { return false; }} &lt;span class="st"&gt;&amp;quot;)
        sb.Append(&amp;quot;&lt;/span&gt;this.value = &lt;span class="cmt"&gt;&amp;#39;Please wait...&amp;#39;;&amp;quot;)
&lt;/span&gt;        sb.Append(&lt;span class="st"&gt;&amp;quot;this.disabled = true;&amp;quot;&lt;/span&gt;)
        sb.Append(Page.GetPostBackEventReference(btnSave))
        sb.Append(&lt;span class="st"&gt;&amp;quot;;&amp;quot;&lt;/span&gt;)
        btnSave.Attributes.Add(&lt;span class="st"&gt;&amp;quot;onclick&amp;quot;&lt;/span&gt;, sb.ToString())
    &lt;span class="kwd"&gt;End Sub&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;&amp;nbsp;Once this was removed all worked as per expected.&amp;nbsp; I had to find another way of working around the problem using the ajax UpdateProgress control.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Mike55.&lt;/p&gt;</description></item><item><title>Re: Ajax update panel &amp; Double postback.</title><link>http://forums.asp.net/thread/2094483.aspx</link><pubDate>Mon, 07 Jan 2008 15:51:12 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2094483</guid><dc:creator>gt1329a</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2094483.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1007&amp;PostID=2094483</wfw:commentRss><description>&lt;p&gt;Are you able to reproduce the problem in FireFox yourself?&amp;nbsp; ASP.NET AJAX definitely works fine cross browser.&amp;nbsp;&lt;/p&gt;</description></item><item><title>Ajax update panel &amp; Double postback.</title><link>http://forums.asp.net/thread/2094233.aspx</link><pubDate>Mon, 07 Jan 2008 13:53:32 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2094233</guid><dc:creator>Mike55</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2094233.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1007&amp;PostID=2094233</wfw:commentRss><description>&lt;p&gt;I am using the ajax control toolkit update panel for a site. I have noted that when users use my site with the Mozilla browser and click on one of the buttons in the update panel that a double postback occurs. I have been unable to trace the source of this problem and I have been unable to replicate it in IE 6.0. Has anyone come across this problem before? &lt;/p&gt;
&lt;p&gt;Mike55.&lt;/p&gt;</description></item></channel></rss>