if you used <!-- .. -->, the content of 1.aspx becomes part of temp.aspx, and they are compiled together, any tag of <%@ Page %> in 1.aspx is ignoredalso, this style is not suitable in ASP.NET, if you need to include 1.aspx, try to make 1.aspx a user control

解决方案 »

  1.   

    在自定义控件的类型选择上,如果你只是一般的显示一些固有的控件,而不作属性、事件的操作,那写成UserControl会简单一点,这样的自定义控件相当于ASP中通过include执行的代码。如果你想在设计、运行中修改控件内部的属性、得到控件的某些事件,那最好写成一个dll文件,也就是写成一个类,这样的控件可以像一般的Web控件一样,用鼠标拖动大小,设置属性,获取事件等。