http://chs.gotdotnet.com/quickstart/aspplus/doc/webpagelets.aspx

解决方案 »

  1.   

    给你一个最简单的例子:
    User controls live in ASCX files, just as Web forms live in ASPX files. ASPX files contain <form> tags defining HTML forms. ASCX files never have <form> tags because they’re designed to be inserted into existing forms. Here’s a very simple user control:<h1>Hello, world</h>
    Assume that this HTML is stored in a file named Hello.ascx. Furthermore, assume that someone wants to insert this user control into a Web form. Here’s an ASPX file that does just that:<%@ Register TagPrefix="user" TagName="Hello" src="Hello.ascx" %><html>
      <body>
        <form runat="server">
          <user:Hello RunAt="server" />
        </form>
      </body>
    </html>