我已经将我的网站上传到网站主办,这个错误出现了;
' 在加密操作期间发生错误.'.
我做了一些研究,似乎将经过形式化的cookie绑定到MachineKey(使用webhost时有所不同).
我找到了一个方法来解决这个问题,但错误仍然存在.
码:
/// <summary>
/// This method removes a cookie if the machine key is different than the one that saved the cookie;
/// </summary>
protected void Application_Error(object sender, EventArgs e)
{
var error = Server.GetLastError();
var cryptoEx = error as CryptographicException;
if (cryptoEx != null)
{
FederatedAuthentication.WSFederationAuthenticationModule.SignOut();
Global.Cookies.FormAuthenticated Cookie = new Global.Cookies.FormAuthenticated();
Cookie.Delete();
Server.ClearError();
}
}
Run Code Online (Sandbox Code Playgroud)
堆栈跟踪:
[CryptographicException: Error occurred during a cryptographic operation.]
System.Web.Security.Cryptography.HomogenizingCryptoServiceWrapper.HomogenizeErrors(Func`2 func, Byte[] input) +115
System.Web.Security.Cryptography.HomogenizingCryptoServiceWrapper.Unprotect(Byte[] protectedData) +59
System.Web.Security.FormsAuthentication.Decrypt(String encryptedTicket) …Run Code Online (Sandbox Code Playgroud) 我想知道是否有任何方法来获取一个没有子元素作为字符串的html元素/节点.
这个问题可能看起来像这个问题的重复:jQuery,获取整个元素的html.
但我只希望html元素本身作为一个字符串,没有它的孩子.
texts.push({title:'[#target, outerHTML]', value: $input[0].outerHTML});
texts.push({title:'[#target, $.html()]', value: $input.html()});
texts.push({title:'[#bigger_Target, outerHTML]', value: $('#bigger_Target')[0].outerHTML});
texts.push({title:'[#bigger_Target, $.html()]', value: $('#bigger_Target').html()});
texts.push({title:'[#target, DESIRED]', value: '<input class="test" data-type="text only" type="button" value="Test />"'});
texts.push({title:'[#bigger_Target, DESIRED]', value: '<div id="bigger_Target" />'});
Run Code Online (Sandbox Code Playgroud)
FIDDLE:
http ://jsfiddle.net/ttoom9hc/12/
来自其他帖子的FIDDLE:http :
//jsfiddle.net/u6avkvz0/