T
TJS
I want to insert a message with an override if a condition exists but the
overrides does not kick in.
How do I invoke the overrides to display a message from my class code?
============Overrides code================
Protected Overrides Sub Render(writer As HtmlTextWriter)
if Application("idx") = true then
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
' *** Write it back to the server
writer.Write(PageResult)
end if
Return
End Sub 'Render
overrides does not kick in.
How do I invoke the overrides to display a message from my class code?
============Overrides code================
Protected Overrides Sub Render(writer As HtmlTextWriter)
if Application("idx") = true then
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
' *** Write it back to the server
writer.Write(PageResult)
end if
Return
End Sub 'Render