Parsing aspx files

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • arunairs@gmail.com

    Parsing aspx files

    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
  • Mark Rae [MVP]

    #2
    Re: Parsing aspx files

    <arunairs@gmail .comwrote in message
    news:833b5766-a537-4fca-8020-bd00db1b242b@s9 g2000prm.google groups.com...
    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.
    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...?


    --
    Mark Rae
    ASP.NET MVP


    Comment

    • Hans Kesting

      #3
      Re: Parsing aspx files

      arunairs@gmail. com 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


      Comment

      • arunairs@gmail.com

        #4
        Re: Parsing aspx files

        On Nov 17, 8:10 pm, "Mark Rae [MVP]" <m...@markNOSPA Mrae.netwrote:
        <aruna...@gmail .comwrote in message
        >
        news:833b5766-a537-4fca-8020-bd00db1b242b@s9 g2000prm.google groups.com...
        >
        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.
        >
        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...?
        >
        --
        Mark Rae
        ASP.NET MVPhttp://www.markrae.net
        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

        Comment

        • arunairs@gmail.com

          #5
          Re: Parsing aspx files

          On Nov 17, 8:24 pm, Hans Kesting <news.han...@sp amgourmet.comwr ote:
          aruna...@gmail. com 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
          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

          Comment

          • Hans Kesting

            #6
            Re: Parsing aspx files

            arunairs@gmail. com wrote on 17-11-2008 :
            On Nov 17, 8:24 pm, Hans Kesting <news.han...@sp amgourmet.comwr ote:
            >aruna...@gmail .com 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
            >
            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


            Comment

            Working...