在ASP .NET中设置默认表单 [英] Set Default form in ASP .NET
问题描述
亲爱的人们,
我的ASP .NET网站有两种形式.当我单击按钮时,它将通过使用更新面板发布回服务器,在发布如何设置默认表单后.以下是代码
Dear Folks,
I have two form in my asp .net site. when i click the button it will post back to server by using update panel, after post back how to set default form. below is the code
<div>
<asp:ScriptManager ID="sc" runat="server" EnablePartialRendering="true" LoadScriptsBeforeUI="false" ScriptMode="Release" >
</asp:ScriptManager>
<asp:UpdatePanel runat="server" ID="uPanel" UpdateMode="Conditional">
<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" id="don"
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>
上面的代码,当我单击按钮测试时,它将回发到服务器,并且在后面的代码中,我隐藏了按钮测试,并且显示了pnlFormDonate div,在回发后,我单击了paylpal捐赠图像,它不会重定向到paypal页面.
注意:
它在firefox中工作正常,但在IE和Chrome中不起作用...
请告诉我任何一个人..
谢谢&问候,
Kanagaraj.M
the above code when i click the button test, it will postback to server and in the code behind i hides the button test and i shows the pnlFormDonate div, after post back i click the paylpal donate image it does not redirect to the paypal page.
note :
it works fine in the firefox but it does not work in IE and Chrome...
pls tell me any one..
Thanks & Regards,
Kanagaraj.M
推荐答案
kanagmathes,
您的问题无法消除您的疑问,
如果要在不更改URL的情况下将页面从form1重定向到form2,请使用server.transfer.
Hi kanagmathes,
your question not clearing the your doubt,
if you want to redirect your page from form1 to form2 without url change then use server.transfer.
使用Response.redirect.
这是...
http://www.w3schools.com/asp/met_redirect.asp [ http://www.dotnetperls.com/redirect [ http://haacked.com/archive/2004/10/06/responseredirectverseservertransfer.aspx [ ^ ]
何时使用Response.Redirect& Asp.net中的Server.Transfer [ http://www.csharpfriends.com/articles/getarticle.aspx?articleid=15 [ ^ ]
问候
塞巴斯蒂安
Use Response.redirect.
Here is how...
http://www.w3schools.com/asp/met_redirect.asp[^]
http://www.dotnetperls.com/redirect[^]
http://haacked.com/archive/2004/10/06/responseredirectverseservertransfer.aspx[^]
When will use Response.Redirect & Server.Transfer in Asp.net[^]
http://www.csharpfriends.com/articles/getarticle.aspx?articleid=15[^]
Regards
Sebastian
这篇关于在ASP .NET中设置默认表单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!