<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>
Untitled Page
File: Default.aspx.vb
Imports System.IO
Partial Class _Default
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
ViewState("Example") = "rntsoft"
End Sub
Protected Overrides Sub Render(ByVal writer As System.Web.UI.HtmlTextWriter)
Dim stringWriter As System.IO.StringWriter = New System.IO.StringWriter
Dim htmlWriter As HtmlTextWriter = New HtmlTextWriter(stringWriter)
MyBase.Render(htmlWriter)
Dim html As String = stringWriter.ToString
Dim StartPoint As Integer
StartPoint = html.IndexOf(" If (StartPoint >= 0) Then
Dim EndPoint As Integer = (html.IndexOf("/>", StartPoint) + 2)
Dim viewstateInput As String
viewstateInput = html.Substring(StartPoint, (EndPoint - StartPoint))
html = html.Remove(StartPoint, (EndPoint - StartPoint))
Dim FormEndStart As Integer = (html.IndexOf("") - 1)
If (FormEndStart >= 0) Then
html = html.Insert(FormEndStart, viewstateInput)
End If
End If
writer.Write(html)
End Sub
End Class