Click here to Skip to main content
15,910,083 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
hi i'm begginer in asp.net and have a problem like this:
i have a register form to student that get name family and student code that is unique for each student i want have 4 checkbox for lesson1level1 ,lesson2level1 ,lesson1level2 , lesson2level2 that have a condition:if a student didn't have level 1 for each lesson he or she can't select level2 how i can do this code in asp.net and sql server?
Posted
Comments
gggustafson 31-May-15 22:37pm    
what have you tried?
12me 3-Jun-15 14:46pm    
i have 2 table one get registeration field like name family and auth code that is unique for very person and course table that for every auth code has lesson 1 level 1 and lesson 2 level 1 and ....i want relate registartion form to database that can detect for every student what lessones he or she can choose
VishwaKL 1-Jun-15 5:19am    
use panel and have check box inside the panel and depends on the conditions enable and disable the check box
12me 2-Jun-15 0:31am    
please get an example to me
gggustafson 3-Jun-15 15:03pm    
is this homework?

1 solution

use checkbox checkedchanged event and assign condition
 
Share this answer
 
Comments
12me 2-Jun-15 0:31am    
please get an example to me
[no name] 2-Jun-15 2:16am    
Hi Please Try It

In Asp page
------------------

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
Lession 1<asp:CheckBox ID="chk1" runat="server" AutoPostBack="true" OnCheckedChanged="chk1_CheckedChanged" />
Lession 2<asp:CheckBox ID="chk2" runat="server"/>
Lession 3<asp:CheckBox ID="chk3" runat="server"/>
Lession 4<asp:CheckBox ID="chk4" runat="server" />
</div>
</form>
</body>
</html>

In Cs Page
-------------------
protected void Page_Load(object sender, EventArgs e)
{

}
protected void chk1_CheckedChanged(object sender, EventArgs e)
{
if (chk1.Checked == true)
{
chk2.Enabled = false;
chk3.Enabled = false;
chk4.Enabled = false;
}
else
{
chk2.Enabled = true;
chk3.Enabled = true;
chk4.Enabled = true;
}
}
12me 3-Jun-15 14:23pm    
but there is a difficult it meanes if student did'nt get lesson 1 at level 1 he or she did'nt get lesson1 at level 2 but can get lesson 2 level 1.how i can write this one?

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900