System.Web.UI.WebControls.GridView.OnPreRender C# (CSharp) Method

OnPreRender() protected method

protected OnPreRender ( EventArgs e ) : void
e EventArgs
return void
		protected internal override void OnPreRender (EventArgs e)
		{
			base.OnPreRender (e);

			if (EnableSortingAndPagingCallbacks) {
				if (!Page.ClientScript.IsClientScriptIncludeRegistered (typeof(GridView), "GridView.js")) {
					string url = Page.ClientScript.GetWebResourceUrl (typeof(GridView), "GridView.js");
					Page.ClientScript.RegisterClientScriptInclude (typeof(GridView), "GridView.js", url);
				}
				
				string cgrid = ClientID + "_data";
				string script = String.Format (onPreRenderScript,
							cgrid,
							ClientScriptManager.GetScriptLiteral (PageIndex),
							ClientScriptManager.GetScriptLiteral (SortExpression == null ? "" : SortExpression),
							ClientScriptManager.GetScriptLiteral ((int) SortDirection),
							ClientScriptManager.GetScriptLiteral (UniqueID),
							Page.theForm);
				
				Page.ClientScript.RegisterStartupScript (typeof(TreeView), this.UniqueID, script, true);
				
				// Make sure the basic script infrastructure is rendered
				Page.ClientScript.GetCallbackEventReference (this, "null", "", "null");
				Page.ClientScript.GetPostBackClientHyperlink (this, "");
			}
		}