|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
在实现ERP等高端的ASP应用时,用户需要提供核心的经营资料,需要ASP商有很高的信用度。楼上说交互性不好,太牵强了吧。在微软提供的一套框架中,利用asp做网站,开发效率高,使用人数少,减少不必要的开销。交互性是互动方式,是有开发人员决定的。asp.net|拔出看了下外洋某巨牛的BLOG,也许是讲asp.net2.0顶用GRIDVIEW拔出新纪录的,办法对照出格,但效果
一样平常,故将程序转之,较为复杂,不做注释等。
<%@PageLanguage="C#"ClassName="Default_aspx"%>
<!DOCTYPEhtmlPUBLIC"-//W3C//DTDXHTML1.1//EN""http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<scriptrunat="server">
voidCancelButton1_Click(objectsender,EventArgse)
{
GridView1.ShowFooter=false;
}
voidAddButton1_Click(objectsender,EventArgse)
{
GridView1.ShowFooter=true;
}
voidButton1_Click(objectsender,EventArgse)
{
TextBoxcustomerID=GridView1.FooterRow.FindControl("CustomerIDTextBox")asTextBox;
TextBoxcompanyName=GridView1.FooterRow.FindControl("CompanyNameTextBox")asTextBox;
DropDownListContactTitle=GridView1.FooterRow.FindControl("ContactTitleDropDownList")asDropDownList;
SqlDataSource1.InsertParameters["CustomerID"].DefaultValue=customerID.Text;
SqlDataSource1.InsertParameters["CompanyName"].DefaultValue=companyName.Text;
SqlDataSource1.InsertParameters["ContactTitle"].DefaultValue=ContactTitle.SelectedValue;
SqlDataSource1.Insert();
}
</script>
<htmlxmlns="http://www.w3.org/1999/xhtml">
<headid="Head1"runat="server">
<title>UntitledPage</title>
</head>
<body>
<formid="form1"runat="server">
<div>
<asp:ButtonID="AddButton1"runat="Server"Text="AddnewItem"OnClick="AddButton1_Click"/>
<asp:GridViewID="GridView1"Runat="server"DataSourceID="SqlDataSource1"DataKeyNames="CustomerID"
AutoGenerateColumns="False"ShowFooter="True">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:LabelID="CustomerIDLabel"Runat="Server"><%#Eval("CustomerID")%></asp:Label>
</ItemTemplate>
<FooterTemplate>
<asp:TextBoxID="CustomerIDTextBox"Runat="server"></asp:TextBox>
</FooterTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:LabelID="CompanyNameLabel"Runat="Server"><%#Eval("CompanyName")%></asp:Label>
</ItemTemplate>
<FooterTemplate>
<asp:TextBoxID="CompanyNameTextBox"Runat="server"></asp:TextBox>
</FooterTemplate>
</asp:TemplateField>
<asp:TemplateField>
<FooterTemplate>
<asp:DropDownListID="ContactTitleDropDownList"Runat="server"DataSourceID="SqlDataSource2"DataTextField="ContactTitle"DataValueField="ContactTitle">
</asp:DropDownList>
<asp:SqlDataSourceID="SqlDataSource2"Runat="server"SelectCommand="SELECTDISTINCT[ContactTitle]FROM[Customers]"
ConnectionString="server=localhost;uid=sa;password=xxx;database=northwind">
</asp:SqlDataSource>
<asp:ButtonID="Button1"Runat="server"Text="Add"OnClick="Button1_Click"/>
<asp:ButtonID="CancelButton1"Runat="server"Text="Cancel"OnClick="CancelButton1_Click"/></p>Windows本身的所有问题都会一成不变的也累加到了它的身上。安全性、稳定性、跨平台性都会因为与NT的捆绑而显现出来; |
|