step 2 : in gridview i added delete and update itemtemplete
delete for delete option and update for display the respective values of itemtempleteupdate in textbox
step 3 : i create update button and i want to update the table with respective itemtemplate id value
my code:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="EducationDetails.aspx.cs" Inherits="MangalyamNew1.USER.EducationDetails" %>
.style1
{
width: 100%;
}
Width="300px"> | |
DataTextField="EducationDetail" DataValueField="EducationDetail_Id"> | |
onclick="btnUpdate_Click" /> | |
AutoGenerateColumns="False" DataKeyNames="EducationDetail_Id" > CommandArgument='<%# Eval("EducationDetail_Id") %>' oncommand="ImageButton1_Command" /> CommandName="Update" Text="Update"> CommandName="Cancel" Text="Cancel"> CommandArgument='<%# Eval("EducationDetail_Id") %>' oncommand="ImageButton2_Command" /> |
code behind page:
protected void ImageButton2_Command(object sender, CommandEventArgs e)
{
int descrip_Id=Convert.ToInt32(e.CommandArgument);
BAL_EducationDetails obj=new BAL_EducationDetails();
obj.ID=descrip_Id;
DataTable dt=BAL_EducationDetails.details(obj);
if(dt.Rows.Count>0)
{
txtDescription.Text=dt.Rows[0]["EducationDetail"].ToString();
}
}
protected void btnUpdate_Click(object sender, EventArgs e)
{
BAL_EducationDetails obj = new BAL_EducationDetails();
obj.EducationDetails = txtDescription.Text;
obj.ID = Convert.ToInt32(id);
BAL_EducationDetails.update(obj);
}
obj.ID is property that propery is not getting the value..??
3 Replies
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.

Dorababu MekaPosted Oct 18, 2012, 7:28 AM
mohammed shamsheerPosted Oct 18, 2012, 7:24 AM
Dorababu MekaPosted Oct 16, 2012, 9:36 AM