viewstate

asp.net viewstate encryption

a 夏天 提交于 2019-12-04 02:16:51
I have a few questions about when and how viewstate is encrypted in asp.net 3.5. For instance, if I have a machinekey entry in my web.config like: decryptionKey="AutoGenerate,IsolateApps" validation="AES" decryption="Auto" /> Is viewstate encrypted at this point? Or do I need to specify the viewStateEncryptionMode in the page section also? Also, is it possible to encrypt a formsauthentication cookie, but not encrypt viewstate at the same time? Thanks for any help. The controls on the page can request that encryption be used for the ViewState, but even this request can be overridden by the page

Is ViewState relevant in ASP.NET MVC?

若如初见. 提交于 2019-12-03 23:33:13
I am learning ASP.NET MVC and many concepts of "ASP.NET" like authentication, authorization, session state still apply to it. But from whatever little I have understood, I don't see that ViewState is still relevant in an ASP.NET application. But it is there (property of System.Web.Mvc.ViewPage)! Is it there only for compatibility reasons or it still have some purpose/use? Dzmitry Huba Yes, that is correct. ViewState is not relevant. More on differencies between Page Model and MVC here: Compatibility of ASP.NET Web Forms and ASP.NET MVC Its present because ViewPage inherits from Page. However

In ASP.Net, I sometimes get the following error - Viewstate verification failed. Reason: The viewstate supplied failed integrity check

独自空忆成欢 提交于 2019-12-03 20:07:28
问题 Background: I developed a web app in ASP.Net 3.5 in C#. It runs great but now a few users have reported that they recieve an error sometimes. I have tried to duplicate the error but it has been hard. One time though when I let the app sit I came back later and tried to move it along and it errored out. I would think that has something to do with the timeout but I am using the view state. Any ideas? When I look at the eventLog I do see the following error entry. Thank You for your help and

How to minimize viewstate size of a page in asp.net?

狂风中的少年 提交于 2019-12-03 18:48:50
问题 How to minimize viewstate size of a page in asp.net? Please help. 回答1: You have several options to reduce the ViewState: Disable ViewState for controls that do not need it (this is the most effective solution). E.g. if you can cache some data on the server, then you can re-bind any databound controls with every request and it's not needed to save everything in ViewState. Turn on HTTP compression on the server (IIS) . This reduces the size of the page sent to the client, including the

Why does DropDownList.SelectedValue is relied on viewstate?

霸气de小男生 提交于 2019-12-03 17:44:06
问题 If I set on my page : EnableViewState="true" ViewStateMode="Disabled" - Then - the Viewstate is disable for the page ( unless override... ) Then, trying to read from ( assuming the control has been populated in the last dump to the screen and a value is selected ): MyDDL.SelectedValue will yield "" That's because of disabled viewstate : But my question is at a higher level : If it's all about a form value (which I still can get from Request.Form[MyDDL.UniqueID] ) - and we're talking about an

Viewstate of ascx lost between postbacks

半世苍凉 提交于 2019-12-03 15:31:58
In my ASP.NET application, I am loading an .ascx dynamically using LoadControl, using the following pattern: var ctrl = LoadControl("/path/to/control.ascx"); ((ControlType)ctrl).SomeProperty = someData; placeholder.Controls.Add(ctrl); The control that I add saves the SomeProperty property value directly to ViewState, as follows: public int? SomeProperty { get { return (int?)ViewState["SomeProperty"]; } set { ViewState["SomeProperty"] = value; } } After that, the ascx control lives a life on its own and all is well until postback occurs. When the page posts back, suddenly the view state is

DropDownList OnSelectedIndexChange to 0th index w/out ViewState

余生颓废 提交于 2019-12-03 15:08:36
I did follow the article TRULLY Understanding ViewState (great article btw) and populating my drop down list is working great. I've even setup a OnSelectedIndexChange event which fires almost as great. The problem I've found is the SelectedIndexChanged event won't fire when selecting the 0th index. It does all other times however. Here's some code: <asp:DropDownList runat="server" ID="DropDownList1" EnableViewState="false" AutoPostBack="True" OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged" /> protected override void OnInit(EventArgs e) { this.DropDownList1.DataTextField = "Text";

Advice for Building a dynamic “Advanced Search” Control in ASP.NET

烂漫一生 提交于 2019-12-03 14:33:10
alt text http://img3.imageshack.us/img3/1488/advancedsearch.png I'm building an "Advanced Search" interface in an ASP.NET application. I don't need SO to write this thing for me, but I'm stuck on a specific problem regarding dynamic controls and ViewState. I would like some direction for how to approach this. Here's my situation: Ingredients: A serviceable set of API objects representing entities, fields, and searches, which handles constructing a search, generating SQL, and returning the results. So that's all taken care of. ASP.NET 3.5 Desired Interface Functionality: (1) On initial page

Invalid Viewstate, Invalid length for a Base-64 char array or string

不羁的心 提交于 2019-12-03 14:15:22
I face this error from time to time, ExecuteStep at line:0 at Column:0 The state information is invalid for this page and might be corrupted. (*)Invalid viewstate Inner exception: unhandled exception in Application_Error At Load at line:0 at Column:0 Invalid length for a Base-64 char array or string debugging is enabled, and the pdb file exists, and as you see the debug info does not exactly tell me where it happened. I'm using ASP.NET, C#, DotNet 4.5 this only occurs on a specific page's load. [FormatException: Invalid length for a Base-64 char array or string.] System.Convert.FromBase64

ASP.NET 2.0 RijndaelManaged encryption algorithm vs. FIPS

╄→гoц情女王★ 提交于 2019-12-03 14:01:30
I'm running into an issue with an ASP.NET 2.0 application. Our network folks just upped our security, and now I get the floowing error whenever I try to access the app: "This implementation is not part of the Windows Platform FIPS validated cryptographic algorithms." I've done a little research, and it sounds like ASP.NET uses the RijndaelManaged AES encryption algorithm to encrypt the ViewState of pages... and RijndaelManaged is on the list of algorithms that aren't FIPS compliant. We're certainly not explicitly calling any encryption algorithm... much less anything on the non-compliant list.