gpt4 book ai didi

asp.net-mvc - 如何在 ASP.NET MVC 中进行成员资格?

转载 作者:行者123 更新时间:2023-12-01 02:59:46 27 4
gpt4 key购买 nike

我想成为 ASP.NET MVC 的成员(member)。我不是在谈论 ASP.NET MVC 附带的那个。项目。

我说的是一个数据库,我有自己的自定义表和 aspnet.db 表组合。

我知道如何在 WebForms 中执行此操作,并且我已将我的表与成员资格内容结合起来,但是当我尝试像在 WebForms 中那样将我的自定义角色提供程序添加到我的 web.config 时,没有任何效果。

有什么不同吗?

这太奇怪了。我将 SVN 中的几个版本返回到一个版本并添加了我的连接字符串并更改了一些内容,并且使用我的数据库可以正常工作。

当我将它上传到 Subversion 时,2 秒后从 Subversion 获取该副本并加载解决方案,它再次不起作用。

这是我得到的错误:

System.Web.HttpException was unhandled by user code
Message="Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that <machineKey> configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster."
Source="System.Web"
ErrorCode=-2147467259
StackTrace:
at System.Web.UI.ViewStateException.ThrowError(Exception inner, String persistedState, String errorPageMessage, Boolean macValidationError)
at System.Web.UI.ViewStateException.ThrowMacValidationError(Exception inner, String persistedState)
at System.Web.UI.ObjectStateFormatter.Deserialize(String inputString)
at System.Web.UI.ObjectStateFormatter.System.Web.UI.IStateFormatter.Deserialize(String serializedState)
at System.Web.UI.Util.DeserializeWithAssert(IStateFormatter formatter, String serializedState)
at System.Web.UI.HiddenFieldPageStatePersister.Load()
at System.Web.UI.Page.LoadPageStateFromPersistenceMedium()
at System.Web.UI.Page.LoadAllState()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest()
at System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context)
at System.Web.UI.Page.ProcessRequest(HttpContext context)
at System.Web.Mvc.ViewPage.RenderView(ViewContext viewContext)
at System.Web.Mvc.ViewUserControl.RenderViewAndRestoreContentType(ViewPage containerPage, ViewContext viewContext)
at System.Web.Mvc.ViewUserControl.RenderView(ViewContext viewContext)
at System.Web.Mvc.WebFormView.RenderViewUserControl(ViewContext context, ViewUserControl control)
at System.Web.Mvc.WebFormView.Render(ViewContext viewContext, TextWriter writer)
at System.Web.Mvc.HtmlHelper.RenderPartialInternal(String partialViewName, ViewDataDictionary viewData, Object model, ViewEngineCollection viewEngineCollection)
at System.Web.Mvc.Html.RenderPartialExtensions.RenderPartial(HtmlHelper htmlHelper, String partialViewName)
at ASP.views_registration_freeedition_aspx.__Renderform1(HtmlTextWriter __w, Control parameterContainer) in i:\StudentPlannerV2\trunk\Current Site\Views\Registration\FreeEdition.aspx:line 23
at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)
at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer)
at System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter writer)
at System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer)
at System.Web.UI.HtmlControls.HtmlForm.Render(HtmlTextWriter output)
at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter)
at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter)
at System.Web.UI.HtmlControls.HtmlForm.RenderControl(HtmlTextWriter writer)
at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)
at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer)
at System.Web.UI.Control.Render(HtmlTextWriter writer)
at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter)
at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter)
at System.Web.UI.Control.RenderControl(HtmlTextWriter writer)
at ASP.views_shared_site_master.__Render__control1(HtmlTextWriter __w, Control parameterContainer) in i:\StudentPlannerV2\trunk\Current Site\Views\Shared\Site.Master:line 53
at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)
at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer)
at System.Web.UI.Control.Render(HtmlTextWriter writer)
at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter)
at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter)
at System.Web.UI.Control.RenderControl(HtmlTextWriter writer)
at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)
at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer)
at System.Web.UI.Page.Render(HtmlTextWriter writer)
at System.Web.Mvc.ViewPage.Render(HtmlTextWriter writer)
at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter)
at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter)
at System.Web.UI.Control.RenderControl(HtmlTextWriter writer)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
InnerException: System.Web.UI.ViewStateException
Message="Invalid viewstate. \r\n\tClient IP: 127.0.0.1\r\n\tPort: \r\n\tUser-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 (.NET CLR 3.5.30729)\r\n\tViewState: /wEPDwUKLTE2OTc1MzQyNWRkiTBmkfYmU2SULSGTIy27NmZIwFs=\r\n\tReferer: http://localhost:3668/Registration/FreeEdition\r\n\tPath: /Registration/FreeEdition"
IsConnected=true
Path="/Registration/FreeEdition"
PersistedState="/wEPDwUKLTE2OTc1MzQyNWRkiTBmkfYmU2SULSGTIy27NmZIwFs="
Referer="http://localhost:3668/Registration/FreeEdition"
RemoteAddress="127.0.0.1"
RemotePort=""
UserAgent="Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 (.NET CLR 3.5.30729)"
InnerException: System.Web.HttpException
Message="Unable to validate data."
Source="System.Web"
ErrorCode=-2147467259
StackTrace:
at System.Web.Configuration.MachineKeySection.GetDecodedData(Byte[] buf, Byte[] modifier, Int32 start, Int32 length, Int32& dataLength)
at System.Web.UI.ObjectStateFormatter.Deserialize(String inputString)
InnerException:

最佳答案

关于asp.net-mvc - 如何在 ASP.NET MVC 中进行成员资格?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1250670/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com