Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Overrides on Render
Message
From
23/04/2012 10:13:03
 
 
To
All
General information
Forum:
ASP.NET
Category:
Other
Title:
Overrides on Render
Environment versions
Environment:
VB 9.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01542337
Message ID:
01542337
Views:
62
I am using this to overwrite the Render:
        Protected Overrides Sub Render(writer As System.Web.UI.HtmlTextWriter)
            Dim loStringBuilder As System.Text.StringBuilder = Nothing
            Dim loTextWriter As System.Web.UI.HtmlTextWriter = Nothing

            ' If this is Html5
            If oProcess.lHtml5 Then
                loStringBuilder = New System.Text.StringBuilder("<!DOCTYPE HTML>" + oApp.cCR + oApp.cCR)
            Else
                loStringBuilder = New System.Text.StringBuilder("")
            End If

            loTextWriter = New System.Web.UI.HtmlTextWriter(New System.IO.StringWriter(loStringBuilder))

            MyBase.Render(loTextWriter)

            writer.Write(loStringBuilder.ToString)

        End Sub
This allows to add the DOCTYPE declaration when needed. I discovered this morning that I had to write something even if I do not need it otherwise there is no HTML rendered on the page. My question is if there is a way to simplify that knowing that I only need to add this DOCTYPE on the related condition.
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Next
Reply
Map
View

Click here to load this message in the networking platform