I am creating an HTML template as theme in ASP.NET. I want to read the content of the template on button click and store all the content in another template. I am reading the content as:
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 ;
but as my asp page contains:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="theme3.aspx.cs" Inherits="MailCham.theme3" %>
It is giving an error while reading the content. How can i read the content of HTML page?
Use the HtmlAgilityPack library: here
精彩评论