复制代码 代码如下:
system.io.stringwriter html = new system.io.stringwriter();
system.web.ui.htmltextwriter tw = new system.web.ui.htmltextwriter(html);
base.render(tw);
string temp = html.tostring();
string s1 = string.empty, s2 = string.empty, s3 = string.empty, s4 = string.empty, s5 = string.empty, s6 = string.empty;
int i = 0;
int j = 0;
i = temp.indexof("<form");
if (i > 0)
{
j = temp.indexof(">", i);
s1 = temp.substring(0, i);
s2 = temp.substring(j + 1, temp.length - j - 1);
}
i = s2.indexof("<input type=\"hidden\" name=\"__viewstate\" id=\"__viewstate\"");
if (i > 0)
{
j = s2.indexof(">", i);
s3 = s2.substring(0, i);
s4 = s2.substring(j + 1, s2.length - j - 1);
}
i = s4.indexof("<input type=\"hidden\" name=\"__eventvalidation\" id=\"__eventvalidation\"");
if (i > 0)
{
j = s4.indexof(">", i);
s5 = s4.substring(0, i);
s6 = s4.substring(j + 1, s4.length - j - 1);
temp = s1 + s3 + s5 + s6;
}
else
{
temp = s1 + s3 + s4;
}
temp = temp.replace("</form>", "");
temp = temp.replace("\r\n", "");
tw.close();
response.write(temp);
您可能感兴趣的文章:
如您对本文有疑问或者有任何想说的,请点击进行留言回复,万千网友为您解惑!
网友评论