![](/img/trans.png)
[英]How does the authentication apply to all aspx pages for a Web Application using C# in Visual Studio 2010?
[英]visual studio 2010 c# traverse between web pages on aspx.cs
作為在aspx.cs上的解決方案之后的標題狀態,我想切換到另一個網頁以刪除cookie並避免重新發送同一封電子郵件。
完成交易后,重定向到另一個頁面(顯示“成功完成”或其他消息)。 現在刷新無法擊敗您
若要重定向,可以使用Response.Redirect
方法
Response.Redirect("welcome.aspx")
您可以添加一個Session
,以防止再次發送電子郵件(如果這是每個會話一次的電子郵件(例如,電子報注冊等))。
然后在發送電子郵件之前檢查此Session
是否存在:
if (Session["emailsent"]==null){
//Send email code here
Session["emailsent"] = true;
}
您必須在page_load事件中進行測試
if(!IsPostBack)
{
//send mail...
}
else
{
//do nothing
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.