首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > asp.net >

一个稀奇的有关问题!

2012-01-29 
一个稀奇的问题!!privatevoidPage_Load(objectsender,System.EventArgse){//在此处放置用户代码以初始化页

一个稀奇的问题!!
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+ "&nbsp;&nbsp;&nbsp;&nbsp; "+name+ "&nbsp;&nbsp;&nbsp;&nbsp; "+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> &nbsp;&nbsp;&nbsp;&nbsp;E:\c#示例\enum.cs&nbsp;&nbsp;&nbsp;&nbsp;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> &nbsp;&nbsp;&nbsp;&nbsp;E:\c#示例\io.cs&nbsp;&nbsp;&nbsp;&nbsp;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>    
为什么显示是这样的?

[解决办法]
正常啊

热点排行