//View button click event protected void ibtnView_Click(object sender, ImageClickEventArgs e) { GridViewRow gvRow = (GridViewRow)((ImageButton)sender).NamingContainer; Int32 M_State_Slno = Convert.ToInt32(gvState.DataKeys[gvRow.RowIndex].Value); StateEntity state = GetState(M_State_Slno); stateidAddpopup.Value = state.M_State_Slno.ToString(); txtstatenameViewpopup.Text = state.M_State_Name; txtstateshortnameViewpopup.Text = state.M_State_Sname; mpeStateView.Show(); }
protected void EditpopupSaveButton_Click(object sender, EventArgs e) { if (Page.IsValid) { StateEntity state = new StateEntity(); state.M_State_Slno = Convert.ToInt32(stateidEditpopup.Value); state.M_State_Name = txtstatenameEditpopup.Text.Trim(); state.M_State_Sname = txtstateshortnameEditpopup.Text.Trim(); state.M_State_M_Countryslno = Convert.ToInt32(countrydropdownlistEditpopup.SelectedItem.Value); if (state.M_State_Slno != 0) { UpdateState(state); } LoadData(); } }
protected void AddpopupSaveButton_Click(object sender, EventArgs e) { // ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert('Sorry there are no attachments');", true); if (Page.IsValid) { StateEntity state = new StateEntity(); state.M_State_Slno = Convert.ToInt32(stateidAddpopup.Value); state.M_State_Name = txtstatenameAddpopup.Text.Trim(); state.M_State_Sname = txtstateshortnameAddpopup.Text.Trim(); state.M_State_M_Countryslno = Convert.ToInt32(countrydropdownlistAddpopup.SelectedItem.Value); if (state.M_State_Slno == 0) { AddNewState(state); } LoadData(); } }