Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Overrides on Render
Message
 
To
23/04/2012 10:13:03
General information
Forum:
ASP.NET
Category:
Other
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:
01542338
Views:
30
Rendering an empty string on a page renders nothing.

You might just want to use " " or
"<br />"
instead of an empty string.

UPDATE - well I'm trying to show ampersand nbsp semicolon but it keeps rendering as a blank space (even when in PRE tags).

you get my drift I hope.


>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.
____________________________________

Don't Tread on Me

Overthrow the federal government NOW!
____________________________________
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform