asp.net


Render control as ASP not HTML


I'm in the need to take an object of WebControls type and generate the ASP.NET markup.
Dim lblTest as New Label
lblTest.ID = "lblTest"
lblTest.Text = "Text Here"
lblTest.CssClass = "myClass"
Would generate the following string.
<asp:Label id="lblTest" runat="server" CssClass="myClass" Text="Text Here" />
I'm hoping to expand this idea to numerous controls that have the flexibility to handle numerous attributes. The end result would be to take a collection of objects and to generate either a .ascx or .aspx based upon the user's input.
If you use a Placeholder, you could then add as many controls to it as you'd like.
Dim lblTest As New Label
lblTest.ID = "lblTest"
lblTest.Text = "Text Here"
lblTest.CssClass = "myClass"
PlaceHolder1.Controls.Add(lblTest)

Related Links

ASP.Net MVC 3 ListBox Selected Items Collection Null
The state information is invalid for this page and might be corrupted
Global Code segment in MVC View giving an error… “Expression Expected.”
Is Forms Authentication totally necessary?
inline code on server control properties
manipulating the date and time from a datetime sql server type in vb.net
Multiple users assigned same session ID at once
Click anywhere on a GridView row to enter the edit mode
How to bind all the rows of Dataset in gridview
How to remove Column in crystal report if Column value have NULL
Minify CSS and JS in Asp.Net when Publish a WebApplication
ASP.NET Adding Multiple footers rows to Gridview
ASP.NET Add HTML To Gridview header Text
How do I add asp tags using xmldocument?
Adding Areas to a hybrid MVC-Webforms application
Insert literal control inside HEAD when <head runat=“server”> is not specified?

Categories

HOME
botframework
windows-server-2008
latex
skypedeveloper
azure-database-mysql
mifare
google-docs-api
powerquery
checkpoint
servicenow
gnuradio
python-3.4
aspectj
unreal-engine4
websharper
reportlab
ofbiz
virtuemart
alert
jq
google-drive-android-api
connection-pooling
android-wear-2.0
priority-queue
oracle10g
deployment-descriptor
akavache
rollupjs
expressionengine
typeclass
recreate
ios9
edsdk
contextmenustrip
oracle-nosql
zimbra
incapsula
wunderground
maven-2
nscollectionview
rbac
wufoo
text-extraction
nshttpurlresponse
codepen
html-entities
taleo
encoder
line-endings
jks
runner
vertex
nservicebus6
timex
lightspeed
qt3d
android-music-player
easy68k
dimensionality-reduction
access-violation
xcode7.1
jira-agile
hfp
weblogic-maven-plugin
jde
adempiere
log4cxx
cloud-storage
avrcp
android-networking
vectordrawable
fileinputstream
gcc-warning
skview
asp.net-2.0
chrome-mobile
douglas-peucker
optimistic-locking
fiware-health
jsonschema2pojo
lwuit
zoneminder
formbuilder
nsnotificationcenter
twitter-finagle
sendy
new-operator
dayofweek
git-subtree
php-amqplib
ie-developer-tools
static-class
typography
azure-scheduler
gmail-imap
reference-manual
auctex
biztalk-deployment
screensharing
stl-algorithm
inserthtml
cgaffinetransform
log-shipping
overlays
mass-emails
text-manipulation
appointment
morfik
cstring

Resources

Encrypt Message