Parsing aspx files

  • Thread starter Thread starter arunairs
  • Start date Start date
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
 
(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
 
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 findit
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
 
(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
 
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
 
Back
Top