Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6243745
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T12:11:59+00:00 2026-05-24T12:11:59+00:00

I am using version 1.4 of the HtmlAgilityPack and as I understand it, the

  • 0

I am using version 1.4 of the HtmlAgilityPack and as I understand it, the MixedCodeDocument and related classes are there to help you parse asp.net markup as found in aspx and ascx files. I’ve found zero documentation or examples for the MixedCodeDocument class. From what I’ve tried, it seems that the MixedCodeDocument breaks a file’s text into chunks separating asp.net fragments from non-asp.net fragments. For example, the following snippet:

<asp:Label ID="lbl_xyz" runat="server" Text='<%=Name%>'></asp:Label>
<a href='#'>blah</a>

would be broken up into:

// Text fragment 1
<asp:Label ID="lbl_xyz" runat="server" Text="

// Code fragment 1
<%=Name%>

// Text fragment 2 (two lines)
></asp:Label>
<a href='#'>blah</a>

But there is no parsing done any deeper than that, i.e. the a tag is not parsed into its own node with attributes or anything like that.

So my best guess is that the MixedCodeDocument is expected to be used to strip out the code fragments so that the remaining text fragments can be pieced together and then parsed using the HtmlDocument class.

Does anybody know if that’s correct? Or even better, does anybody have any tips for ways to successfully parse and manipulate an aspx or ascx file using the HAP or other?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T12:11:59+00:00Added an answer on May 24, 2026 at 12:11 pm

    You guess is 100% correct.

    The MixedCodeDocument class was designed to be able to parse a text that contains two languages, that is, classic ASP, ASP.NET, etc. hence the name 🙂

    Originally the Html Agility Pack was used in a tool that is capable of processing and transforming a whole tree of various files, including HTML and other types of file. If you needed to replace only the HTML parts for other files, this class helped you split code & markup and. Separated code and markup blocks can then be parsed by other means.

    I don’t think anyone’s using it today 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an asp.net site that is using version 1.1 of the .NET framework.
We are using version 3.0.20229.0 of the asp.net ajaxControlTookKit (before .net 3.5 sp1). I
I understand the importance of using version control and I am trying to learn
I was wondering if someone could help me. I have started using version control
I am using version 2 of ProtoBuf-net, and currently I'm geting the error Unable
I have set up a NInject (using version 1.5) binding like this: Bind<ISessionFactory>().ToMethod<ISessionFactory>(ctx =>
Let me preface by saying that I'm new to ant, and I'm using version
Ok, so somewhere, something is wrong. When I was using version 1.3 the accordion
Using a version control system for your source code (like subversion ) makes sense
We are currently using Mysql version 5.0 in our application and are thinking of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.