i have a problem with ext.net. i am new in ext.net and i cannot use add stored procedure with it like i have done before in .net framework.
here is my asp code:
<ext:Panel ID="Panel1" runat="server" Title="Add Customer" PaddingSummary="5px 5px 0"
Width="790px" Frame="true" ButtonAlign="Center" Layout="Form">
<Items>
<ext:TextField ID="name" runat="server" FieldLabel="First Name" AllowBlank="false"
AnchorHorizontal="100%" />
<ext:TextField ID="surname" runat="server" FieldLabel="Last Name" AllowBlank="false"
AnchorHorizontal="100%" />
<ext:TextField ID="tcno" runat="server" FieldLabel="Citizenship Number" AnchorHorizontal="100%" />
<ext:TextField ID="mphone" runat="server" FieldLabel="Mobile Phone" AnchorHorizontal="100%" />
<ext:TextField ID="hphone" runat="server" FieldLabel="Home Phone" AnchorHorizontal="100%" />
<ext:TextField ID="wphone" runat="server" FieldLabel="Work Phone" AnchorHorizontal="100%" />
<ext:TextField ID="haddress" runat="server" FieldLabel="Home Adress" AnchorHorizontal="100%" />
<ext:TextField ID="waddress" runat="server" FieldLabel="Work Adress" AnchorHorizontal="100%" />
<ext:TextField ID="email" runat="server" FieldLabel="Email" Vtype="email" AnchorHorizontal="100%" />
</Items>
<Buttons>
<ext:Button ID="Button1" runat="server" Text="Submit">
<Listeners>
<Click Handler="Ext.net.DirectMethods.addClient();" />
</Listeners>
</ext:Button>
<ext:Button ID="Button2" runat="server" Text="Cancel"/>
</Buttons>
</ext:Panel>
and .cs file is that:
protected void Page_Load(object sender, EventArgs e)
{
}
[DirectMethod]
public void addClient()
{
SqlConnection myConnection;
SqlCommand myCommand;
string strConn = System.Configuration.ConfigurationManager.ConnectionStrings["SiyahBayrakConnectionString"].ConnectionString;
myConnection = new SqlConnection(strConn);
myConnection.Open();
myCommand = new SqlCommand("addClient", myConnection);
myCommand.CommandType = System.Data.CommandType.StoredProcedure;
myCommand.Parameters.AddWithValue("@name", this.name);
myCommand.Parameters.AddWithValue("@surName", this.surname);
myCommand.Parameters.AddWithValue("@tcNo", this.tcno);
myCommand.Parameters.AddWithValue("@mobilePhone", this.mphone);
myCommand.Parameters.AddWithValue("@homePhone", this.hphone);
myCommand.Parameters.AddWithValue("@workPhone", this.wphone);
myCommand.Parameters.AddWithValue("@homeAddress", this.haddress);
myCommand.Parameters.AddWithValue("@workAddress", this.waddress);
myCommand.Parameters.AddWithValue("@email", this.email);
}
my stored procedure is working but the add function does not work. nothing happens and there is nothing in database after click submit. what is the problem?