Code Behind Page Page /Resources/VirtualLab.aspx.cs (C#)
Used by Page /Resources/VirtualLab.aspx (C#)
1: using System;  
2: using System.Collections.Generic;  
3: using System.Linq;  
4: using System.Web;  
5: using System.Web.UI;  
6: using System.Web.UI.WebControls;  
7: using QuizNetOnline.Logic;  
8: using Microsoft.ApplicationBlocks.Data;  
9:   
10: namespace QuiznetOnline.Web.UI  
11: {  
12:     public partial class _VirtualLab : QuiznetOnline.Web.UI.BusinessClasses.BasePage  
13:     {  
14:         Log log = new Log();  
15:   
16:         protected override void Page_Load(object sender, EventArgs e)  
17:         {  
18:             if (!Page.IsPostBack)  
19:             {  
20:                 base.Page_Load(sender, e);  
21:   
22:                 SetupCSharpVirtualLabs();  
23:                 SetupAspNetVirtualLabs();  
24:                 SetupNetFrameworkVirtualLabs();  
25:                 SetupSqlVirtualLabs();  
26:             }  
27:   
28:             BindTooltip(cmbcsharplist);  
29:             BindTooltip(cmbaspnetlist);  
30:             BindTooltip(cmbnetframeworklist);  
31:             BindTooltip(cmbsqllist);  
32:         }  
33:   
34:         private void SetupCSharpVirtualLabs()  
35:         {  
36:             VirtualLab VirtualLab = new VirtualLab();  
37:   
38:             cmbcsharplist.DataValueField = "VirtualLabURL";  
39:             cmbcsharplist.DataTextField = "VirtualLabDesc";  
40:   
41:             List<VirtualLab> VirtualLabs = new List<VirtualLab>();  
42:             VirtualLabs = VirtualLab.Get(new Topic("csharp"));  
43:   
44:             if (VirtualLabs.Count > 0)  
45:             {  
46:                 cmbcsharplist.Enabled = true;  
47:                 cmbcsharplist.DataSource = VirtualLabs;  
48:                 cmbcsharplist.DataBind();  
49:                 cmbcsharplist.Items.Insert(0, new ListItem("Select a VirtualLab", "0"));  
50:             }  
51:             else  
52:             {  
53:                 cmbcsharplist.Items.Insert(0, new ListItem("No VirtualLabs at present", "0"));  
54:                 cmbcsharplist.Enabled = false;  
55:             }  
56:         }  
57:   
58:         private void SetupAspNetVirtualLabs()  
59:         {  
60:             VirtualLab VirtualLab = new VirtualLab();  
61:   
62:             cmbaspnetlist.DataValueField = "VirtualLabURL";  
63:             cmbaspnetlist.DataTextField = "VirtualLabDesc";  
64:   
65:             List<VirtualLab> VirtualLabs = new List<VirtualLab>();  
66:             VirtualLabs = VirtualLab.Get(new Topic("aspnet"));  
67:   
68:             if (VirtualLabs.Count > 0)  
69:             {  
70:                 cmbaspnetlist.Enabled = true;  
71:                 cmbaspnetlist.DataSource = VirtualLabs;  
72:                 cmbaspnetlist.DataBind();  
73:                 cmbaspnetlist.Items.Insert(0, new ListItem("Select a VirtualLab", "0"));  
74:             }  
75:             else  
76:             {  
77:                 cmbaspnetlist.Items.Insert(0, new ListItem("No VirtualLabs at present", "0"));  
78:                 cmbaspnetlist.Enabled = false;  
79:             }  
80:         }  
81:   
82:         private void SetupNetFrameworkVirtualLabs()  
83:         {  
84:             VirtualLab VirtualLab = new VirtualLab();  
85:   
86:             cmbnetframeworklist.DataValueField = "VirtualLabURL";  
87:             cmbnetframeworklist.DataTextField = "VirtualLabDesc";  
88:   
89:             List<VirtualLab> VirtualLabs = new List<VirtualLab>();  
90:             VirtualLabs = VirtualLab.Get(new Topic("netframework"));  
91:   
92:             if (VirtualLabs.Count > 0)  
93:             {  
94:                 cmbnetframeworklist.Enabled = true;  
95:                 cmbnetframeworklist.DataSource = VirtualLabs;  
96:                 cmbnetframeworklist.DataBind();  
97:                 cmbnetframeworklist.Items.Insert(0, new ListItem("Select a VirtualLab", "0"));  
98:             }  
99:             else  
100:             {  
101:                 cmbnetframeworklist.Items.Insert(0, new ListItem("No VirtualLabs at present", "0"));  
102:                 cmbnetframeworklist.Enabled = false;  
103:             }  
104:         }  
105:   
106:         private void SetupSqlVirtualLabs()  
107:         {  
108:             VirtualLab VirtualLab = new VirtualLab();  
109:   
110:             cmbsqllist.DataValueField = "VirtualLabURL";  
111:             cmbsqllist.DataTextField = "VirtualLabDesc";  
112:   
113:             List<VirtualLab> VirtualLabs = new List<VirtualLab>();  
114:             VirtualLabs = VirtualLab.Get(new Topic("sql"));  
115:   
116:             if (VirtualLabs.Count > 0)  
117:             {  
118:                 cmbsqllist.Enabled = true;  
119:                 cmbsqllist.DataSource = VirtualLabs;  
120:                 cmbsqllist.DataBind();  
121:                 cmbsqllist.Items.Insert(0, new ListItem("Select a VirtualLab", "0"));  
122:             }  
123:             else  
124:             {  
125:                 cmbsqllist.Items.Insert(0, new ListItem("No VirtualLabs at present", "0"));  
126:                 cmbsqllist.Enabled = false;  
127:             }  
128:         }  
129:   
130:         public void BindTooltip(ListControl lc)  
131:         {  
132:             for (int i = 0; i < lc.Items.Count; i++)  
133:             {  
134:                 lc.Items[i].Attributes.Add("title", lc.Items[i].Text);  
135:             }  
136:         }  
137:   
138:   
139:         protected void cmbcsharplist_SelectedIndexChanged(object sender, EventArgs e)  
140:         {  
141:             if (cmbcsharplist.SelectedItem.Value != "0")  
142:             {  
143:                 log.LogArea="csharp VirtualLab - " + cmbcsharplist.SelectedItem.Text;  
144:                 log.UserWeb = (UserWeb)Session["userWeb"];  
145:                 log.Save(new SqlWrapper());  
146:                 // Set the iframe's src attribute.  
147:                 VirtualLabViewer.Attributes["src"] = cmbcsharplist.SelectedItem.Value;  
148:             }  
149:         }  
150:   
151: There is a limit of 150 source code lines in the evaluation version
152: There is a limit of 150 source code lines in the evaluation version
153: There is a limit of 150 source code lines in the evaluation version
154: There is a limit of 150 source code lines in the evaluation version
155: There is a limit of 150 source code lines in the evaluation version
156: There is a limit of 150 source code lines in the evaluation version
157: There is a limit of 150 source code lines in the evaluation version
158: There is a limit of 150 source code lines in the evaluation version
159: There is a limit of 150 source code lines in the evaluation version
160: There is a limit of 150 source code lines in the evaluation version
161: There is a limit of 150 source code lines in the evaluation version
162: There is a limit of 150 source code lines in the evaluation version
163: There is a limit of 150 source code lines in the evaluation version
164: There is a limit of 150 source code lines in the evaluation version
165: There is a limit of 150 source code lines in the evaluation version
166: There is a limit of 150 source code lines in the evaluation version
167: There is a limit of 150 source code lines in the evaluation version
168: There is a limit of 150 source code lines in the evaluation version
169: There is a limit of 150 source code lines in the evaluation version
170: There is a limit of 150 source code lines in the evaluation version
171: There is a limit of 150 source code lines in the evaluation version
172: There is a limit of 150 source code lines in the evaluation version
173: There is a limit of 150 source code lines in the evaluation version
174: There is a limit of 150 source code lines in the evaluation version
175: There is a limit of 150 source code lines in the evaluation version
176: There is a limit of 150 source code lines in the evaluation version
177: There is a limit of 150 source code lines in the evaluation version
178: There is a limit of 150 source code lines in the evaluation version
179: There is a limit of 150 source code lines in the evaluation version
180: There is a limit of 150 source code lines in the evaluation version
181: There is a limit of 150 source code lines in the evaluation version
182: There is a limit of 150 source code lines in the evaluation version
183: There is a limit of 150 source code lines in the evaluation version
184: There is a limit of 150 source code lines in the evaluation version
185: There is a limit of 150 source code lines in the evaluation version
186: There is a limit of 150 source code lines in the evaluation version
187: There is a limit of 150 source code lines in the evaluation version

.NET Documentation Tool is © 2002 - 2009 Winnersh Triangle Web Solutions Limited.