【问题标题】:error in reading html content from asp page从asp页面读取html内容时出错
【发布时间】:2011-06-02 11:53:26
【问题描述】:

我正在创建一个 HTML 模板作为 ASP.NET 中的主题。我想在按钮单击时阅读模板的内容并将所有内容存储在另一个模板中。我正在阅读内容:

 xmlDoc.Load(theme);
            XmlNodeList list = xmlDoc.SelectNodes("html/body/form/div/table/tbody/tr/td/textarea");
            headtext = list.Item(0).InnerText;
            totext = list.Item(1).InnerText;
            bodytext = list.Item(2).InnerText;
            footertext = list.Item(3).InnerText;
            string new_theme = edittheme(headtext, totext, bodytext, footertext);
            return new_theme ;

但我的 asp 页面包含:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="theme3.aspx.cs" Inherits="MailCham.theme3" %>

读取内容时出错。如何阅读 HTML 页面的内容?

【问题讨论】:

  • 谁能解决这个问题???

标签: c# asp.net html


【解决方案1】:

使用 HtmlAgilityPack 库:here

【讨论】:

    猜你喜欢
    • 2013-11-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-03-07
    • 1970-01-01
    • 2013-05-03
    • 1970-01-01
    相关资源
    最近更新 更多