ASP.NET Page /Resources/Video.aspx.cs (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 _Video : QuiznetOnline.Web.UI.BusinessClasses.BasePage  
13:     {  
14:         Log log = new Log();  
15:   
16:         // player width  
17:         private int _W = 640;  
18:   
19:         // player height  
20:         private int _H = 505;  
21:   
22:         // autoplay disabled  
23:         bool auto = false;  
24:   
25:         protected override void Page_Load(object sender, EventArgs e)  
26:         {  
27:             if (!Page.IsPostBack)  
28:             {  
29:                 base.Page_Load(sender, e);  
30:   
31:                 SetupCSharpVideos();  
32:                 SetupAspNetVideos();  
33:                 SetupNetFrameworkVideos();  
34:                 SetupSqlVideos();  
35:             }  
36:   
37:             BindTooltip(cmbcsharplist);  
38:             BindTooltip(cmbaspnetlist);  
39:             BindTooltip(cmbnetframeworklist);  
40:             BindTooltip(cmbsqllist);  
41:         }  
42:   
43:         private void SetupCSharpVideos()  
44:         {  
45:             Video video = new Video();  
46:   
47:             cmbcsharplist.DataValueField = "VideoCode";  
48:             cmbcsharplist.DataTextField = "VideoDesc";  
49:   
50:             List<Video> videos = new List<Video>();  
51:             videos = video.Get(new Topic("csharp"));  
52:   
53:             if (videos.Count > 0)  
54:             {  
55:                 cmbcsharplist.Enabled = true;  
56:                 cmbcsharplist.DataSource = videos;  
57:                 cmbcsharplist.DataBind();  
58:                 cmbcsharplist.Items.Insert(0, new ListItem("Select a video", "0"));  
59:             }  
60:             else  
61:             {  
62:                 cmbcsharplist.Items.Insert(0, new ListItem("No videos at present", "0"));  
63:                 cmbcsharplist.Enabled = false;  
64:             }  
65:         }  
66:   
67:         private void SetupAspNetVideos()  
68:         {  
69:             Video video = new Video();  
70:   
71:             cmbaspnetlist.DataValueField = "VideoCode";  
72:             cmbaspnetlist.DataTextField = "VideoDesc";  
73:   
74:             List<Video> videos = new List<Video>();  
75:             videos = video.Get(new Topic("aspnet"));  
76:   
77:             if (videos.Count > 0)  
78:             {  
79:                 cmbaspnetlist.Enabled = true;  
80:                 cmbaspnetlist.DataSource = videos;  
81:                 cmbaspnetlist.DataBind();  
82:                 cmbaspnetlist.Items.Insert(0, new ListItem("Select a video", "0"));  
83:             }  
84:             else  
85:             {  
86:                 cmbaspnetlist.Items.Insert(0, new ListItem("No videos at present", "0"));  
87:                 cmbaspnetlist.Enabled = false;  
88:             }  
89:         }  
90:   
91:         private void SetupNetFrameworkVideos()  
92:         {  
93:             Video video = new Video();  
94:   
95:             cmbnetframeworklist.DataValueField = "VideoCode";  
96:             cmbnetframeworklist.DataTextField = "VideoDesc";  
97:   
98:             List<Video> videos = new List<Video>();  
99:             videos = video.Get(new Topic("netframework"));  
100:   
101:             if (videos.Count > 0)  
102:             {  
103:                 cmbnetframeworklist.Enabled = true;  
104:                 cmbnetframeworklist.DataSource = videos;  
105:                 cmbnetframeworklist.DataBind();  
106:                 cmbnetframeworklist.Items.Insert(0, new ListItem("Select a video", "0"));  
107:             }  
108:             else  
109:             {  
110:                 cmbnetframeworklist.Items.Insert(0, new ListItem("No videos at present", "0"));  
111:                 cmbnetframeworklist.Enabled = false;  
112:             }  
113:         }  
114:   
115:         private void SetupSqlVideos()  
116:         {  
117:             Video video = new Video();  
118:   
119:             cmbsqllist.DataValueField = "VideoCode";  
120:             cmbsqllist.DataTextField = "VideoDesc";  
121:   
122:             List<Video> videos = new List<Video>();  
123:             videos = video.Get(new Topic("sql"));  
124:   
125:             if (videos.Count > 0)  
126:             {  
127:                 cmbsqllist.Enabled = true;  
128:                 cmbsqllist.DataSource = videos;  
129:                 cmbsqllist.DataBind();  
130:                 cmbsqllist.Items.Insert(0, new ListItem("Select a video", "0"));  
131:             }  
132:             else  
133:             {  
134:                 cmbsqllist.Items.Insert(0, new ListItem("No videos at present", "0"));  
135:                 cmbsqllist.Enabled = false;  
136:             }  
137:         }  
138:   
139:         public void BindTooltip(ListControl lc)  
140:         {  
141:             for (int i = 0; i < lc.Items.Count; i++)  
142:             {  
143:                 lc.Items[i].Attributes.Add("title", lc.Items[i].Text);  
144:             }  
145:         }  
146:   
147:   
148:         protected void cmbcsharplist_SelectedIndexChanged(object sender, EventArgs e)  
149:         {  
150:             if (cmbcsharplist.SelectedItem.Value != "0")  
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
188: There is a limit of 150 source code lines in the evaluation version
189: There is a limit of 150 source code lines in the evaluation version
190: There is a limit of 150 source code lines in the evaluation version
191: There is a limit of 150 source code lines in the evaluation version
192: There is a limit of 150 source code lines in the evaluation version
193: There is a limit of 150 source code lines in the evaluation version
194: There is a limit of 150 source code lines in the evaluation version
195: There is a limit of 150 source code lines in the evaluation version

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