Use scripts to solve the ASP.NET page refresh problem

zhaozj2021-02-16  54

Title Script Solution ASP.NET Page Refresh Question Not (Original) Keyword ASP.NET JAVAScript page Refresh

The person developed by ASP.NET is very headache to the page of the server-side control event! NOT here puts out the solution when doing a project, takes you with everyone. NOT's idea is that the event is executed after the write segment script, let the page automatically scroll to the controls before the refresh page, reduce the inconvenience of the page refresh. For example, after pressing a button, the script will automatically scroll the page to this button. Write scripts NOT NOT uses a ScriptHelper class to get it, this class has a method of getViewControlScript (String ControlName), it returns a script of a client, the incoming parameter is the ID of this control. Scripthelper class code: ///

// provides some methods ////////// /// ////////////// /// /// script code public static string getViewControlScript (String ControlName) {// Create a client function Viewobj string script = "/ n"; script = "