viewstate

Saving Viewstate on Server

帅比萌擦擦* 提交于 2020-01-03 05:42:05
问题 What is the best way to save view state on server? Is it a good idea to use a WCF service to save the view state on the server? 回答1: Are we talking about ASP.NET view state? Why do you need WCF to store view state on the server? ASP.NET provides its own methods to store view state on the server: You can override SavePageStateToPersistenceMedium and LoadPageStateFromPersistenceMedium on your Page . You can override PageStatePersister property of your Page (or in custom PageAdapter ). This

Is there any other way to store the data source other than view state?

℡╲_俬逩灬. 提交于 2020-01-02 09:58:41
问题 I have a page on which data table is created programmatically if the data is not there in the database tables. I have to use this data table in many events during postbacks. The data table may contain hundreds of records and there may be multiple users accessing the same page(Of course with different data source for each user). I am storing the data table in view state but I am afraid that this practice will make the page heavier. Is there any other way to preserve the data table across

ASP.NET Error:The state information is invalid for this page and might be corrupted

我的梦境 提交于 2020-01-02 04:59:05
问题 I have no JQuery or other javascript changing values or html-structure. And I have no controls that is added dynamically. Still I get the error: The state information is invalid for this page and might be corrupted The error occurs somewhat random. Here is how I can replicate the issue, aspx-file: <%@ Page ViewStateEncryptionMode ="Never" MaxPageStateFieldLength="40" ValidateRequest="false" Language="C#" AutoEventWireup="true" EnableEventValidation="false" CodeFile="tbTest.aspx.cs" Inherits="

Which types of objects can we place in view state?

跟風遠走 提交于 2020-01-02 04:13:25
问题 I want to know why we must set the serializable attribute to save an object in view state. Also, which type of objects can we store in view state? 回答1: ViewState is serialized using binary serialization using ObjectStateFormatter. Quote from the documentation: The ObjectStateFormatter class is optimized to serialize and format many common .NET Framework reference types, as well as constants. The following table lists the types that are optimized. Array, DateTime, Int16, String, ArrayList,

ASP.NET custom control: when is LoadPostData() called?

与世无争的帅哥 提交于 2020-01-02 03:12:23
问题 I have developed a custom control that extends ListBox. The idea is that the control 'remembers' modifications to its elements which occurred client-side, e.g. as a result of an AJAX request. The way it works is that the control also renders a hidden input, and the result of the AJAX request is stored in the hidden input. This is posted back, and the control's LoadPostData() method looks for the hidden input, and if the hidden input has data, creates the ListItem collection from it. This

ASP.net ViewState - Even when disabled, some viewstate exist. Why?

隐身守侯 提交于 2019-12-30 03:19:29
问题 Even when on the page, the EnableViewState property is disabled, I am still seeing some viewstate existing on the page: "<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="VkBAB3n5LZYtY+nTzk1vEu1P/6QLf4qzFIKzpFRJe3DMf8UseUA/1RsO409HJX4QhkROSP0umoJvatjK/q+jXA==" />" My question is why? 回答1: This could be controls that are using ControlState. Any control that has control state will ignore your ViewState settings. 回答2: It's the control state. If you really want to get rid of

Determine size of ASP.NET page's viewstate before serving page

。_饼干妹妹 提交于 2019-12-29 08:44:33
问题 What ASP.NET page lifecycle event can I write code in to determine the size of the viewstate that being sent out? Also, is it possible to determine the size without parsing through the rendered HTML (like a property on the page object) or is parsing the only way? What I'd like to do is log the sizes, specifically if they cross a certain threshold. 回答1: You can go on the function that is going to writing the viewstate, the SavePageStateToPersistenceMedium . This is the function that also used

What is the equivalent of viewstate in ASP.net MVC [closed]

↘锁芯ラ 提交于 2019-12-28 12:07:51
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 5 years ago . In asp.net pages, during postback, ViewState makes the data persistent. What makes the data persistent in ASP.net MVC? 回答1: In Asp.Net we have Runat="Server" to make controls like Textbox,Checkbox... into asp.net controls which they run at server and they can maintain viewstate

What does the __VIEWSTATE hold?

怎甘沉沦 提交于 2019-12-28 06:29:10
问题 I'm sorry for maybe making such a basic question but in ASP.NET websites what does the __VIEWSTATE input field represent? Also, is there any way to compute it's value (based on the values of other form fields)? EDIT I understand that __VIEWSTATE, as the name suggests, maintains the values of form field values in webpages however what I'm interested in knowing is how this state (the string) is generated. If I base64_decode any __VIEWSTATE string all I see is a bunch of cryptic HTML. Is there

Using Postbacks with a CDN

佐手、 提交于 2019-12-25 05:36:16
问题 We have a Sitecore/Webforms based website that we'd like to run behind Akamai CDN however we're having an issue with ViewState MAC validation on our postbacks. We've worked around this for most of the core forms on the site (by taking them out of the CDN cache and serving them direct for every user), but we're left with a simple form in the footer of every page that posts back to the server. Currently we're seeing errors: Validation of viewstate MAC failed. I believe this is caused by the CDN