How to fill text box when click in checkbox

Posted by Shail under ASP.NET on 1/28/2015 | Points: 10 | Views : 519 | Status : [Member] | Replies : 1
Hello Sir,


My Problem is that i bind check box like that...
protected void dd2course_SelectedIndexChanged(object sender, EventArgs e)
{
if (dd2course.SelectedIndex != 0)
{
string cid = dd2course.SelectedItem.Text;
var book = db.book_store.Where(x => x.fkclassid == cid);
chkbook.DataSource = book.ToList();
chkbook.DataTextField = "BookName";
chkbook.DataValueField = "Id";
chkbook.DataBind();

}
}
and i want when click on book name(checkbox) then fill text box book name and text box price

my table is like that.........
Id
BookNo
Book Name
Book Price


plz suggest me
Thanks




Responses

Posted by: Nandkishorrech on: 1/29/2015 [Member] Starter | Points: 25

Up
0
Down
You can use 'cid' to fill the text box with Book Name. because you have been assign data to 'cid' at dd2course_SelectedIndexChanged event and you can use 'book' variable also for 'Book Name' and 'Price'.

Shail, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response