Aprire la pagina Web in ASP.NET
2
Digitare il seguente codice nella parte superiore della pagina : . " Protetta override void Render ( System.Web . scrittore UI.HtmlTextWriter ) per
{
System.IO.StringWriter StringWriter = new System.IO.StringWriter ( ) ;
HtmlTextWriter HTMLWriter = new HtmlTextWriter ( StringWriter ) ;
base.Render ( HTMLWriter ) ;
stringa html = stringWriter.ToString ();
int StartPoint = html.IndexOf ( " < input type = \\ " nascosto \\ "name = \\ " __VIEWSTATE \\ "");
se ( StartPoint > = 0 ) per
{
int EndPoint = html.IndexOf ( " /> " , StartPoint ) + 2;
stringa
viewstateInput = html.Substring ( StartPoint , EndPoint - StartPoint ) ;
html = html.Remove ( StartPoint , EndPoint - StartPoint ) ;
int FormEndStart = html.IndexOf ( " < /form > " ) - 1 ;
se ( FormEndStart > = 0 ) per
{
html = html . Inserisci ( FormEndStart , viewstateInput ) ;
}
}
writer.Write ( html ) ; .
} "
3
Salva la pagina premendo il tasto "Command " e " S " sulla tastiera .
Programmazione © www.354353.com