viewstate

Erratic Invalid Viewstate issue in a .NET application

我只是一个虾纸丫 提交于 2019-11-26 18:46:13
问题 I seem to be getting a "invalid viewstate" every now and then in the event viewer for my ASP.NET application. Most of them (95%) seem to be referencing ScriptResource.axd (the application uses the ASP.NET AJAX library). There is no way I can remove the Ajax library either as Ajax is used everywhere.. How can I reduce these errors? I'm getting ~ 100-200 errors a day and I have no idea how to fix them! They come from different browsers, different IPs and geographical locations. It's difficult

What is the difference between SessionState and ViewState?

南笙酒味 提交于 2019-11-26 18:12:05
What is the difference between SessionState and ViewState in ASP.NET? Session State contains information that is pertaining to a specific session (by a particular client/browser/machine) with the server. It's a way to track what the user is doing on the site.. across multiple pages ...amid the statelessness of the Web. e.g. the contents of a particular user's shopping cart is session data. Cookies can be used for session state. View State on the other hand is information specific to particular web page. It is stored in a hidden field so that it isn't visible to the user. It is used to maintain

Asp.net Validation of viewstate MAC failed

◇◆丶佛笑我妖孽 提交于 2019-11-26 15:59:00
问题 I am receiving the following error at certain times on asp.net website. Sys.WebForms.PageRequestManagerServerErrorException: 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. When page refresh goes,no problem.How can I solve this problem? 回答1: If you're using a web farm and running the same application on multiple

Advantages of Cache vs Session

核能气质少年 提交于 2019-11-26 14:27:52
What is the difference between storing a datatable in Session vs Cache? What are the advantages and disadvantages? So, if it is a simple search page which returns result in a datatable and binds it to a gridview. If user 'a' searches and user 'b' searches, is it better to store it in Session since each user would most likely have different results or can I still store each of their searches in Cache or does that not make sense since there is only one cache. I guess basically what I am trying to say is that would the Cache be overwritten. One important difference is, that items in the cache can

Invalid length for a Base-64 char array

假如想象 提交于 2019-11-26 14:20:23
As the title says, I am getting: Invalid length for a Base-64 char array. I have read about this problem on here and it seems that the suggestion is to store ViewState in SQL if it is large. I am using a wizard with a good deal of data collection so chances are my ViewState is large. But, before I turn to the "store-in-DB" solution, maybe somebody can take a look and tell me if I have other options? I construct the email for delivery using the below method: public void SendEmailAddressVerificationEmail(string userName, string to) { string msg = "Please click on the link below or paste it into

com.sun.faces.numberOfViewsInSession vs com.sun.faces.numberOfLogicalViews

僤鯓⒐⒋嵵緔 提交于 2019-11-26 12:57:39
Mojarra Implementation of JSF 2 has the following context params: com.sun.faces.numberOfViewsInSession (default is 15) com.sun.faces.numberOfLogicalViews (default is 15) What is the difference between them? The documentation doesn't speak much about these. My app was having trouble with ViewExpiredException for some pages, but after we bumped these settings to a (much) higher value, we stopped having problems. My app is a financial, form-heavy, ajax-enabled app (some screens have 50+ inputs, with the option of adding alot more data/inputs via AJAX). what can be the cause for this behaviour? I

How to decode viewstate

自古美人都是妖i 提交于 2019-11-26 08:03:58
问题 I need to see the contents of the viewstate of an asp.net page. I looked for a viewstate decoder, found Fridz Onion\'s ViewState Decoder but it asks for the url of a page to get its viewstate. Since my viewstate is formed after a postback and comes as a result of an operation in an update panel, I cannot provide a url. I need to copy & paste the viewstate string and see what\'s inside. Is there a tool or a website exist that can help viewing the contents of viewstate? 回答1: Use Fiddler and

What causing this “Invalid length for a Base-64 char array”

最后都变了- 提交于 2019-11-26 07:57:31
问题 I have very little to go on here. I can\'t reproduce this locally, but when users get the error I get an automatic email exception notification: Invalid length for a Base-64 char array. at System.Convert.FromBase64String(String s) 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

Rendering other form by ajax causes its view state to be lost, how do I add this back?

依然范特西╮ 提交于 2019-11-26 06:37:29
问题 I have <h:form> <h:commandLink action=\"#{my_fake_ajax_link}\"> <h:outputText value=\"Link\" /> <f:ajax render=\":mydiv\" /> </h:commandLink> </h:form> <h:panelGroup layout=\"block\" id=\"mydiv\"> <h:form> <h:commandLink action=\"#{mybean.delete(0)}\"> <h:outputText value=\"Here\" /> <f:ajax render=\"@form\" /> </h:commandLink> </h:form> </h:panelGroup> When I click once on \"my_fake_ajax_link\", then I have to click twice on \"delete\" link. This is only an example. I don\'t have this real

What is the difference between SessionState and ViewState?

删除回忆录丶 提交于 2019-11-26 06:14:29
问题 What is the difference between SessionState and ViewState in ASP.NET? 回答1: Session State contains information that is pertaining to a specific session (by a particular client/browser/machine) with the server. It's a way to track what the user is doing on the site.. across multiple pages ...amid the statelessness of the Web. e.g. the contents of a particular user's shopping cart is session data. Cookies can be used for session state. View State on the other hand is information specific to