如何在MultiPage控件中添加一个PageView控件?

aaxu 2003-05-07 06:25:14
引用了WebControl,拉MultiPage控件到页面上,想在MultiPage控件中添加PageView控件,但是工具栏找不到PageView控件。如何在MultiPage控件中添加一个PageView控件?
...全文
109 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
iamygx 2003-05-22
  • 打赏
  • 举报
回复
</iewc:TabStrip>
<iewc:MultiPage id="MultiPage1" style="Z-INDEX: 102; LEFT: 38px; POSITION: absolute; TOP: 293px" runat="server" BorderColor="InactiveCaptionText" BackColor="InactiveBorder" Height="129px">
<iewc:pageview>
<p>file_item</p>
</iewc:pageview>
<iewc:pageview>
<p>person_item</p>
</iewc:pageview>
<iewc:pageview>
<p>detail_item</p>
</iewc:pageview>
</iewc:MultiPage>
zhaoao 2003-05-16
  • 打赏
  • 举报
回复
强烈关注!
追梦 2003-05-16
  • 打赏
  • 举报
回复
http://msdn.microsoft.com/workshop/webcontrols/overview/multipage.asp#PageView_Dynamically
追梦 2003-05-16
  • 打赏
  • 举报
回复
MultiPage ASP.NET Objects
In contrast to DHTML behaviors, ASP.NET server controls can implement as many custom elements as are needed in a single assembly. And, in the case of the WebControls, all of the ASP.NET elements are implemented by an assembly named Microsoft.Web.UI.WebControls.dll, the filename of this assembly is the same as the namespace used by these controls. Therefore, the component architecture on the ASP.NET platform requires no use of literal content elements. Any of the common language runtime languages can be used in an ASP.NET Web Form to control the MultiPage objects.

Writing a Simple MultiPage
This section walks through the steps to create a simple MultiPage. You can perform all the steps using any text editor.

If you do not have WebControls installed on your machine, see the Internet Explorer WebControls Download page for installation instructions.
Create a Web application using Microsoft Visual Studio®.
The Web application should be named webcontrols and can be used for all the samples in this article.

Note You can also use an existing Web application, but the Web must be configured as a Web application in order for the WebControls to run properly.
Create an empty Web Form page.
Add a new file to the Web and save it as multipage1.aspx.

Add the import directive.
Code the import directive for the WebControls on the first line of the Web Form. It should look like the following:

<%@ import namespace="Microsoft.Web.UI.WebControls" %>
Note In this example, the @ Import directive is optional. This directive is only required when writing Web Forms that use server-side script to create or modify WebControls objects.
Add the @ Register directive.
Code the @ Register directive for the WebControls on the second line of the Web Form.

<%@ Register TagPrefix="mymultipage"
Namespace="Microsoft.Web.UI.WebControls"
Assembly="Microsoft.Web.UI.WebControls, Version=1.0.2.226, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %>
Add the document structure.
Add the following content below the @ Register directive to provide a basic document structure.

<HTML>
<HEAD></HEAD>
<BODY></BODY>
</HTML>
Add a Form element.
All WebControls elements must be authored inside a FORM element; therefore, add the following markup inside the document BODY.

<BODY>
<FORM runat="server"></FORM>
</BODY>
Note that the runat attribute is specified for the FORM, indicating that ASP.NET is to process the results of any user input.

At this point, the Web Form includes all the processing directives, elements, and content that are required to begin authoring with the WebControls elements. The contents of the multipage1.aspx file should now look similar to the following:

<%@ import namespace="Microsoft.Web.UI.WebControls" %>
<%@ Register TagPrefix="mymultipage"
Namespace="Microsoft.Web.UI.WebControls"
Assembly="Microsoft.Web.UI.WebControls, Version=1.0.2.226, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %>
<HEAD></HEAD>
<BODY>
<FORM runat="server"></FORM>
</BODY>
Save the page and view it in your browser. If everything is correct, you should only see an empty page. The page is compiled before it is viewed, and any errors in the syntax will be raised. If you see an error at this point, correct the reported error. If the sample code provided above doesn't work, it is possible that the WebControls have not been installed correctly.

Tip For the adventurous reader: Try misspelling the value of the namespace or the assembly attributes in the declarations; save and view the page again. This is a useful exercise, because you can see how the common language runtime reports errors for Web Forms.
Add a MultiPage element.
Add a MultiPage element as a child element of the FORM and set its runat attribute to server.

<BODY>
<FORM runat="server">
<mymultipage:multipage runat="server"></mymultipage:multipage>
</FORM>
</BODY>
At this point, the MultiPage element doesn't contain any content, so nothing renders in the Web page.

Note In tag prefix for the MultiPage element, the value mymultipage is used for all WebControls elements in the page because it has been predefined in the @ Register directive.
Add PageView elements to the MultiPage.
Next, add two PageView as child elements of the MultiPage element.

<mymultipage:multipage runat="server" selectedindex="1">
<mymultipage:pageview><p>This is page number one</p></mymultipage:pageview>
<mymultipage:pageview><p>This is page number two, and this page view
is selected!</p></mymultipage:pageview>
</mymultipage:multipage>
Save the page and reload it in your browser. The HTML in the second PageView element should be rendered because the SelectedIndex attribute has been used on the MultiPage element.

The indices are zero-based; therefore, setting SelectedIndex to 1 selects the second PageView for the initial rendering of the page.

This concludes the basic MultiPage sample. Further examples follow to illustrate additional properties and features of the MultiPage.
追梦 2003-05-14
  • 打赏
  • 举报
回复
考,自己學習.
路過幫你

http://msdn.microsoft.com/workshop/WebControls/webcontrols_entry.asp?frame=true
风轻扬 2003-05-07
  • 打赏
  • 举报
回复
帮你up一下

110,538

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧