Can anyone find a reason for this code not working? That is, for the stream returning empty?
Your expedient assistance is greatly appreciated.
Thanks...Chris
IList<QuestionDefinitions> questiondefs = new List<QuestionDefinitions>();
QuestionDefinitions questdef = new QuestionDefinitions();
questdef.OriginalTxt = Server.HtmlEncode(@"<dd> [] text...text...text <dd> [] text...text");
HtmlDocument doc = new HtmlDocument();
//doc.OptionFixNestedTags = true;
//doc.OptionWriteEmptyNodes = true;
doc.OptionDefaultStreamEncoding = Encoding.UTF8;
doc.LoadHtml(@"<table><tr><td><dd>text...text...text <dd>text...text</td></tr></table>");
Stream htmlStream = new MemoryStream();
doc.Save(htmlStream);
StreamReader streamReader = new StreamReader(htmlStream);
questdef.NewTxt = streamReader.ReadToEnd().Trim();
questdef.IsSame = questdef.OriginalTxt == questdef.NewTxt ? true : false;
questiondefs.Add(questdef);
this.lblCount.Text = questiondefs.Count.ToString();
dgQuestionDefs.DataSource = questiondefs;
dgQuestionDefs.DataBind();
I tried including moving the position of the stream to 0, but that had no effect.Your expedient assistance is greatly appreciated.
Thanks...Chris