viewstate

how to scrape a page request using Viewstate parameter?

送分小仙女□ 提交于 2019-12-12 16:18:29
问题 I've been trying to scrape this website : http://www.e3050.com/Cases-Fans-PDU/C I can scrape anything normally but moving to the next page, after debugging I found that they send the __Viewstate parameter for each page request. The viewstate parameter is stored in each page response, so I figured out that I need to get it per page and send it to the following page. I get the __viewstate using this xpath : sel.xpath('//input[@id="__VIEWSTATE"]/@value').extract() I also got an error, because

How do I retain entered values in a form in ASP.NET MVC when the user has failed server validation?

为君一笑 提交于 2019-12-12 15:27:25
问题 I have an ASP.NET MVC application that is meant to be user friendly and out of the box MVC does not offer ViewState. My problem is that if the user fails server validation then I don't want them to have to enter all the values again. How do I solve this problem in ASP.NET MVC? 回答1: But to be honest if the user fails server validation then I dont want them to have to enter all the values again. I dont really understand what the MVC solution is to this useability problem? The pattern is pretty

asp.net Invalid character in a Base-64 string

纵然是瞬间 提交于 2019-12-12 13:42:08
问题 I have a c# mobile site and have a problem with some of mobile clients. I have posted a trace below but basically browser of phone or wap gateway that phone connects to internet url encodes viewstate hidden input in the form. /wEPDwULLTExNTMyOTcwOTBkGAEFBlBtTGlzdA9nZA== becomes %2FwEPDwULLTExNTMyOTcwOTBkGAEFBlBtTGlzdA9nZA%3D%3D so viewstate fails. Is there anyway to override and urldecode viewstate info before proccessing? System.Web.HttpException: The state information is invalid for this

ASP.NET Best way to retain label.text value between postback with PageMethods

﹥>﹥吖頭↗ 提交于 2019-12-12 11:49:33
问题 ASP.NET 2.0, PageMethods. Good day, I'm using ASP.NET AJAX PageMethods to dynamically change the text of a Label when a dropdownlist is changed on my page. I know that the text of Labels are not retained between postbacks when they are changed on client-side, which is my case. I've heard that a solution is to keep the label content in a hidden field, then to set Label text from that field in Page_Load. However, this solution does not seem really clean to me. Are there any other alternatives

Viewstate in a .ashx Handler?

萝らか妹 提交于 2019-12-12 11:37:25
问题 I've got a handler (list.ashx for example) that has a method that retrieves a large dataset, then grabs only the records that will be shown on any given "page" of data. We are allowing the users to do sorting on these results. So, on any given page run, I will be retrieving a dataset that I just got a few seconds/minutes ago, but reordering them, or showing the next page of data, etc. My point is that my dataset really hasn't changed. Normally, the dataset would be stuck into the viewstate of

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

那年仲夏 提交于 2019-12-12 08:53:18
问题 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? 回答1: 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

Viewstate and controls in ASP.NET

…衆ロ難τιáo~ 提交于 2019-12-12 07:35:29
问题 I posted a question a couple of days ago about viewstate and after running some tests I have come to some conclusions/results. Based on these results I have a few questions as to how someone would do certain things. Here are the results of my tests that I ran: If usercontrolA is loaded from OnInit of a Page, then his viewstate will be available in OnLoad . All other controls that usercontrolA loads from it's OnInit , will have their viewstate ready in their OnLoad . If usercontrolA is loaded

JSF ManagedBean - injected properties not working correctly on STATE_SAVING_METHOD=client

我怕爱的太早我们不能终老 提交于 2019-12-12 06:39:49
问题 I am into a problem from two days and I can not get out from this. The problem I am having is using a MangedBean property after the deserialization (I guess). The property (purchaseManager) is set up with Spring, and use a DAO which extends MyBatis as data mapper to interact with the DB. In fact, on the first access to the page, purchaseManager.getAll() inside init() method works fine. When i try to call refreshList() as an action from a button, I have a NullPointerException on the

Changing name of viewstate

风格不统一 提交于 2019-12-12 03:22:18
问题 I have two ASP.NET form living in the same page. I some problems because the hidden fields below get the same name and id. Is there some way I can change these for one of the forms? (They are also not optimal for validation). I need the services the viewstate provides, but perhaps I could disable it on form level, and use it at a lower (control) level? 回答1: It's not what you want to hear, but in ASP.Net you should only have one runat="server" form per page. Otherwise this is just the first of

Can big ViewState content result a HTTP Error 504 - Gateway timeout?

℡╲_俬逩灬. 提交于 2019-12-12 01:35:12
问题 I have one asp.net page which seems to return a very big content (5,648,733 bytes and that is mostly consumed by VIEWSTATE) ending with a 504 Gateway timeout error. I am tracking the http request/response by using Fiddler. And basically, when I post-back the same page -by clicking a button- the post-back fails with thoose errors shown in IE and in FF: Internet Explorer cannot display the webpage --> in IE The connection to the server was reset while the page was loading. --> in FF Question :