我想实现这样的功能。一个录入订单页面的界面,这样的界面在C/S非常普通,但是在B/S中却是不容易,我看了很多代码,没有发现一个很合适的。
屏幕分为3个部分:一个是Order Header,一个是Order Item List,一个是Order Item Detail。
这三个部分可以需要完成下面的功能
1:可以同时编辑,也就是在一个屏幕中可以同时操作3个部分。
2:Order Header,Order Item当然来自2个不同table。
3:Order Item List,Order Item Detail放在tabbed control 2个view page 中。当用户选择Order Item List(gridview)一行,切换到Order Item Detail(Formview)显示这一行的内容。
4:同时保存,同时取消。也就是一个按钮同时保存Order Header,Order Item

5: 当然这个屏幕还应该包括new,save,delete,find,first,prior,next,last等操作按钮。

切换功能

GridView/DetailsView/FormView

http://www.lemongtree.com/zh-cn/item,292.html

这里http://www.velocityreviews.com/forums/t293617-gridview-to-formview-databind.html有一个代码说明使用SelectValue实现
Below is an example of an SQLDataSource that uses a control parameter, which
takes the value from a DropDownList control.

<asp:SqlDataSource ID="sdsInvoices" runat="server" ConnectionString="<%$
ConnectionStrings:someconnectionString %>" SelectCommand="SELECT
Accounts_InvoiceEntry_Invoices.OrderID, Accounts_InvoiceEntry_Invoices.Date,
Accounts_InvoiceEntry_Invoices.customer,
Accounts_InvoiceEntry_Invoices.customer_order,
Accounts_InvoiceEntry_Invoices.cust_alpha,
Accounts_InvoiceEntry_Invoices.tran_code1,
Accounts_InvoiceEntry_Invoices.tran_code3,
Accounts_InvoiceEntry_Invoices.StatusID,
Accounts_InvoiceEntry_Statuses.StatusDescription FROM
Accounts_InvoiceEntry_Invoices INNER JOIN Accounts_InvoiceEntry_Statuses ON
Accounts_InvoiceEntry_Invoices.StatusID =
Accounts_InvoiceEntry_Statuses.StatusID WHERE
(Accounts_InvoiceEntry_Invoices.StatusID = @StatusID)">
<SelectParameters>
<asp:ControlParameter ControlID="ddlStatusList" Name="StatusID"
PropertyName="SelectedValue"
Type="Int32" />
</SelectParameters>

The above bit in the <asp:ControlParameter > tags is the key. the Mane
property matches a parameter within your SQLQuery or stored procedure, in the
above example this is @StatusID. The ControlID property is set to the ID of
the control from which to take the value of the parameter, in the case a
DropDownList control called ddlSelectStatus. This can be any ASP.net
control. The PropertyName property is the property of the control poited to
by ControlID, from which you want to take the value for the parameter. In
this case it takes the SelectedValue from the ddlSelectedStatus control.

In your case you would just set up the DataSource control to return the
values you needed, with a "WHERE ForeignKeyID = @MyParam" type where clause.
Then set up MyParam as a ControlParameter, as in the example above, but set
the controlID to the ID of your GridView and set the PropertyName to
SelectedValue. The just bind this datasource to the FormView using the
DataSourceID property and it will work.




tabbed control
http://www.alistapart.com/articles/slidingdoors/ Tab漂亮
Creating a Tabbed Interface for Displaying Parent/Child Data
http://aspnet.4guysfromrolla.com/articles/092204-1.aspx

ASP.NET 2.0中使用multiview控件
http://dev.yesky.com/msdn/30/2335530.shtml
A Simple ASP.NET Tab Control Using the MultiView control
http://www.codeproject.com/aspnet/TabControl.asp

研究了2天,发现静态页面tabbed实现比较容易,但是动态数据。比较麻烦,因为要与后台数据交互。只有采用能够Javascript来实现。
javasscript与后端如何交户呢