Viewstate 损坏问题
我在一些页面中遇到错误:
错误消息:Base-64 字符串中的字符无效。 错误来源:mscorlib 错误目标站点:Byte[] FromBase64String(System.String)
错误消息:无法验证数据。 错误来源:System.Web 错误目标站点:Byte[] GetDecodedData(Byte[], Byte[], Int32, Int32, Int32 ByRef)
错误消息:无效视图状态。 错误来源:System.Web 错误目标站点:System.String DecryptStringWithIV(System.String, System.Web.Configuration.IVType)
以下是一些上下文。如果您看到任何东西,请告诉我。我认为这部分是由我的 asp 向导控件引起的。
查询字符串数据:
发布数据:
ctl00$smgr:ctl00$MasterContentPlaceHolder$upl_Products|ctl00$MasterContentPlaceHolder$btn_Search __事件目标:
__事件参数:
__最后焦点:
__VIEWSTATFieldCOUNT: 3
__EVENTVALIDATION: /wEWHwKV2/WwBQLGna/KAwK9x8a3BQKLhdbNCwLZ64aKDQKi8pQnAp/jp/4IApCM8ZMEApGM8ZMEApOMzZMEApSMzZMEAtbfoPUBAqPxgKMBAorGwpkKAseB0Z0KAqPxgK MBAt2Y6o8JAsDpmsoPAtKTqbABApnQzLoPAuPO3+EGAVQT7RUDAtyZ3acDAtf0wrEBAvKivZ0MAsGNqIUKAoyZyqoNAsbz9MYPAuDHqosLAs6pn9gKAr+Ru4sC6wYbrhtxXxHDOrBfBS6eE0Gfq9I= ctl00$hdf_DisplayModal:
ctl00$UcHeader1$ucCreateAssociation$Wizard1$txt_AssociationName:
ctl00$UcHeader1$ucCreateAssociation$Wizard1$txt_Doors:
ctl00$UcHeader1$ucCreateAssociation$Wizard1$txt_Lockbox:
ctrl前缀:ctl00_MasterContentPlaceHolder_ ctl00$MasterContentPlaceHolder$txt_Search:CASA RIVIERA ctl00$MasterContentPlaceHolder$wmk_Search_ClientState:
ctl00$MasterContentPlaceHolder$ddl_PageSize:25 ctl00$MasterContentPlaceHolder$txt_sdi:
ctl00$MasterContentPlaceHolder$hdf_ClonedProduct:
ctl00$MasterContentPlaceHolder$hdf_ClonedProductDocumentID:
ctl00$MasterContentPlaceHolder$btn_Search:搜索
用户:0893
异常堆栈跟踪:
位于 System.Web.UI.ViewStateException.ThrowError(异常内部,字符串 persistedState,字符串 errorPageMessage,布尔 macValidationError) 在 System.Web.UI.ViewStateException.ThrowMacValidationError(异常内部,字符串 persistedState) 在 System.Web.UI.ObjectStateFormatter.Deserialize(字符串 inputString) 在 System.Web.UI.ObjectStateFormatter.System.Web.UI.IStateFormatter.Deserialize(字符串序列化状态) 在 System.Web.UI.Util.DeserializeWithAssert(IStateFormatter 格式化程序,字符串序列化状态) 在 System.Web.UI.HiddenFieldPageStatePersister.Load() 在 System.Web.UI.Page.LoadPageStateFromPersistenceMedium() 在 System.Web.UI.Page.LoadAllState() 在 System.Web.UI.Page.ProcessRequestMain(布尔 includeStagesBeforeAsyncPoint,布尔 includeStagesAfterAsyncPoint) 在 System.Web.UI.Page.ProcessRequest(布尔 includeStagesBeforeAsyncPoint,布尔 includeStagesAfterAsyncPoint) 在 System.Web.UI.Page.ProcessRequest() 在 System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext 上下文) 在 System.Web.UI.Page.ProcessRequest(HttpContext 上下文) 在 c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\sdi\80f8adc6\386762ef\App_Web_xehehb6p.0.cs 中的 ASP.pif_default_aspx.ProcessRequest(HttpContext context):第 0 行 在 System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() 在 System.Web.HttpApplication.ExecuteStep(IExecutionStep 步骤,Boolean&completedSynchronously)
服务器变量:
ALL_HTTP:HTTP_CACHE_CONTROL:无缓存 HTTP_CONNECTION:保持活动状态 HTTP_PRAGMA:无缓存 HTTP_CONTENT_LENGTH:34935 HTTP_CONTENT_TYPE:应用程序/x-www-form-urlencoded HTTP_ACCEPT:/ HTTP_ACCEPT_LANGUAGE:en-us HTTP_COOKIE:简介=无;证明=无; __utma=171421859.194166732.1176217884.1257437483.1257444560.528; __utmz=171421859.1257444560.528.335.utmcsr=southdata.com|utmccn=(转介)|utmcmd=转介|utmcct=/; .ASPXFORMSAUTH=BDF808EC8A45BADFBB4DB5AD85A8ADE465F4A3B2DB6BE338C17A1F9D77075A418FD178A5FD1F9C54DBE5442A8BEA229C938AC5026C0759B2C45DE0E1E930A7B3; __utmc=171421859; __utmb=171421859.76.10.1257444560; __utma=146810421.923635986.1176217867.1257437442.1257444513.419; __utmz=146810421.1257437442.418.1.utmcsr=(直接)|utmccn=(直接)|utmcmd=(无); ASP.NET_SessionId=zem03d55niqwuavria2n2x2p; __utmc=146810421 HTTP_HOST:republic.southdata.com HTTP_REFERER:https://republic.southdata.com/SDI /PIF/ HTTP_USER_AGENT:Mozilla/4.0(兼容;MSIE 7.0;Windows NT 5.1;.NET CLR 1.1.4322;.NET CLR 2.0.50727;MS-RTC LM 8;InfoPath.2;.NET CLR 1.0.3705) HTTP_X_MICROSOFTAJAX:Delta=真的 HTTP_UA_CPU:x86
ALL_RAW:缓存控制:无缓存 连接:保持活动状态 编译指示:无缓存 内容长度:34935 内容类型:application/x-www-form-urlencoded 接受:/ 接受语言:en-us Cookie:简介=无;证明=无; __utma=171421859.194166732.1176217884.1257437483.1257444560.528; __utmz=171421859.1257444560.528.335.utmcsr=southdata.com|utmccn=(转介)|utmcmd=转介|utmcct=/; .ASPXFORMSAUTH=BDF808EC8A45BADFBB4DB5AD85A8ADE465F4A3B2DB6BE338C17A1F9D77075A418FD178A5FD1F9C54DBE5442A8BEA229C938AC5026C0759B2C45DE0E1E930A7B3; __utmc=171421859; __utmb=171421859.76.10.1257444560; __utma=146810421.923635986.1176217867.1257437442.1257444513.419; __utmz=146810421.1257437442.418.1.utmcsr=(直接)|utmccn=(直接)|utmcmd=(无); ASP.NET_SessionId=zem03d55niqwuavria2n2x2p; __utmc=146810421 主办方:republic.southdata.com 推荐人:https://republic.southdata.com/SDI/PIF/ 用户代理:Mozilla/4.0(兼容;MSIE 7.0;Windows NT 5.1;.NET CLR 1.1.4322;.NET CLR 2.0.50727;MS-RTC LM 8;InfoPath.2;.NET CLR 1.0.3705) x-microsoftajax: Delta=true UA-CPU:x86
APPL_MD_PATH:/LM/W3SVC/1/Root/SDI APPL_PHYSICAL_PATH: D:\Inetpub\wwwroot\sdi\ AUTH_TYPE:表单 授权用户:0893 AUTH_PASSWORD:
登录用户:
远程用户:0893 CERT_COOKIE:
CERT_FLAGS:
CERT_ISSUER:
CERT_KEYSIZE:128 CERT_SECRETKEYSIZE:4096 CERT_SERIALNUMBER:
CERT_SERVER_ISSUER:C=US、O=Network Solutions LLC、CN=Network Solutions 证书颁发机构 CERT_SERVER_SUBJECT:C=US、邮政编码=27030、S=NC、L=芒特艾里、STREET=201 Technology Lane、O=SouthData、OU=IT、OU=安全链接 SSL 通配符、CN=.southdata.com CERT_SUBJECT:
内容长度:34935 CONTENT_TYPE:应用程序/x-www-form-urlencoded 网关接口:CGI/1.1 HTTPS:开启 HTTPS_KEYSIZE:128 HTTPS_SECRETKEYSIZE:4096 HTTPS_SERVER_ISSUER:C=US、O=Network Solutions LLC、CN=Network Solutions 证书颁发机构 HTTPS_SERVER_SUBJECT:C=US、PostalCode=27030、S=NC、L=Mount Airy、STREET=201 Technology Lane、O=SouthData、OU=IT、OU=安全链接 SSL 通配符、CN=.southdata.com 实例 ID:1 INSTANCE_META_PATH:/LM/W3SVC/1 本地地址:10.1.16.6 路径信息:/SDI/PIF/Default.aspx 路径翻译:D:\Inetpub\wwwroot\sdi\PIF\Default.aspx QUERY_STRING:
远程地址:204.9.125.194 远程主机:204.9.125.194 远程端口:59539 请求方法:发布 SCRIPT_NAME:/SDI/PIF/Default.aspx SERVER_NAME:republic.southdata.com 服务器端口:443 服务器端口安全:1 服务器协议:HTTP/1.0 服务器软件:微软-IIS/6.0 网址:/SDI/PIF/Default.aspx HTTP_CACHE_CONTROL:无缓存 HTTP_CONNECTION:保持活动状态 HTTP_PRAGMA:无缓存 HTTP_CONTENT_LENGTH:34935 HTTP_CONTENT_TYPE:应用程序/x-www-form-urlencoded HTTP_ACCEPT:/ HTTP_ACCEPT_LANGUAGE:en-us HTTP_COOKIE:简介=无;证明=无; __utma=171421859.194166732.1176217884.1257437483.1257444560.528; __utmz=171421859.1257444560.528.335.utmcsr=southdata.com|utmccn=(转介)|utmcmd=转介|utmcct=/; .ASPXFORMSAUTH=BDF808EC8A45BADFBB4DB5AD85A8ADE465F4A3B2DB6BE338C17A1F9D77075A418FD178A5FD1F9C54DBE5442A8BEA229C938AC5026C0759B2C45DE0E1E930A7B3; __utmc=171421859; __utmb=171421859.76.10.1257444560; __utma=146810421.923635986.1176217867.1257437442.1257444513.419; __utmz=146810421.1257437442.418.1.utmcsr=(直接)|utmccn=(直接)|utmcmd=(无); ASP.NET_SessionId=zem03d55niqwuavria2n2x2p; __utmc=146810421 HTTP_HOST:republic.southdata.com HTTP_REFERER:https://republic.southdata.com/SDI/PIF/ HTTP_USER_AGENT:Mozilla/4.0(兼容;MSIE 7.0;Windows NT 5.1;.NET CLR 1.1.4322;.NET CLR 2.0.50727;MS-RTC LM 8;InfoPath.2;.NET CLR 1.0.3705) HTTP_X_MICROSOFTAJAX:Delta = true
I'm getting errors in a few of my pages:
Error Message: Invalid character in a Base-64 string.
Error Source: mscorlib
Error Target Site: Byte[] FromBase64String(System.String)
Error Message: Unable to validate data.
Error Source: System.Web
Error Target Site: Byte[] GetDecodedData(Byte[], Byte[], Int32, Int32, Int32 ByRef)
Error Message: Invalid viewstate.
Error Source: System.Web
Error Target Site: System.String DecryptStringWithIV(System.String, System.Web.Configuration.IVType)
Here is some context. Please let me know if you are seeing anything. I think this is being caused in part by my asp wizard control.
QueryString Data:
Post Data:
ctl00$smgr: ctl00$MasterContentPlaceHolder$upl_Products|ctl00$MasterContentPlaceHolder$btn_Search
__EVENTTARGET:
__EVENTARGUMENT:
__LASTFOCUS:
__VIEWSTATEFIELDCOUNT: 3
__EVENTVALIDATION: /wEWHwKV2/WwBQLGna/KAwK9x8a3BQKLhdbNCwLZ64aKDQKi8pQnAp/jp/4IApCM8ZMEApGM8ZMEApOMzZMEApSMzZMEAtbfoPUBAqPxgKMBAorGwpkKAseB0Z0KAqPxgKMBAt2Y6o8JAsDpmsoPAtKTqbABApnQzLoPAuPO3+EGAvqt7rUDAtyZ3acDAtf0wrEBAvKivZ0MAsGNqIUKAoyZyqoNAsbz9MYPAuDHqosLAs6pn9gKAr+Ru4sC6wYbrhtxXxHDOrBfBS6eE0Gfq9I=
ctl00$hdf_DisplayModal:
ctl00$UcHeader1$ucCreateAssociation$Wizard1$txt_AssociationName:
ctl00$UcHeader1$ucCreateAssociation$Wizard1$txt_Doors:
ctl00$UcHeader1$ucCreateAssociation$Wizard1$txt_Lockbox:
ctrlPrefix: ctl00_MasterContentPlaceHolder_
ctl00$MasterContentPlaceHolder$txt_Search: CASA RIVIERA
ctl00$MasterContentPlaceHolder$wmk_Search_ClientState:
ctl00$MasterContentPlaceHolder$ddl_PageSize: 25
ctl00$MasterContentPlaceHolder$txt_sdi:
ctl00$MasterContentPlaceHolder$hdf_ClonedProduct:
ctl00$MasterContentPlaceHolder$hdf_ClonedProductDocumentID:
ctl00$MasterContentPlaceHolder$btn_Search: Search
User: 0893
Exception Stack Trace:
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 ASP.pif_default_aspx.ProcessRequest(HttpContext context) in c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\sdi\80f8adc6\386762ef\App_Web_xehehb6p.0.cs:line 0
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
Server Variables:
ALL_HTTP: HTTP_CACHE_CONTROL:no-cache
HTTP_CONNECTION:Keep-Alive
HTTP_PRAGMA:no-cache
HTTP_CONTENT_LENGTH:34935
HTTP_CONTENT_TYPE:application/x-www-form-urlencoded
HTTP_ACCEPT:/
HTTP_ACCEPT_LANGUAGE:en-us
HTTP_COOKIE:intro=none; proofs=none; __utma=171421859.194166732.1176217884.1257437483.1257444560.528; __utmz=171421859.1257444560.528.335.utmcsr=southdata.com|utmccn=(referral)|utmcmd=referral|utmcct=/; .ASPXFORMSAUTH=BDF808EC8A45BADFBB4DB5AD85A8ADE465F4A3B2DB6BE338C17A1F9D77075A418FD178A5FD1F9C54DBE5442A8BEA229C938AC5026C0759B2C45DE0E1E930A7B3; __utmc=171421859; __utmb=171421859.76.10.1257444560; __utma=146810421.923635986.1176217867.1257437442.1257444513.419; __utmz=146810421.1257437442.418.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); ASP.NET_SessionId=zem03d55niqwuavria2n2x2p; __utmc=146810421 HTTP_HOST:republic.southdata.com HTTP_REFERER:https://republic.southdata.com/SDI/PIF/
HTTP_USER_AGENT:Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; MS-RTC LM 8; InfoPath.2; .NET CLR 1.0.3705) HTTP_X_MICROSOFTAJAX:Delta=true
HTTP_UA_CPU:x86
ALL_RAW: Cache-Control: no-cache
Connection: Keep-Alive
Pragma: no-cache
Content-Length: 34935
Content-Type: application/x-www-form-urlencoded
Accept: /
Accept-Language: en-us
Cookie: intro=none; proofs=none; __utma=171421859.194166732.1176217884.1257437483.1257444560.528; __utmz=171421859.1257444560.528.335.utmcsr=southdata.com|utmccn=(referral)|utmcmd=referral|utmcct=/; .ASPXFORMSAUTH=BDF808EC8A45BADFBB4DB5AD85A8ADE465F4A3B2DB6BE338C17A1F9D77075A418FD178A5FD1F9C54DBE5442A8BEA229C938AC5026C0759B2C45DE0E1E930A7B3; __utmc=171421859; __utmb=171421859.76.10.1257444560; __utma=146810421.923635986.1176217867.1257437442.1257444513.419; __utmz=146810421.1257437442.418.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); ASP.NET_SessionId=zem03d55niqwuavria2n2x2p; __utmc=146810421
Host: republic.southdata.com
Referer: https://republic.southdata.com/SDI/PIF/
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; MS-RTC LM 8; InfoPath.2; .NET CLR 1.0.3705)
x-microsoftajax: Delta=true
UA-CPU: x86
APPL_MD_PATH: /LM/W3SVC/1/Root/SDI
APPL_PHYSICAL_PATH: D:\Inetpub\wwwroot\sdi\
AUTH_TYPE: Forms
AUTH_USER: 0893
AUTH_PASSWORD:
LOGON_USER:
REMOTE_USER: 0893
CERT_COOKIE:
CERT_FLAGS:
CERT_ISSUER:
CERT_KEYSIZE: 128
CERT_SECRETKEYSIZE: 4096
CERT_SERIALNUMBER:
CERT_SERVER_ISSUER: C=US, O=Network Solutions L.L.C., CN=Network Solutions Certificate Authority
CERT_SERVER_SUBJECT: C=US, PostalCode=27030, S=NC, L=Mount Airy, STREET=201 Technology Lane, O=SouthData, OU=IT, OU=Secure Link SSL Wildcard, CN=.southdata.com
CERT_SUBJECT:
CONTENT_LENGTH: 34935
CONTENT_TYPE: application/x-www-form-urlencoded
GATEWAY_INTERFACE: CGI/1.1
HTTPS: on
HTTPS_KEYSIZE: 128
HTTPS_SECRETKEYSIZE: 4096
HTTPS_SERVER_ISSUER: C=US, O=Network Solutions L.L.C., CN=Network Solutions Certificate Authority
HTTPS_SERVER_SUBJECT: C=US, PostalCode=27030, S=NC, L=Mount Airy, STREET=201 Technology Lane, O=SouthData, OU=IT, OU=Secure Link SSL Wildcard, CN=.southdata.com
INSTANCE_ID: 1
INSTANCE_META_PATH: /LM/W3SVC/1
LOCAL_ADDR: 10.1.16.6
PATH_INFO: /SDI/PIF/Default.aspx
PATH_TRANSLATED: D:\Inetpub\wwwroot\sdi\PIF\Default.aspx
QUERY_STRING:
REMOTE_ADDR: 204.9.125.194
REMOTE_HOST: 204.9.125.194
REMOTE_PORT: 59539
REQUEST_METHOD: POST
SCRIPT_NAME: /SDI/PIF/Default.aspx
SERVER_NAME: republic.southdata.com
SERVER_PORT: 443
SERVER_PORT_SECURE: 1
SERVER_PROTOCOL: HTTP/1.0
SERVER_SOFTWARE: Microsoft-IIS/6.0
URL: /SDI/PIF/Default.aspx
HTTP_CACHE_CONTROL: no-cache
HTTP_CONNECTION: Keep-Alive
HTTP_PRAGMA: no-cache
HTTP_CONTENT_LENGTH: 34935
HTTP_CONTENT_TYPE: application/x-www-form-urlencoded
HTTP_ACCEPT: /
HTTP_ACCEPT_LANGUAGE: en-us
HTTP_COOKIE: intro=none; proofs=none; __utma=171421859.194166732.1176217884.1257437483.1257444560.528; __utmz=171421859.1257444560.528.335.utmcsr=southdata.com|utmccn=(referral)|utmcmd=referral|utmcct=/; .ASPXFORMSAUTH=BDF808EC8A45BADFBB4DB5AD85A8ADE465F4A3B2DB6BE338C17A1F9D77075A418FD178A5FD1F9C54DBE5442A8BEA229C938AC5026C0759B2C45DE0E1E930A7B3; __utmc=171421859; __utmb=171421859.76.10.1257444560; __utma=146810421.923635986.1176217867.1257437442.1257444513.419; __utmz=146810421.1257437442.418.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); ASP.NET_SessionId=zem03d55niqwuavria2n2x2p; __utmc=146810421
HTTP_HOST: republic.southdata.com
HTTP_REFERER: https://republic.southdata.com/SDI/PIF/
HTTP_USER_AGENT: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; MS-RTC LM 8; InfoPath.2; .NET CLR 1.0.3705)
HTTP_X_MICROSOFTAJAX: Delta=true
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Microsoft 不久前发布了一篇有关视图状态损坏的文章,该文章派上了用场:
http://support.microsoft。 com/kb/555353
我们在负载平衡的 Web 服务器上运行时遇到过这种情况,在这种情况下,使用 machine.config 文件中的通用密钥就可以解决问题。不确定这是否是您遇到的问题,但是 MS 的文章很有帮助。
Microsoft posted an article on viewstate corruption a while back that has come in handy:
http://support.microsoft.com/kb/555353
We've run into this when running on load-balanced web servers in which case using a common key in the machine.config files did the trick. Not sure if this is the issue you are having, but the article from MS was a big help.