Vinit Patel

Page Render Event – Replace the attribute from the html render

Posted on: June 15, 2011


Hi,

 

The below code is for replace the specified attribute from the html.

protected override void Render(HtmlTextWriter writer)
{
using (System.IO.MemoryStream msOur = new System.IO.MemoryStream())
{
using (System.IO.StreamWriter swOur = new System.IO.StreamWriter(msOur))
{
HtmlTextWriter ourWriter = new HtmlTextWriter(swOur);
base.Render(ourWriter);
ourWriter.Flush();
msOur.Position = 0;
using (System.IO.StreamReader oReader = new System.IO.StreamReader(msOur))
{

string sTxt = oReader.ReadToEnd();
sTxt = sTxt.Replace(“rules=\”all\””, ” “);
Response.Write(sTxt);
oReader.Close();
}
}
}
}

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Calendar

June 2011
M T W T F S S
« Apr   Jan »
 12345
6789101112
13141516171819
20212223242526
27282930  

Stats Of Blog

  • 6,848 hits

Cluster Map

%d bloggers like this: