473,326 Members | 2,133 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Parse ASCX Controls into HTML from Code?

Hi There!

Is it possible to parse (execute) the User Controls (ASCX) from VB.NET code
in ASP.NET?

For example, is there any objects in ASP.NET that allow me to do something
like...

strHTML = <<Object>>.Parse ("MyUserControl.ascx")

and get the output HTML string into strHTML variable?

Or am I wishing the impossible? :D

Many thanks!!!

MK
Nov 19 '05 #1
4 1347
You could certainly write something like this, but there is certainly no
"automatic" way in the Framework. Ultimately, the Framework compiles and
renders controls, so you can certainly poke and do the same.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

*************************************************
Think outside the box!
*************************************************
"Mike Kline" <mk@nnnnnnnnnzzzzzzzzzzzzzzzzzzzzzz.zero> wrote in message
news:uZ**************@TK2MSFTNGP12.phx.gbl...
Hi There!

Is it possible to parse (execute) the User Controls (ASCX) from VB.NET
code
in ASP.NET?

For example, is there any objects in ASP.NET that allow me to do something
like...

strHTML = <<Object>>.Parse ("MyUserControl.ascx")

and get the output HTML string into strHTML variable?

Or am I wishing the impossible? :D

Many thanks!!!

MK

Nov 19 '05 #2
> You could certainly write something like this

Could you elaborate more on that??

Thanks!

MK

"Cowboy (Gregory A. Beamer)" <No************@comcast.netNoSpamM> wrote in
message news:uA**************@tk2msftngp13.phx.gbl...
You could certainly write something like this, but there is certainly no
"automatic" way in the Framework. Ultimately, the Framework compiles and
renders controls, so you can certainly poke and do the same.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

*************************************************
Think outside the box!
*************************************************
"Mike Kline" <mk@nnnnnnnnnzzzzzzzzzzzzzzzzzzzzzz.zero> wrote in message
news:uZ**************@TK2MSFTNGP12.phx.gbl...
Hi There!

Is it possible to parse (execute) the User Controls (ASCX) from VB.NET
code
in ASP.NET?

For example, is there any objects in ASP.NET that allow me to do
something like...

strHTML = <<Object>>.Parse ("MyUserControl.ascx")

and get the output HTML string into strHTML variable?

Or am I wishing the impossible? :D

Many thanks!!!

MK


Nov 19 '05 #3
Mike Kline wrote:
Is it possible to parse (execute) the User Controls (ASCX) from VB.NET code
in ASP.NET?

For example, is there any objects in ASP.NET that allow me to do something
like...

strHTML = <<Object>>.Parse ("MyUserControl.ascx")

and get the output HTML string into strHTML variable?

If you want to render a user control you can use the Render method. This
method takes an HtmlTextWriter as an argument and the resulting HTML
output to the TextWriter used by the HtmlTextWrtier.

Anders Norås
http://dotnetjunkies.com/weblog/anoras/
Nov 19 '05 #4
Mike,

Use TemplateControl.LoadControl(FileName), which returns a Control. Then use Control.RenderControl to get HTML.

Willie

nntp://news.microsoft.com/microsoft.public.dotnet.framework.aspnet/<uZ**************@TK2MSFTNGP12.phx.gbl>

Hi There!

Is it possible to parse (execute) the User Controls (ASCX) from VB.NET code
in ASP.NET?

For example, is there any objects in ASP.NET that allow me to do something
like...

strHTML = <<Object>>.Parse ("MyUserControl.ascx")

and get the output HTML string into strHTML variable?

Or am I wishing the impossible? :D

Many thanks!!!

MK


[microsoft.public.dotnet.framework.aspnet]
Nov 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Rob Meade | last post by:
Hi all, I have just put together our organisations 'template' for our web applications and have created 7 .ascx files which when dropped into my template file work perfectly...however, I have a...
1
by: Rob Meade | last post by:
Hi all, Still very new to ASP.Net so please bare with me. I have created several .ascx controls which I have dragged and dropped onto my page in a table, looks very nice - each of the controls...
1
by: John Cosmas | last post by:
I've got a page which loads up a different user control into a placeholder control every time a button is clicked on the parent page. I use a statement like...
6
by: David Bowey | last post by:
Hi There! I have som reusable ASCX controls that I also want to let my clients use in their websites. However, I don't want them to "have" the ASCX controls on their web servers. Instead I would...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.