Related to FORM Some Experience

xiaoxiao2021-03-05  26

1. Remove the Runat = Server in the Form to keep the status of the control

2. When the parameter passes, the control of Runat = Server can be named as a key, otherwise it can only be made with Name.

3. If you submit, there will be "The view status of this page is invalid," can be damaged. "The runtime error, the solution is as follows / ** ////

// This method is used to get the form of the form, if If this method returns a null value, the ispostback property will be set to false //. When the ispostback property is false, the ASP.NET does not load the logic of the view status, which will not be // / now "this page The status of the view state is invalid. "The runtime error is built /// protected override namevalueCollection determinePostBackMode () {// Here mainly checks if it is requested from other pages, // If it is from other pages Return to empty, not loaded, no view status if (request.urlReferRer == null) {return null;} string url = request.urlreferRER.TOString (); url = url.substring (url.lastindexof ("/") 1 ) .Tolower (); if (URL! = "Test2.aspx") {Return Null;} returnrate ();}

转载请注明原文地址:https://www.9cbs.com/read-36463.html

New Post(0)