Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Overrides on Render
Message
De
23/04/2012 10:13:03
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Titre:
Overrides on Render
Versions des environnements
Environment:
VB 9.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01542337
Message ID:
01542337
Vues:
65
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform