0
頁
一些HTML我想在頁面呈現在頁面(不要問爲什麼)刪除一些HTML。PageRequestManagerParserErrorException取出後從
protected override void Render(HtmlTextWriter writer)
{
MemoryStream memoryStream = new MemoryStream();
try
{
using (StreamWriter streamWriter = new StreamWriter(memoryStream))
{
var textWriter = new HtmlTextWriter(streamWriter);
base.Render(textWriter);
textWriter.Flush();
memoryStream.Position = 0;
using (StreamReader reader = new StreamReader(memoryStream))
{
var text = reader.ReadToEnd();
Regex r = new Regex("<option .+?</option>");
text = r.Replace(text, "");
writer.Write(text);
reader.Close();
}
}
}
catch (ObjectDisposedException)
{
}
finally
{
memoryStream.Dispose();
}
}
不幸的是,我已經從位於此頁面上的更新面板中得到了PageRequestManagerParserErrorException異常。我怎樣才能達到我想要的結果而不會出現錯誤?
檢查該鏈接 http://dotnetdebug.net/2006/12/28/syswebformspagerequestmanagerparsererrorexception/ http://pohee.com/general/sys-webforms-pagerequestmanagerparsererrorexception-in-ms-ajax/ – 2012-03-05 10:19:59