viewstate

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

ε祈祈猫儿з 提交于 2019-12-04 23:52:40
问题 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

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

微笑、不失礼 提交于 2019-12-04 22:34:55
问题 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

Viewstate Optimisations

老子叫甜甜 提交于 2019-12-04 22:13:00
Hy, I'm interested in some general optimisation methods in an asp.net ajax project for Viewstate (ex. to reduce the size of viewstate , or just speeding up the viewstate somehow, or others this should be a general discussion :-) ). So what kind of optimisation do you use for ViewState? What possibilities are offered on Asp.net or Ajax framework? @silky is right, disable it where ever you can. We try to keep it disabled on as many controls as possible. Also, once you're using as little as possible, it might be worth looking at putting something like this in you pages (or better a base page

DropDownList OnSelectedIndexChange to 0th index w/out ViewState

≡放荡痞女 提交于 2019-12-04 22:06:31
问题 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

Firefox overrides javax.faces.ViewState with old value on F5, how to turn off autocomplete

一世执手 提交于 2019-12-04 18:12:06
I am using JSF 2.1 on Tomcat 7 and opening it in Firefox 23.0.0.1. The page generates a javax.faces.ViewState hidden input field as expected: <input type="hidden" value="2442695108697186454:-4079620282104128276" id="javax.faces.ViewState" name="javax.faces.ViewState"> When hitting F5, the server sends a new id for javax.faces.ViewState , which is correct. However, Firefox keeps the old value in the hidden input. The result is that the old view-scoped bean is taken on ajax requests. Only when I force a hard refresh by Strg/Ctrl+F5, then Firefox takes the new value from server. I think it's a

asp.net viewstate encryption issue

南楼画角 提交于 2019-12-04 16:54:27
问题 I am attempting to turn on viewstate encryption Always as a security measure for my ASP.NET 3.5 website hosted in IIS6. We have viewstate turned off but still see some "controlstate" in this string. In a test environment I am able to simply set the following in web.config and i can no longer base64 decode the viewstate to semi-plaintext: <pages enableViewState="false" enableViewStateMac="true" viewStateEncryptionMode="Always"> I have even added the following (genereated by machine key

Invalid viewstate for ScriptResource.axd?

倾然丶 夕夏残阳落幕 提交于 2019-12-04 09:19:24
问题 The Script Resource and the Web Resource files are generating intermittent errors in my application. I have been trying to chase the cause of the problem but to no avail. I notice that the “d” parameter that is passed is some how corrupted and I can’t for the life of me figure out what’s causing this parameter to be corrupted. I noticed that JavaScript code that in my application is some how getting intertwined with the hash code that’s generated for the “d” parameter. Exception genereated on

System.Web.UI.ViewStateException ,Invalid viewstate

一笑奈何 提交于 2019-12-04 08:42:25
My website is throwing the below exceptions everyday and i couldn't find the solution. i did few research in web and this is what i do so far. adding below option to aspx won't solve the problem. ValidateRequest="false" EnableEventValidation="false" ViewStateEncryptionMode="Never" EnableViewStateMac="false" Also, my Referral Url is the correct URL and i have no idea how it redirect with two (same) parameters. there is no such link in my referral page. Please help. ERROR LOG URL : http://www.abcd.com/company-details.aspx?com=asia-pacific-pte-ltd&com=asia-pacific-pte-ltd referral URL : http:/

How to persist List<T> property in ASP.NET Custom Control?

懵懂的女人 提交于 2019-12-04 06:37:25
I have the following property in a custom control: List<myClass> _items; public List<myClass> Items{ get { return _items; } set { _items= value; } } In my codebehind, I add items to the collection as in... myCustomControl.items.Add(new myClass()); However, these are not persisted across postbacks. What is the proper way to allow persistance in custom controls? Yikes! Don't put a List<> into the ViewState! It'll be massive! If you add a List<string> that contains two elements - "abc" and "xyz" into the ViewState, it'll grow by 312 bytes. If instead you add a string[] that contains the same two

LoadViewState not fired on my user control

泄露秘密 提交于 2019-12-04 04:27:34
问题 I have a user control nested in a repeater. Inside my user control I have another repeater and in that I have a panel. I am trying to override the LoadViewState event of my user control and dynamically add controls to the panel. I want to do it in the LoadViewState so that the dynamic controls get added before the viewstate gets loaded, so they retain their values after post backs. For some reason the LoadViewState event on the user control (ascx) is not firing. Is there some way to force it