-
-
© <%: DateTime.Now.Year %> - My ASP.NET Application
-
+
+
+
© <%: DateTime.Now.Year %> - My ASP.NET Application
+
-
+
diff --git a/CMS_SC/Site.Master.cs b/CMS_SC/Site.Master.cs
index 6672c59..a33b519 100644
--- a/CMS_SC/Site.Master.cs
+++ b/CMS_SC/Site.Master.cs
@@ -5,66 +5,66 @@ using System.Web.UI;
namespace CMS_SC
{
- public partial class SiteMaster : MasterPage
+ public partial class SiteMaster : MasterPage
+ {
+ private const string AntiXsrfTokenKey = "__AntiXsrfToken";
+ private const string AntiXsrfUserNameKey = "__AntiXsrfUserName";
+ private string _antiXsrfTokenValue;
+
+ protected void Page_Init(object sender, EventArgs e)
{
- private const string AntiXsrfTokenKey = "__AntiXsrfToken";
- private const string AntiXsrfUserNameKey = "__AntiXsrfUserName";
- private string _antiXsrfTokenValue;
+ // The code below helps to protect against XSRF attacks
+ var requestCookie = Request.Cookies[AntiXsrfTokenKey];
+ Guid requestCookieGuidValue;
+ if (requestCookie != null && Guid.TryParse(requestCookie.Value, out requestCookieGuidValue))
+ {
+ // Use the Anti-XSRF token from the cookie
+ _antiXsrfTokenValue = requestCookie.Value;
+ Page.ViewStateUserKey = _antiXsrfTokenValue;
+ }
+ else
+ {
+ // Generate a new Anti-XSRF token and save to the cookie
+ _antiXsrfTokenValue = Guid.NewGuid().ToString("N");
+ Page.ViewStateUserKey = _antiXsrfTokenValue;
- protected void Page_Init(object sender, EventArgs e)
+ var responseCookie = new HttpCookie(AntiXsrfTokenKey)
{
- // The code below helps to protect against XSRF attacks
- var requestCookie = Request.Cookies[AntiXsrfTokenKey];
- Guid requestCookieGuidValue;
- if (requestCookie != null && Guid.TryParse(requestCookie.Value, out requestCookieGuidValue))
- {
- // Use the Anti-XSRF token from the cookie
- _antiXsrfTokenValue = requestCookie.Value;
- Page.ViewStateUserKey = _antiXsrfTokenValue;
- }
- else
- {
- // Generate a new Anti-XSRF token and save to the cookie
- _antiXsrfTokenValue = Guid.NewGuid().ToString("N");
- Page.ViewStateUserKey = _antiXsrfTokenValue;
-
- var responseCookie = new HttpCookie(AntiXsrfTokenKey)
- {
- HttpOnly = true,
- Value = _antiXsrfTokenValue
- };
- if (FormsAuthentication.RequireSSL && Request.IsSecureConnection)
- {
- responseCookie.Secure = true;
- }
- Response.Cookies.Set(responseCookie);
- }
-
- Page.PreLoad += master_Page_PreLoad;
- }
-
- protected void master_Page_PreLoad(object sender, EventArgs e)
+ HttpOnly = true,
+ Value = _antiXsrfTokenValue
+ };
+ if (FormsAuthentication.RequireSSL && Request.IsSecureConnection)
{
- if (!IsPostBack)
- {
- // Set Anti-XSRF token
- ViewState[AntiXsrfTokenKey] = Page.ViewStateUserKey;
- ViewState[AntiXsrfUserNameKey] = Context.User.Identity.Name ?? String.Empty;
- }
- else
- {
- // Validate the Anti-XSRF token
- if ((string)ViewState[AntiXsrfTokenKey] != _antiXsrfTokenValue
- || (string)ViewState[AntiXsrfUserNameKey] != (Context.User.Identity.Name ?? String.Empty))
- {
- throw new InvalidOperationException("Validation of Anti-XSRF token failed.");
- }
- }
+ responseCookie.Secure = true;
}
+ Response.Cookies.Set(responseCookie);
+ }
- protected void Page_Load(object sender, EventArgs e)
- {
-
- }
+ Page.PreLoad += master_Page_PreLoad;
}
+
+ protected void master_Page_PreLoad(object sender, EventArgs e)
+ {
+ if (!IsPostBack)
+ {
+ // Set Anti-XSRF token
+ ViewState[AntiXsrfTokenKey] = Page.ViewStateUserKey;
+ ViewState[AntiXsrfUserNameKey] = Context.User.Identity.Name ?? String.Empty;
+ }
+ else
+ {
+ // Validate the Anti-XSRF token
+ if ((string)ViewState[AntiXsrfTokenKey] != _antiXsrfTokenValue
+ || (string)ViewState[AntiXsrfUserNameKey] != (Context.User.Identity.Name ?? String.Empty))
+ {
+ throw new InvalidOperationException("Validation of Anti-XSRF token failed.");
+ }
+ }
+ }
+
+ protected void Page_Load(object sender, EventArgs e)
+ {
+
+ }
+ }
}
\ No newline at end of file
diff --git a/CMS_SC/Site.Master.designer.cs b/CMS_SC/Site.Master.designer.cs
index 6f2f920..2669138 100644
--- a/CMS_SC/Site.Master.designer.cs
+++ b/CMS_SC/Site.Master.designer.cs
@@ -1,43 +1,41 @@
//------------------------------------------------------------------------------
-//
-// This code was generated by a tool.
+//
+// Codice generato da uno strumento.
//
-// Changes to this file may cause incorrect behavior and will be lost if
-// the code is regenerated.
-//
+// Le modifiche a questo file possono causare un comportamento non corretto e verranno perse se
+// il codice viene rigenerato.
+//
//------------------------------------------------------------------------------
-namespace CMS_SC
-{
-
-
- public partial class SiteMaster
- {
-
+namespace CMS_SC {
+
+
+ public partial class SiteMaster {
+
///
- /// HeadContent control.
+ /// Controllo HeadContent.
///
///
- /// Auto-generated field.
- /// To modify move field declaration from designer file to code-behind file.
+ /// Campo generato automaticamente.
+ /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
///
protected global::System.Web.UI.WebControls.ContentPlaceHolder HeadContent;
-
+
///
- /// FeaturedContent control.
+ /// Controllo FeaturedContent.
///
///
- /// Auto-generated field.
- /// To modify move field declaration from designer file to code-behind file.
+ /// Campo generato automaticamente.
+ /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
///
protected global::System.Web.UI.WebControls.ContentPlaceHolder FeaturedContent;
-
+
///
- /// MainContent control.
+ /// Controllo MainContent.
///
///
- /// Auto-generated field.
- /// To modify move field declaration from designer file to code-behind file.
+ /// Campo generato automaticamente.
+ /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
///
protected global::System.Web.UI.WebControls.ContentPlaceHolder MainContent;
}
diff --git a/CMS_SC/Test.aspx b/CMS_SC/Test.aspx
index ab7d262..30bca98 100644
--- a/CMS_SC/Test.aspx
+++ b/CMS_SC/Test.aspx
@@ -1,4 +1,4 @@
-<%@ Page Title="" Language="C#" MasterPageFile="~/BootstrapNoUpdPnl.Master" AutoEventWireup="true" CodeBehind="Test.aspx.cs" Inherits="CMS_SC.Test" %>
+<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Test.aspx.cs" Inherits="CMS_SC.Test" %>
<%@ Register Src="~/WebUserControls/mod_fileUpload.ascx" TagPrefix="uc1" TagName="mod_fileUpload" %>
diff --git a/CMS_SC/Test.aspx.cs b/CMS_SC/Test.aspx.cs
index 5d203d8..7d1a91b 100644
--- a/CMS_SC/Test.aspx.cs
+++ b/CMS_SC/Test.aspx.cs
@@ -2,11 +2,11 @@
namespace CMS_SC
{
- public partial class Test : System.Web.UI.Page
+ public partial class Test : System.Web.UI.Page
+ {
+ protected void Page_Load(object sender, EventArgs e)
{
- protected void Page_Load(object sender, EventArgs e)
- {
- }
}
+ }
}
\ No newline at end of file
diff --git a/CMS_SC/Web.CMS.config b/CMS_SC/Web.CMS.config
index 51a6ade..41c90bf 100644
--- a/CMS_SC/Web.CMS.config
+++ b/CMS_SC/Web.CMS.config
@@ -30,10 +30,12 @@
+
+
diff --git a/CMS_SC/Web.config b/CMS_SC/Web.config
index f822f32..48c682e 100644
--- a/CMS_SC/Web.config
+++ b/CMS_SC/Web.config
@@ -23,9 +23,10 @@
-
+
+
@@ -34,7 +35,7 @@
-
+
@@ -104,12 +105,14 @@
+
+
+
@@ -34,7 +35,7 @@
-
+
@@ -104,12 +105,14 @@
+
+