2014-02-23 3 views
0

좋아, 2 양식 신청서를 작성했습니다. 첫 번째 페이지에는 일련의 dropdownslist와 gridview가 있습니다. 고객이 드롭 다운 목록에서 제품을 선택하면 gridview에 세부 사항과 함께 나타납니다. 그런 다음 사용자가 원하는 수량, 이름 및 주소를 입력 할 수 있도록 3 개의 텍스트 상자가 있습니다. 하단에는 주문 생성 버튼이 있으며, 현재 다음 페이지로 리디렉션됩니다.신규 고객 만들기

그러나 해당 페이지에서 고객을 생성하게하고 화면에 주문을하면 주문이 성공적으로 생성되었다고하고 주문 번호가 나와야합니다. 이 목적을 위해 나에게 제출 된 CreateOrder라는 프로 시저.

그러나 실제로 고객을 만들고 첫 번째 페이지를 클릭하여 주문하고 주문 번호를 두 번째 페이지에 표시하도록 허용해야합니까, 아니면 두 번째 페이지에서 고객을 만들 수 있습니까? 주문 번호가 표시됩니까? 다음 페이지에서 1.

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs"  Inherits="_Default" %> 

<!DOCTYPE html> 

<html xmlns="http://www.w3.org/1999/xhtml"> 
<head runat="server"> 
<title></title> 
</head> 
<body> 
<form id="form1" runat="server"> 
<div> 

</div> 
<div style="height: 182px"> 
Category: <asp:DropDownList ID="ddlCategory" 
runat="server" DataSourceID="SqlDataSource1" DataTextField="CategoryName" 
DataValueField="CategoryId" AutoPostBack="True"/> 
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:DeveloperInterviewConnectionString %>" SelectCommand="CategoryListing" SelectCommandType="StoredProcedure"></asp:SqlDataSource> 
<br/> 
Product: <asp:DropDownList ID="ddlProduct" 
runat="server" DataSourceID="SqlDataSource2" DataTextField="ProductName" 

DataValueField="ProductId" AutoPostBack="True"/> 
<asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ 

ConnectionStrings:DeveloperInterviewConnectionString %>" SelectCommand="CategoryProducts" SelectCommandType="StoredProcedure"> 
    <SelectParameters> 
<asp:ControlParameter ControlID="ddlCategory" Name="CategoryId"  
PropertyName="SelectedValue" Type="Int32" /> 
</SelectParameters> 
</asp:SqlDataSource> 
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="ProductId" DataSourceID="SqlDataSource3" Width="105px"> 
<Columns> 
<asp:BoundField DataField="ProductId" HeaderText="ProductId" InsertVisible="False" ReadOnly="True" SortExpression="ProductId" /> 
<asp:BoundField DataField="ProductName" HeaderText="ProductName" SortExpression="ProductName" /> 
<asp:BoundField DataField="ProductDescription" HeaderText="ProductDescription" SortExpression="ProductDescription" /> 
<asp:BoundField DataField="QuantityInStock" HeaderText="QuantityInStock" SortExpression="QuantityInStock" /> 
      </Columns> 
     </asp:GridView> 
     <br/> 
     <asp:SqlDataSource ID="SqlDataSource3" runat="server" ConnectionString="<%$ ConnectionStrings:DeveloperInterviewConnectionString %>" SelectCommand="SELECT  [ProductId], [ProductName], [ProductDescription], [QuantityInStock] FROM [Product] WHERE ([ProductId] = @ProductId)"> 
      <SelectParameters> 
       <asp:ControlParameter ControlID="ddlProduct" Name="ProductId" PropertyName="SelectedValue" Type="Int32" /> 
      </SelectParameters> 
     </asp:SqlDataSource> 
    <p> 
     <asp:Label ID="Label1" runat="server" Text="Quantity to Order"></asp:Label> 
     <asp:TextBox ID="QuantityOrderTB" runat="server" Width="223px"></asp:TextBox> 
    </p> 
    <p> 
     <asp:Label ID="Label2" runat="server" Text="Customer Name"></asp:Label> 
     <asp:TextBox ID="CustomerNameTB" runat="server" Width="223px"> </asp:TextBox> 
    </p> 
    <p> 
     <asp:Label ID="Label3" runat="server" Text="Customer Address"></asp:Label> 
     <asp:TextBox ID="CustomerAddressTB" runat="server" Height="61px" Width="260px"> </asp:TextBox> 
     </p> 
<br /> 
     <input type="button" value="Create Order" 
onClick="location.href = 'Confirmation.aspx';"> 
</div> 
</form> 
</body> 
</html> 

답변

0

당신이 다음에 서버 측 이벤트를 추가 서버 사이드 버튼

에 버튼을 변경할 수 있습니다 코드입니다.

+0

어떻게해야할까요? –