Set DataValueField and DataTextField in DropDownlist control |
|
Answered By
Moderator1
on
3/5/2010 8:04:42 PM |
|
|
|
|
Hi,
Before you bind the Class DropDownList control set the DataValueField as "C_Id" and DataTextField as "C_Name". Do the same for Section. Below I give sample of section dropdownlist control.
<asp:dropdownlist ID="ddlSection" runat="server" DataTextField="Sec_Name" DataValueField="Sec_Id">
</asp:DropDownList>
You can access the value of Sec_Id from the code behind as ddlSection.SelectedValue.
So take the SelectedValue of both dropdown control and insert into the Student Table. |
|
|
|