Click here to Skip to main content
15,888,351 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
In my page more than five grid views with GRNO. I created this grid dynamically..

C#
protected void btnSave_Click(object sender, EventArgs e)
  {
        double a, b, c, d;
        a = Convert.ToDouble(lblpurchasequantity.Text.ToString());
        b = Convert.ToDouble(lblreceivedqty.Text.ToString());
        c = Convert.ToDouble(txtreceivedquantity.Text.ToString());
        d = b + c;
        if (a >= d)
        {
            int? insertgrnorecords;
            IFormatProvider provider = new System.Globalization.CultureInfo("en-CA", true);
            String datetime = txtgoodsreceiveddate.Text.ToString();
            DateTime dt = DateTime.Parse(datetime, provider, System.Globalization.DateTimeStyles.NoCurrentDateDefault);
            objsupplyPL.goodsreceiveddate = dt;
            objsupplyPL.productid1 = Hidden1.Value.ToString();
            objsupplyPL.purchaseid = Hid_Sno1.Value.ToString();
            objsupplyPL.vehicleno = (txtvehicleno.Text.Trim().ToString() == "" ? null : txtvehicleno.Text.Trim());
            objsupplyPL.grno = txtgrno.Text.Trim().ToString();
            objsupplyPL.dcno = txtdcno.Text.Trim().ToString();
            objsupplyPL.username = Session["username"].ToString();
            objsupplyPL.quantity = Convert.ToDouble(lblpurchasequantity.Text.ToString());
            objsupplyPL.receivedquantity = Convert.ToDouble(txtreceivedquantity.Text.ToString());
            objsupplyPL.totalreceived = Convert.ToDouble(lblreceivedqty.Text.ToString());
            objsupplyPL.branch = Hid_Sno.Value;
            insertgrnorecords = objsupplyBAL.insertgrnotorecords(objsupplyPL);
            buildBranches();
            clear();

           ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "UpdateDetails", "alert('Save Successful');", true);
           
            
        }
     }



actuvally,this code for pop up window fields insertion,if i click save button,then it shows save succefully message..then it goes to general aspx page..In that GRNO button is having..then i click on GRNO two times,first time GRNO button is refreshing page second time it is refreshed.
Posted
Updated 27-Oct-13 23:14pm
v4

1 solution

if (a >= d)

This line could be causing a problem.

Try and put a debug point in this method and then debug your code after button click.
 
Share this answer
 
Comments
Siva Hyderabad 26-Oct-13 1:01am    
i tried , but it is same as the above problem..and i try a debug point.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900