Hi guys,
I have asp.net website in c#.
I have one page, in which i have a table in this table i have,
dropdownlist, text boxes, labels and one 'add button'.
This add button will the table data to the Repeater in C#.
Code:
protected void btnAddTransport_Click(object sender, EventArgs e)
{
DataTable dt;
try
{
if (ddlsch.SelectedIndex > 0)
{
if (MySession.Current.Tr_TempDataTable == null)
{
dt = new DataTable();
dt.Columns.Add("RefID", typeof(string));
dt.Columns.Add("sch", typeof(string));
dt.Columns.Add("qty", typeof(string));
dt.Columns.Add("mileage", typeof(string));
dt.Columns.Add("trips", typeof(string));
dt.Columns.Add("unitprice", typeof(string));
dt.Columns.Add("description", typeof(string));
dt.Columns.Add("netprice", typeof(string));
}
else
{
dt = MySession.Current.Tr_TempDataTable;
}
DataRow dr = dt.NewRow();
dr["RefID"] = ddlsch.SelectedValue.ToString();
dr["sch"] = ddlsch.SelectedItem.ToString();
dr["qty"] = txtQuantity.Text;
dr["mileage"] = txtmileage.Text;
dr["trips"] = txttrips.Text;
dr["unitprice"] = lbltunitprice.Text;
dr["description"] = hdndesc.Value.ToString();
dr["NetPrice"] = hdntNP.Value.ToString();
dt.Rows.Add(dr);
MySession.Current.Tr_TempDataTable = dt;
Repeater1.DataSource = dt;
Repeater1.DataBind();
ddlsch.ClearSelection();
txtQuantity.Text = "";
txtmileage.Text = "";
txttrips.Text = "";
lbltunitprice.Text = "";
lbldesc.Text = "";
hdntNP.Value = "";
}
}
catch (Exception)
{
throw;
}
}
I have published this code on client server. N on the server it is taking more than or
equal to 4sec.
So, i want to do this in Ajax/Javascript/JQuery to bind the repeater.
Can any one plz help me.
Thanks