Click here to Skip to main content
15,867,330 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
XML
<table >
   <tr>
     <td class="popuplbltdwithpadding">
         <asp:ImageButton ID="btnsaveparameter"
             ImageUrl="~/images/HMS Buttons/SaveHMS.jpg" runat="server"
             onclick="btnsaveparameter_Click1" />
         </td>
      <td  class="popuplbltdwithpadding">
          <asp:ImageButton ID="ImageButton1" runat="server"
              ImageUrl="~/images/HMS Buttons/Close.jpg"/>
      </td>
     </tr>
   </table>


C#
protected void btnsaveparameter_Click1(object sender, ImageClickEventArgs e)
        {
            //ImageButton b = (ImageButton)sender;
            //GridViewRow row = (GridViewRow)sender;
            //int rowIndex = row.RowIndex;
            foreach (GridViewRow row in GridView1.Rows)
            {
                CheckBox chk = (CheckBox)row.FindControl("chkSelect");
                if (chk.Checked)
                {
                    string ParameterId = grdcareplan.DataKeys[0].Value.ToString();
                    MySqlConnection StrConnection = null;
                    MySqlCommand StrCommand = null;

                    try
                    {
                        StrConnection = new MySqlConnection();
                        StrConnection.ConnectionString = StrConn;
                        StrConnection.Open();

                        StrCommand = new MySqlCommand();
                        StrCommand.CommandType = CommandType.StoredProcedure;
                        StrCommand.CommandText = "Insert_Parameter_Name";
                        StrCommand.Connection = StrConnection;


                        //StrCommand.Parameters.AddWithValue("_ParameterName", dropdowndisease.SelectedItem.Text);
                        StrCommand.Parameters.AddWithValue("_DiseaseId", Convert.ToInt32(ViewState["DiseaseId"]));
                        StrCommand.Parameters.AddWithValue("_ParameterId", ParameterId);
                        StrCommand.Parameters.AddWithValue("_Branch_Id", Convert.ToInt32(Session["Branchid"]));
                        StrCommand.Parameters.AddWithValue("_Tenant_Id", Convert.ToInt32(Session["Tenantid"]));
                        StrCommand.Parameters.AddWithValue("_Patient_Id", Convert.ToInt32(Session["DiagnosisClickId"]));


                        //  StrCommand.Parameters.AddWithValue("_Submit_Date", DateTime.Now);



                        StrCommand.ExecuteNonQuery();
                        BindCarePlan();
                        ModalPopupExtender1.Show();
                        Biomade.Visible = true;
                    }

                    catch (Exception ex)
                    {
                        obj.InfoEntry(DateTime.Now + "     " + "BtnSave1_Click" + "     " + "AccountBalance.aspx" + "     " + ex.Message, "");
                        obj.InfoEntry(DateTime.Now + "     " + ex.StackTrace, "");
                        Session["strerrormsg"] = DateTime.Now + "     " + "BtnSave1_Click" + "     " + "AccountBalance.aspx" + "     " + ex.Message;
                        Session["strerrortrace"] = DateTime.Now + "     " + ex.StackTrace;
                        Response.Redirect("ErrorPage.aspx");
                    }
                    finally
                    {

                        StrConnection.Close();
                        StrConnection.Dispose();
                        ModalPopup_Items.Show();



                    }
                }
            }
        }
Posted
Updated 11-Jan-13 20:20pm
v2
Comments
ridoy 12-Jan-13 5:25am    
So where is the problem?In which line?
[no name] 13-Jan-13 11:03am    
no.. you dont have any problem. the button is firing..
HariPrasad katakam 14-Jan-13 3:12am    
every thing looks fine to me. Can you share more info. try to put break point in first line of event handler and see weather it is hitting or not??

i Examing your Code and Change it


VB
<asp:ImageButton ID="btnsaveparameter"
            ImageUrl="~/images/HMS Buttons/SaveHMS.jpg" runat="server"
           OnClick="btnsaveparameter_Click1"  />



and It will work





I hope Your Problerm will solve if not give me your Reviews
 
Share this answer
 
there is no Onclick event in your button Tag
ASP.NET
<asp:imagebutton id="btnsaveparameter" imageurl="~/images/HMS Buttons/SaveHMS.jpg" runat="server" onclick="btnsaveparameter_Click1" xmlns:asp="#unknown" />
 
Share this answer
 

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