T
TJS
need some help converting this to vb.
-- won't compile on "HtmlTextWriter "
========== C# code ==========================
protected override void Render(HtmlTextWriter writer)
{ private const string vMessage = "message goes here"
//*** Render the page and retrieve into StringBuilder
StringBuilder sb = new StringBuilder();
HtmlTextWriter hWriter = new HtmlTextWriter(new
StringWriter(sb));
base.Render(hWriter);
// *** store to a string
string PageResult = sb.ToString();
int At = PageResult.ToLower().LastIndexOf("");
if (At > -1)
PageResult = PageResult.Insert(At,vMessage);
// PageResult = PageResult.Replace("",vMessage);
// *** Write it back to the server
writer.Write(PageResult);
return;
}
================my progress so far===============================
Protected Overrides Sub Render(writer As HtmlTextWriter)
Dim vMessage As String = "message goes here"
'*** Render the page and retrieve into StringBuilder
Dim sb As New StringBuilder()
Dim hWriter As New HtmlTextWriter(New StringWriter(sb))
MyBase.Render(hWriter)
' *** store to a string
Dim PageResult As String = sb.ToString()
Dim At As Integer = PageResult.ToLower().LastIndexOf("")
If At > - 1 Then
PageResult = PageResult.Insert(At, vMessage)
End If
' PageResult = PageResult.Replace("",vMessage);
' *** Write it back to the server
writer.Write(PageResult)
Return
End Sub 'Render
-- won't compile on "HtmlTextWriter "
========== C# code ==========================
protected override void Render(HtmlTextWriter writer)
{ private const string vMessage = "message goes here"
//*** Render the page and retrieve into StringBuilder
StringBuilder sb = new StringBuilder();
HtmlTextWriter hWriter = new HtmlTextWriter(new
StringWriter(sb));
base.Render(hWriter);
// *** store to a string
string PageResult = sb.ToString();
int At = PageResult.ToLower().LastIndexOf("");
if (At > -1)
PageResult = PageResult.Insert(At,vMessage);
// PageResult = PageResult.Replace("",vMessage);
// *** Write it back to the server
writer.Write(PageResult);
return;
}
================my progress so far===============================
Protected Overrides Sub Render(writer As HtmlTextWriter)
Dim vMessage As String = "message goes here"
'*** Render the page and retrieve into StringBuilder
Dim sb As New StringBuilder()
Dim hWriter As New HtmlTextWriter(New StringWriter(sb))
MyBase.Render(hWriter)
' *** store to a string
Dim PageResult As String = sb.ToString()
Dim At As Integer = PageResult.ToLower().LastIndexOf("")
If At > - 1 Then
PageResult = PageResult.Insert(At, vMessage)
End If
' PageResult = PageResult.Replace("",vMessage);
' *** Write it back to the server
writer.Write(PageResult)
Return
End Sub 'Render