日期:2014-05-18  浏览次数:20421 次

JAVASCRIPT读取本地ASP.NET页面问题
只想读取一个Test.aspx页面,把.aspx页面的源代码(包括服务器端的任何控件)
Test.aspx源代码如下:
/****************************************************************

<%@   Page   language= "c# "   Codebehind= "Test.aspx.cs "   AutoEventWireup= "false "   Inherits= "UserPopedom.Web.NavigationMenu.Test "   %>
<!DOCTYPE   HTML   PUBLIC   "-//W3C//DTD   HTML   4.0   Transitional//EN "   >
<HTML>
<HEAD>
<title> Test </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   id= "Form1 "   method= "post "   runat= "server ">
<asp:DataGrid   id= "DataGrid1 "   style= "Z-INDEX:   101;   LEFT:   216px;   POSITION:   absolute;   TOP:   112px "
runat= "server "> </asp:DataGrid>
</form>
</body>
</HTML>

*****************************************************************/


在HTML中JAVASCRIPT可以读出来

显示的内容跟上面的代码一样的;


问题是同样的代码放在.aspx中去处理

就会显示其生成后的源代码:

显示的内容如下:
/*****************************************************************

<!DOCTYPE   HTML   PUBLIC   "-//W3C//DTD   HTML   4.0   Transitional//EN "   >
<HTML>
<HEAD>
<title> Test </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= "Form1 "   method= "post "   action= "Test.aspx "   id= "Form1 ">
<input   type= "hidden "   name= "__VIEWSTATE "   value= "dDwtNTcyNzE4MDk2O3Q8O2w8aTwxPjs+O2w8dDw7bDxpPDE+Oz47bDx0PEAwPDs7Ozs7Ozs7Ozs+Ozs+Oz4+Oz4+Oz4vNOdKYRmg/fxi8tmIBO7mVPf9RA== "   />


</form>
</body>
</HTML>
*********************************************************************/

如何在.aspx中获取Test.aspx的源代码呢?????????????

或者知道为什么的告诉一下:

谢谢




------解决方案--------------------
JAVASCRIPT客户端读取肯定就是aspx在客户端生成的html代码啊。
------解决方案--------------------
GetPageHtml.aspx

<%@ Page language= "c# " validateRequest = "false " Codebehind= "GetPageHtml.aspx.cs "
AutoEventWireup= "false " Inherits= "eMeng.Exam.GetPageHtml " %>
<!DOCT