读书人

一个稀奇的有关问题!

发布时间: 2012-01-29 21:39:32 作者: rapoo

一个稀奇的问题!!
private void Page_Load(object sender, System.EventArgs e)
{
// 在此处放置用户代码以初始化页面
if( ! this.IsPostBack)
{
System.IO.DirectoryInfo info=new DirectoryInfo(@ "E:\c#示例 ");
foreach(System.IO.FileInfo f in info.GetFiles( "*.cs "))
{
String name=f.FullName;
long size=f.Length;

string s= " <font size=2 color=red> "+ " <input type= 'button ' id= 'd ' onclick= 'alert( 'hello world '); ' value= ' "+size.ToString()+ " ' </input> ";


Response.Write(s+ "     "+name+ "     "+f.CreationTime+ " <font> <br> <div align= 'left '> <hr color=blue size=1 width= '50% ' > </div> ");
}


}
}

这段代码中的Button单击没有效果 ,我查看了HTML发现这样了一个问题,

<font size=2 color=red> <input type= 'button ' id= 'd ' onclick= 'alert( 'hello world '); ' value= '1334 ' </input>     E:\c#示例\enum.cs    2007-4-2 11:31:15 <font> <br> <div align= 'left '> <hr color=blue size=1 width= '50% ' > </div> <font size=2 color=red> <input type= 'button ' id= 'd ' onclick= 'alert( 'hello world '); ' value= '370 ' </input>     E:\c#示例\io.cs    2007-4-2 11:50:12 <font> <br> <div align= 'left '> <hr color=blue size=1 width= '50% ' > </div>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN " >
<HTML>
<HEAD>
<title> WebForm1 </title>
<meta name= "GENERATOR " Content= "Microsoft Visual Studio .NET 7.1 ">


<meta name= "CODE_LANGUAGE " Content= "C# ">
<meta name= "vs_defaultClientScript " content= "JavaScript ">
<meta name= "vs_targetSchema " content= "http://schemas.microsoft.com/intellisense/ie5 ">
</HEAD>
<body MS_POSITIONING= "GridLayout ">
<form name= "_ctl0 " method= "post " action= "WebForm1.aspx " id= "_ctl0 ">
<input type= "hidden " name= "__VIEWSTATE " value= "dDwtNjU0MzcyMTk1Ozs+Q9Sem0vH0+DOKc3WsZdO/t2PrPE= " />


</form>
<FONT face= "宋体 "> </FONT>
</body>
</HTML>
为什么显示是这样的?

[解决办法]
正常啊

读书人网 >asp.net

热点推荐