Click here to Skip to main content
11,703,632 members (71,169 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET
<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>

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 11-Jan-13 19:58pm
ujali439
Edited 11-Jan-13 20:20pm
v2
Comments
ridoy at 12-Jan-13 5:25am
   
So where is the problem?In which line?
Md. Humayun Rashed at 13-Jan-13 11:03am
   
no.. you dont have any problem. the button is firing..
HariPrasad katakam at 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??
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

i Examing your Code and Change it


<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
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

there is no Onclick event in your button Tag
<asp:imagebutton id="btnsaveparameter" imageurl="~/images/HMS Buttons/SaveHMS.jpg" runat="server" onclick="btnsaveparameter_Click1" xmlns:asp="#unknown" />
  Permalink  

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

  Print Answers RSS
0 Maciej Los 570
1 OriginalGriff 500
2 Sergey Alexandrovich Kryukov 410
3 F-ES Sitecore 165
4 Andy Lanng 159
0 OriginalGriff 8,519
1 Sergey Alexandrovich Kryukov 7,667
2 CPallini 4,987
3 Maciej Los 4,686
4 Mika Wendelius 3,566


Advertise | Privacy | Mobile
Web02 | 2.8.150819.1 | Last Updated 14 Jan 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100