Parsing aspx files

A

arunairs

Hi,
How would one parse aspx pages? Is there an aspx parser available? I
need to access the individual controls in an aspx page and parse them.

thanks,
Arun
 
H

Hans Kesting

(e-mail address removed) explained :
Hi,
How would one parse aspx pages? Is there an aspx parser available? I
need to access the individual controls in an aspx page and parse them.

thanks,
Arun

Do you know about the ParseControl() and LoadControl() methods?
If they are not what you are looking for, then you need to explain more
....


Hans Kesting
 
A

arunairs

Please provide more information about what exactly you mean by "parse" in
this context...

Web controls (e.g. <asp:Button /> etc) are used by ASP.NET to render HTML -
they don't exist in the streamed data because ASP.NET has converted them to
HTML markup.

What are you actually trying to find out and where are you trying to find it
out? Server-side before the page is rendered, client-side after the page is
renedered, or maybe somewhere in between...?

I want to parse them before the page is rendered. I need to generate
a custom script for every input control (textbox, listboxes etc) in an
aspx page. That is why I need to know what input web controls exist in
a given aspx page.

Hope it is clear,

thanks,
Arun
 
A

arunairs

(e-mail address removed) explained :



Do you know about the ParseControl() and LoadControl() methods?
If they are not what you are looking for, then you need to explain more
...

Hans Kesting

Hi,
I need to generate a custom script for every input control (textbox,
listboxes etc) in an aspx page. That is why I need to know what input
web controls exist in a given aspx page. I would be writing C# code to
parse the aspx file to get this info.

Hope it is clear,

thanks,
Arun
 
H

Hans Kesting

Hi,
I need to generate a custom script for every input control (textbox,
listboxes etc) in an aspx page. That is why I need to know what input
web controls exist in a given aspx page. I would be writing C# code to
parse the aspx file to get this info.

Hope it is clear,

thanks,
Arun

Why not recursively walk though the Controls collection, find all input
controls and act on them? You should do this somewhere before the
"Render" event.

You could also use ParseControl to let asp.net parse the aspx file (and
then loop though all controls yourself), but I'm not sure all the
client-side IDs will be the same as in the "real" page (which is what
you would need).

Hans Kesting
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,053
Latest member
billing-software

Latest Threads

Top