回传在Chrome中不起作用 [英] Postback not working in Chrome

查看:99
本文介绍了回传在Chrome中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的人们,

请帮帮我..

回发在"Chrome"中不起作用,但在"Mozilla"中则可以正常工作,我在下面包含了实际代码

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

<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>



上面的"apsx"文件包含一个按钮控件,在按钮单击事件处理程序中,我看到以下代码所示的"div".



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

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



回发后,当我单击贝宝图像链接时,该表单已发布在"Mozilla"中,但是在"Chrome"浏览器中,没有执行任何操作.

请帮我怎么做....


谢谢&问候
Kanagaraj.M



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

推荐答案

您好兄弟,请使用此代码.

Hello dude use this code.

<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>



在单击图像按钮时,您可以调用javascript函数.在该javascript函数中,您只需使用"__doPostBack"即可.请参考以下链接:

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

这将适用于所有浏览器.因此没有兼容性问题.

--Amit
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


首先尝试弄清楚不同浏览器如何填充字段.为此使用Fiddler.
我看到的是,您没有确切的动作触发器. Chrome浏览器肯定支持ajax,但这不是问题.但是ASP.NET客户端支持不够广泛.看到这篇文章: http://seejoelprogram.wordpress.com/2008 /09/04/adding-google-chrome-to-aspnet-ajax/ [ http://www.asp.net/web-forms/tutorials/aspnet-ajax/understanding-asp-net-ajax-updatepanel-triggers [
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.


这篇关于回传在Chrome中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆