My Scenario is : I want to Assign a Multiple Courses to the Student
I have made every thing and Multiple Courses Assigned by Checkboxes but I dont want it now..
I want To make form like When User will click +ADD_Button a DropDownList will Appear and User will select 'Course' Then AutoPostBack and Label1.Text will show the Course.Then User Will again Click +ADD_Button and 2nd DropDownlist will Appear and User will
Again Select '2nd Course' Then Label2.text will pick this SelectedItem.Text. So, N and So fourth.. +ADD_button ......................
+ADD_Button -- DropDownList -- Label1.Text
And i also want These label1.Text, Label2.Text and LabelN.Text (as much user click +ADD_Button So, NumberofTimes +ADD_Button clicked. that much LabelN.Text) i want to store these on Database I can Connect it But Im confused about this issue So, far i connected
The Hard Coded Text but this will be Dynamic and As much User clicks +ADD_BUTTON I will have to connect to the Database.
Please Help me on this issue i will be very thankfull to you...
Sounds like you got a lot going on, so let's do one task at a time to get the final product. I am not clear if you have a database connection or not please confirm.
From what I read you will need the following controls: please confirm?
1. Eliminating checkboxes
2. add button
3. Panel Control that shows dropdownList add (You can turn panels on and off by using the visible=true/false)
4. Link button for adding courses
5. Label showing selected courses
6. To capture the number of times a user clicked a control on your pages, you might want to record the user's username, pageName, ControlName, DateTime, login session and store infor in database table.
Question: What do you need a second drop down list for the second set of courses. Are the courses all coming from the same database table or is there two different database tables?
Connection String: You could do a search on this there is plenty out on the web about connection strings to database...
Identity the connection string required and pass the connection string to the datacontext constructor
dim connString as string = "Data Source=(local);Initial Catalog=TestDB;Integrated Security=True";
dim TestDC = new MyDataContext(connString);
Question:What do you need a second drop down list for the second set of courses. Are the courses all coming from the same database table or is there two different database tables?
Connection String: You could do a search on this there is plenty out on the web about connection strings to database...
Identity the connection string required and pass the connection string to the datacontext constructor
I want to Bind the Dynamically added DropDownLists to the 1 Table of Courses there will be Courses which are avaible, and i Can Store the Data to the Database by Insert and executenonquery(); but im confused about this AutoGenerate +ADD_Button click etc.
tarunsaini
Im confused about your reply Please help me on this issue and you gave me a different thing..
Hi, why would you like to show the same table again and agian and again by posting back? The students need to click tons of time to select courses, would you think this will make the students happy? More, every postback, the page will run full page lifecycle,
this will heavy your server work, why you want this? Don't you think to choose all courses and click button once, get a result page of selected coursees is a better way?
Hi, why would you like to show the same table again and agian and again by posting back? The students need to click tons of time to select courses, would you think this will make the students happy? More, every postback, the page will run full page lifecycle,
this will heavy your server work, why you want this? Don't you think to choose all courses and click button once, get a result page of selected coursees is a better way?
No, this is not for Students this is for Management. So, on the registration of New Student . it matters that how much subject student want to study. So, many Students will study Phsyics many will Study Chemistry Many will study both of them thats why.
MahadPK
Participant
778 Points
225 Posts
Auto DropDownList Generate.
Apr 26, 2012 04:27 PM|LINK
Hello, Guys Good Day,
I m Stuck in a Prob.
My Scenario is : I want to Assign a Multiple Courses to the Student
I have made every thing and Multiple Courses Assigned by Checkboxes but I dont want it now..
I want To make form like When User will click +ADD_Button a DropDownList will Appear and User will select 'Course' Then AutoPostBack and Label1.Text will show the Course.Then User Will again Click +ADD_Button and 2nd DropDownlist will Appear and User will Again Select '2nd Course' Then Label2.text will pick this SelectedItem.Text. So, N and So fourth.. +ADD_button ......................
+ADD_Button -- DropDownList -- Label1.Text
And i also want These label1.Text, Label2.Text and LabelN.Text (as much user click +ADD_Button So, NumberofTimes +ADD_Button clicked. that much LabelN.Text) i want to store these on Database I can Connect it But Im confused about this issue So, far i connected The Hard Coded Text but this will be Dynamic and As much User clicks +ADD_BUTTON I will have to connect to the Database.
Please Help me on this issue i will be very thankfull to you...
tarunSaini
Contributor
2948 Points
985 Posts
Re: Auto DropDownList Generate.
Apr 26, 2012 04:34 PM|LINK
dynamically add dropdownlist in placeholder from button click event
check this
http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.dropdownlist.dropdownlist.aspx
slimbunny
Member
472 Points
559 Posts
Re: Auto DropDownList Generate.
Apr 26, 2012 04:47 PM|LINK
Sounds like you got a lot going on, so let's do one task at a time to get the final product. I am not clear if you have a database connection or not please confirm.
From what I read you will need the following controls: please confirm?
1. Eliminating checkboxes
2. add button
3. Panel Control that shows dropdownList add (You can turn panels on and off by using the visible=true/false)
4. Link button for adding courses
5. Label showing selected courses
6. To capture the number of times a user clicked a control on your pages, you might want to record the user's username, pageName, ControlName, DateTime, login session and store infor in database table.
Question: What do you need a second drop down list for the second set of courses. Are the courses all coming from the same database table or is there two different database tables?
Connection String: You could do a search on this there is plenty out on the web about connection strings to database...
Identity the connection string required and pass the connection string to the datacontext constructor
dim connString as string = "Data Source=(local);Initial Catalog=TestDB;Integrated Security=True";
dim TestDC = new MyDataContext(connString);
MahadPK
Participant
778 Points
225 Posts
Re: Auto DropDownList Generate.
Apr 26, 2012 04:54 PM|LINK
I want to Bind the Dynamically added DropDownLists to the 1 Table of Courses there will be Courses which are avaible, and i Can Store the Data to the Database by Insert and executenonquery(); but im confused about this AutoGenerate +ADD_Button click etc.
Im confused about your reply Please help me on this issue and you gave me a different thing..
FightAsABull
Contributor
2228 Points
424 Posts
Re: Auto DropDownList Generate.
Apr 27, 2012 09:36 AM|LINK
Hi, why would you like to show the same table again and agian and again by posting back? The students need to click tons of time to select courses, would you think this will make the students happy? More, every postback, the page will run full page lifecycle, this will heavy your server work, why you want this? Don't you think to choose all courses and click button once, get a result page of selected coursees is a better way?
MahadPK
Participant
778 Points
225 Posts
Re: Auto DropDownList Generate.
Apr 27, 2012 09:45 AM|LINK
No, this is not for Students this is for Management. So, on the registration of New Student . it matters that how much subject student want to study. So, many Students will study Phsyics many will Study Chemistry Many will study both of them thats why.
FightAsABull
Contributor
2228 Points
424 Posts
Re: Auto DropDownList Generate.
Apr 27, 2012 09:54 AM|LINK
No matter how many they would like to study, it is better to choose all at once, this will also unload the heavy work of server.