Click here to Skip to main content
15,888,351 members
Please Sign up or sign in to vote.
5.00/5 (2 votes)
See more:
Dear Folks,

please help me..

Postback is not working in "Chrome" but in "Mozilla" it will working fine and i am included the actual code below

ASP.NET
<form id="form1"  runat="server">
  <div>
     <asp:ScriptManager ID="sc" runat="server">
     </asp:ScriptManager>
     <asp:UpdatePanel runat="server" ID="uPanel">
        <ContentTemplate>
           <asp:Panel runat="server" ID="pnlEtryForm">
              <table>
                 <tr>
                    <td>
                    </td>
                    <td>
                    </td>
                 </tr>
                 <tr>
                    <td colspan="2">
                       <asp:Button runat="server" ID="btn" Text="test" OnClick="btn_click" />
                    </td>
                 </tr>
              </table>
           </asp:Panel>
           <div id="pnlFormDonate"  runat="server" visible="false">
              <form id="frmDonate" action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post" >
              <input class="empty" type="hidden" id="bus" name="business" value="kanag._1336399919_per@gmail.com">
              <input type="hidden" name="cmd" value="_donations">
              <input type="hidden" name="item_name" value="Donation For IJP">
              <input type="hidden" id="itemNo" name="item_number" value="Donate for IJP Ministry">
              <input type="hidden" name="amount" id="amt">
              <input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif"
                 border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
              <img alt="" border="0" width="1" height="1" src="https://www.paypal.com/en_US/i/scr/pixel.gif">
              </form>
           </div>
        </ContentTemplate>
     </asp:UpdatePanel>
  </div>
  </form>


the above "apsx" file contains one button control and in the button click event handler i visible the "div" the code below shows.

C#
protected void btn_click(object sender, EventArgs e)
{
     pnlFormDonate.Visible = true;
}


after postback, when i click the paypal image link, the form has been post in "Mozilla" but in the "Chrome" browser there is no action has performed.

please help me how to do this....


Thanks & Regards
Kanagaraj.M
Posted

Hello dude use this code.

ASP.NET
<form id="form1"  runat="server">
   <div>
     <asp:scriptmanager id="sc" runat="server" xmlns:asp="#unknown">
      </asp:scriptmanager> 
      <asp:updatepanel runat="server" id="uPanel" xmlns:asp="#unknown">
         <contenttemplate> 
            <asp:panel runat="server" id="pnlEtryForm">
               <table>
                  <tr>
                     <td>
                     </td>
                     <td>
                     </td>
                  </tr>
                  <tr>
                     <td colspan="2">
                        <asp:button runat="server" id="btn" text="test" onclick="btn_click" />
                     </td>
                  </tr>
               </table>



            </asp:panel>


            <div id="pnlFormDonate"  runat="server" visible="false">
            
              <form>
             </form>
           <form id="frmDonate" action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post">
           
               <input class="empty" type="hidden" id="bus" name="business" value="kanag._1336399919_per@gmail.com" />
               <input type="hidden" name="cmd" value="_donations" />
               <input type="hidden" name="item_name" value="Donation For IJP" />
               <input type="hidden" id="itemNo" name="item_number" value="Donate for IJP Ministry" />
               <input type="hidden" name="amount" id="amt" />

               <input id="Image1"  runat="server" type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif">
                  border="0" onclick="Submitfrom()"  name="submit" alt="PayPal - The safer, easier way to pay online!" />
               <img alt="" border="0" width="1" height="1" src="https://www.paypal.com/en_US/i/scr/pixel.gif" />
               </input></form>

   
            </div>
          </contenttemplate>
      </asp:updatepanel> 

     
    
   </div>
   </form>
 
Share this answer
 
v2
Comments
kanagmathes 29-Jun-12 2:54am    
Thank u Sanwar,
It will working fine in chrome and mozilla but in the IE, its not working
any solution for this..
sanwar_mal_jat 29-Jun-12 3:16am    
Plz use this reviewed code

<form id="form1" runat="server">
<asp:ScriptManager ID="sc" runat="server">

<div>

<asp:UpdatePanel runat="server" ID="uPanel">
<contenttemplate>
<asp:Panel runat="server" ID="pnlEtryForm">
<table>
<tr>
<td>
</td>
<td>
</td>
</tr>
<tr>
<td colspan="2">
<asp:Button runat="server" ID="btn" Text="test" OnClick="btn_click" />
</td>
</tr>
</table>






<div id="pnlFormDonate" runat="server" visible="false">

<form >
</form>
<form id="frmDonate" action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post" >

<input class="empty" type="hidden" id="bus" name="business" value="kanag._1336399919_per@gmail.com" />
<input type="hidden" name="cmd" value="_donations" />
<input type="hidden" name="item_name" value="Donation For IJP" />
<input type="hidden" id="itemNo" name="item_number" value="Donate for IJP Ministry" />
<input type="hidden" name="amount" id="amt" />

<input id="Image1" runat="server" type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif"
border="0" önclick="Submitfrom()" name="submit" alt="PayPal - The safer, easier way to pay online!" />
<img alt="" border="0" width="1" height="1" src="https://www.paypal.com/en_US/i/scr/pixel.gif" />
</form>


</div>

<Triggers>
<asp:PostBackTrigger ControlID="btn" />
</Triggers>




</div>
</form>
Hi,
On click of image button you can call a javascript function. And in that javascript function you just use "__doPostBack". Refer the links below:

http://wiki.asp.net/page.aspx/1082/dopostback-function/[^]

This will work in all the browsers. So no compatibility issue.

--Amit
 
Share this answer
 
Try first to figure out, how fields are populated by different browsers. Use Fiddler for that.
What I see, that you have no exact action trigger. Chrome is for sure supporting ajax, that won't be the problem. But ASP.NET client support is not extensive enough. See this article: http://seejoelprogram.wordpress.com/2008/09/04/adding-google-chrome-to-aspnet-ajax/[^]
You can fine-tune the triggering mechanism, see this article: http://www.asp.net/web-forms/tutorials/aspnet-ajax/understanding-asp-net-ajax-updatepanel-triggers[^]
Of course, you can also not relay on built-in triggering and use Javascript as others suggested.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900