Code Behind Page Page /Master/MasterPage.master.cs (C#)
Used by Page /Master/MasterPage.master (C#)
1: using System;  
2: using System.Configuration;  
3: using System.Web;  
4: using System.Web.Security;  
5: using System.Web.UI;  
6: using System.Web.UI.WebControls;  
7: using System.Reflection;  
8: using Microsoft.ApplicationBlocks.Data;  
9: using QuizNetOnline.Logic;  
10: using System.Collections.Generic;  
11: using QuiznetOnline.Web.UI.BusinessClasses;  
12:   
13: namespace QuiznetOnline.Web.UI.Master  
14: {  
15:     public partial class QuiznetonlineMaster : MasterPage  
16:     {  
17:         bool isMobileDevice = false;  
18:         protected LiteralControl _MessageLiteralControl;  
19:   
20:         public bool IspanelResumeVisible  
21:         {  
22:             set { panelResume.Visible = value; }  
23:             get { return panelResume.Visible; }  
24:         }  
25:   
26:         public Image imgCloseButton  
27:         {  
28:             get { return close_message; }  
29:         }  
30:   
31:         public int isAdminMessageBeenClosed  
32:         {  
33:             get { return Convert.ToInt32(hiddenIsAdminMessageBeenClosed.Value); }  
34:         }  
35:   
36:           
37:   
38:         public bool CanUserAccessFavourites { get; set; }  
39:   
40:         protected void Page_Load(object sender, EventArgs e)  
41:         {  
42:             //Check to see if the client is a mobile device  
43:             //if so then allow the menu to be clicked as opposed to hower over  
44:             string strUserAgent = Request.UserAgent.ToString().ToLower();  
45:             if (strUserAgent != null)  
46:             {  
47:                 if (Request.Browser.IsMobileDevice == true ||  
48:                     strUserAgent.Contains("iphone") ||  
49:                     strUserAgent.Contains("blackberry") ||  
50:                     strUserAgent.Contains("mobile") ||  
51:                     strUserAgent.Contains("windows ce") ||  
52:                     strUserAgent.Contains("opera mini") ||  
53:                     strUserAgent.Contains("palm"))  
54:                 {  
55:                     isMobileDevice = true;  
56:                     Page.ClientScript.RegisterStartupScript(Page.GetType(), "addClickBehavior", "addClickBehavior(document.getElementById('" + MainMenu.ClientID + "'));", true);  
57:                 }  
58:             }  
59:               
60:             if (Request.UserAgent != null)  
61:                 if (Request.UserAgent.IndexOf("AppleWebKit") > 0)  
62:                 {  
63:                     Request.Browser.Adapters.Clear();  
64:                 }  
65:   
66:             Assembly asm=Assembly.GetExecutingAssembly();  
67:   
68:             if (Request.UserAgent != null)  
69:                 if (Request.UserAgent.IndexOf("AppleWebKit") > 0)  
70:                 {  
71:                     Request.Browser.Adapters.Clear();  
72:                 }  
73:   
74:             //Take care of the flag whether to display the Admin message agaim  
75:             if (hiddenIsAdminMessageBeenClosed.Value == "1")  
76:             {  
77:                 Session["isAdminMessageBeenClosed"] = hiddenIsAdminMessageBeenClosed.Value;  
78:             }  
79:             if (Session["isAdminMessageBeenClosed"] != null)  
80:             {  
81:                 hiddenIsAdminMessageBeenClosed.Value = Session["isAdminMessageBeenClosed"].ToString();  
82:             }  
83:   
84:             if (!Page.IsPostBack)  
85:             {  
86:   
87:   
88:                 hiddenUserCountryName.Value = ((UserWeb)Session["userWeb"]).UserLocation.CountryName;  
89:                 //LoadAdminMessage(close_message, true, Convert.ToInt32(hiddenIsAdminMessageBeenClosed.Value));  
90:                 if (!Convert.ToBoolean(ConfigurationManager.AppSettings["ShowGoogleAds"]) || isMobileDevice==true)  
91:                 {  
92:                     googleAds1.Visible = false;  
93:                     googleAds2.Visible = false;  
94:                     googleAds3.Visible = false;  
95:                 }  
96:                 if (Convert.ToBoolean(ConfigurationManager.AppSettings["ShowFacebookLike"]))  
97:                 {  
98:                     panelFacebookLike.Visible = true;  
99:                 }  
100:                 else  
101:                 {  
102:                     panelFacebookLike.Visible = false;  
103:                 }  
104:                   
105:   
106:                 EnableDisableLoginFields(((UserWeb)Session["userWeb"]).UserName);  
107:                 ShowHideFavoriteMenu();  
108:                 lblVersion.Text = "Ver. " + asm.GetName().Version;  
109:             }  
110:         }  
111:   
112:         public bool IsLive()  
113:         {  
114:             if (Request.Url.ToString().ToUpper().IndexOf("LOCALHOST") >= 0 || Request.Url.ToString().ToUpper().IndexOf(HttpContext.Current.Request.ServerVariables["SERVER_NAME"].ToString()) >= 0)  
115:                 return false;  
116:             return true;  
117:         }  
118:   
119:         private void ShowHideFavoriteMenu()  
120:         {  
121:             CanUserAccessFavourites = true;  
122:             string userName = ((UserWeb)Session["userWeb"]).UserName;  
123:             UserFavourite userFavourite = new UserFavourite();  
124:             ISqlWrapper iSqlWrapper = new SqlWrapper();  
125:             if ((userName != "guest@quiznetonline.com") && (!string.IsNullOrEmpty(userName)))  
126:             {  
127:                 MenuItem menuItems = MainMenu.FindItem("Tools");  
128:                 AddMenuItems(userName, menuItems,userFavourite.HasUserFavourites(userName, iSqlWrapper));  
129:             }  
130:             else  
131:             {  
132:                 CanUserAccessFavourites = false;  
133:             }  
134:         }  
135:   
136:         public void AddMenuItems(string userName, MenuItem menuItems, int hasUserFavourites)  
137:         {  
138:             //FormOperation.GetQuestionListFromCache(true,"favTrue",null,"fav",userName,  
139:   
140:   
141:             MenuItem menuItem = new MenuItem("Answer my own quiz", "ANSWERQUIZ", "", "~/PracticeTest.aspx?Group=fav");  
142:             if (hasUserFavourites == 0)  
143:             {  
144:                 menuItem.Enabled = false;  
145:             }  
146:             menuItems.ChildItems.Add(menuItem);  
147:   
148:   
149:             menuItems.ChildItems.Add(new MenuItem("Maintain my own quiz","MAINTAINQUIZ","","~/UserTestMaintenance.aspx"));  
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
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
196: There is a limit of 150 source code lines in the evaluation version
197: There is a limit of 150 source code lines in the evaluation version
198: There is a limit of 150 source code lines in the evaluation version
199: There is a limit of 150 source code lines in the evaluation version
200: There is a limit of 150 source code lines in the evaluation version
201: There is a limit of 150 source code lines in the evaluation version
202: There is a limit of 150 source code lines in the evaluation version
203: There is a limit of 150 source code lines in the evaluation version
204: There is a limit of 150 source code lines in the evaluation version
205: There is a limit of 150 source code lines in the evaluation version
206: There is a limit of 150 source code lines in the evaluation version
207: There is a limit of 150 source code lines in the evaluation version
208: There is a limit of 150 source code lines in the evaluation version
209: There is a limit of 150 source code lines in the evaluation version
210: There is a limit of 150 source code lines in the evaluation version
211: There is a limit of 150 source code lines in the evaluation version
212: There is a limit of 150 source code lines in the evaluation version
213: There is a limit of 150 source code lines in the evaluation version
214: There is a limit of 150 source code lines in the evaluation version
215: There is a limit of 150 source code lines in the evaluation version
216: There is a limit of 150 source code lines in the evaluation version
217: There is a limit of 150 source code lines in the evaluation version
218: There is a limit of 150 source code lines in the evaluation version
219: There is a limit of 150 source code lines in the evaluation version
220: There is a limit of 150 source code lines in the evaluation version
221: There is a limit of 150 source code lines in the evaluation version
222: There is a limit of 150 source code lines in the evaluation version
223: There is a limit of 150 source code lines in the evaluation version
224: There is a limit of 150 source code lines in the evaluation version
225: There is a limit of 150 source code lines in the evaluation version
226: There is a limit of 150 source code lines in the evaluation version
227: There is a limit of 150 source code lines in the evaluation version
228: There is a limit of 150 source code lines in the evaluation version
229: There is a limit of 150 source code lines in the evaluation version
230: There is a limit of 150 source code lines in the evaluation version
231: There is a limit of 150 source code lines in the evaluation version
232: There is a limit of 150 source code lines in the evaluation version
233: There is a limit of 150 source code lines in the evaluation version
234: There is a limit of 150 source code lines in the evaluation version
235: There is a limit of 150 source code lines in the evaluation version
236: There is a limit of 150 source code lines in the evaluation version
237: There is a limit of 150 source code lines in the evaluation version
238: There is a limit of 150 source code lines in the evaluation version
239: There is a limit of 150 source code lines in the evaluation version
240: There is a limit of 150 source code lines in the evaluation version
241: There is a limit of 150 source code lines in the evaluation version
242: There is a limit of 150 source code lines in the evaluation version
243: There is a limit of 150 source code lines in the evaluation version
244: There is a limit of 150 source code lines in the evaluation version
245: There is a limit of 150 source code lines in the evaluation version
246: There is a limit of 150 source code lines in the evaluation version
247: There is a limit of 150 source code lines in the evaluation version
248: There is a limit of 150 source code lines in the evaluation version
249: There is a limit of 150 source code lines in the evaluation version
250: There is a limit of 150 source code lines in the evaluation version
251: There is a limit of 150 source code lines in the evaluation version
252: There is a limit of 150 source code lines in the evaluation version
253: There is a limit of 150 source code lines in the evaluation version
254: There is a limit of 150 source code lines in the evaluation version
255: There is a limit of 150 source code lines in the evaluation version
256: There is a limit of 150 source code lines in the evaluation version
257: There is a limit of 150 source code lines in the evaluation version
258: There is a limit of 150 source code lines in the evaluation version
259: There is a limit of 150 source code lines in the evaluation version
260: There is a limit of 150 source code lines in the evaluation version
261: There is a limit of 150 source code lines in the evaluation version
262: There is a limit of 150 source code lines in the evaluation version
263: There is a limit of 150 source code lines in the evaluation version
264: There is a limit of 150 source code lines in the evaluation version
265: There is a limit of 150 source code lines in the evaluation version
266: There is a limit of 150 source code lines in the evaluation version
267: There is a limit of 150 source code lines in the evaluation version
268: There is a limit of 150 source code lines in the evaluation version
269: There is a limit of 150 source code lines in the evaluation version
270: There is a limit of 150 source code lines in the evaluation version
271: There is a limit of 150 source code lines in the evaluation version
272: There is a limit of 150 source code lines in the evaluation version
273: There is a limit of 150 source code lines in the evaluation version
274: There is a limit of 150 source code lines in the evaluation version
275: There is a limit of 150 source code lines in the evaluation version
276: There is a limit of 150 source code lines in the evaluation version
277: There is a limit of 150 source code lines in the evaluation version
278: There is a limit of 150 source code lines in the evaluation version
279: There is a limit of 150 source code lines in the evaluation version
280: There is a limit of 150 source code lines in the evaluation version
281: There is a limit of 150 source code lines in the evaluation version
282: There is a limit of 150 source code lines in the evaluation version
283: There is a limit of 150 source code lines in the evaluation version
284: There is a limit of 150 source code lines in the evaluation version
285: There is a limit of 150 source code lines in the evaluation version
286: There is a limit of 150 source code lines in the evaluation version
287: There is a limit of 150 source code lines in the evaluation version
288: There is a limit of 150 source code lines in the evaluation version
289: There is a limit of 150 source code lines in the evaluation version
290: There is a limit of 150 source code lines in the evaluation version
291: There is a limit of 150 source code lines in the evaluation version
292: There is a limit of 150 source code lines in the evaluation version
293: There is a limit of 150 source code lines in the evaluation version
294: There is a limit of 150 source code lines in the evaluation version
295: There is a limit of 150 source code lines in the evaluation version
296: There is a limit of 150 source code lines in the evaluation version
297: There is a limit of 150 source code lines in the evaluation version
298: There is a limit of 150 source code lines in the evaluation version
299: There is a limit of 150 source code lines in the evaluation version
300: There is a limit of 150 source code lines in the evaluation version
301: There is a limit of 150 source code lines in the evaluation version
302: There is a limit of 150 source code lines in the evaluation version
303: There is a limit of 150 source code lines in the evaluation version
304: There is a limit of 150 source code lines in the evaluation version
305: There is a limit of 150 source code lines in the evaluation version
306: There is a limit of 150 source code lines in the evaluation version
307: There is a limit of 150 source code lines in the evaluation version
308: There is a limit of 150 source code lines in the evaluation version
309: There is a limit of 150 source code lines in the evaluation version
310: There is a limit of 150 source code lines in the evaluation version
311: There is a limit of 150 source code lines in the evaluation version
312: There is a limit of 150 source code lines in the evaluation version
313: There is a limit of 150 source code lines in the evaluation version
314: There is a limit of 150 source code lines in the evaluation version
315: There is a limit of 150 source code lines in the evaluation version
316: There is a limit of 150 source code lines in the evaluation version
317: There is a limit of 150 source code lines in the evaluation version
318: There is a limit of 150 source code lines in the evaluation version
319: There is a limit of 150 source code lines in the evaluation version
320: There is a limit of 150 source code lines in the evaluation version
321: There is a limit of 150 source code lines in the evaluation version
322: There is a limit of 150 source code lines in the evaluation version
323: There is a limit of 150 source code lines in the evaluation version
324: There is a limit of 150 source code lines in the evaluation version
325: There is a limit of 150 source code lines in the evaluation version
326: There is a limit of 150 source code lines in the evaluation version
327: There is a limit of 150 source code lines in the evaluation version
328: There is a limit of 150 source code lines in the evaluation version
329: There is a limit of 150 source code lines in the evaluation version
330: There is a limit of 150 source code lines in the evaluation version
331: There is a limit of 150 source code lines in the evaluation version
332: There is a limit of 150 source code lines in the evaluation version
333: There is a limit of 150 source code lines in the evaluation version
334: There is a limit of 150 source code lines in the evaluation version
335: There is a limit of 150 source code lines in the evaluation version
336: There is a limit of 150 source code lines in the evaluation version
337: There is a limit of 150 source code lines in the evaluation version
338: There is a limit of 150 source code lines in the evaluation version
339: There is a limit of 150 source code lines in the evaluation version
340: There is a limit of 150 source code lines in the evaluation version
341: There is a limit of 150 source code lines in the evaluation version
342: There is a limit of 150 source code lines in the evaluation version
343: There is a limit of 150 source code lines in the evaluation version
344: There is a limit of 150 source code lines in the evaluation version
345: There is a limit of 150 source code lines in the evaluation version
346: There is a limit of 150 source code lines in the evaluation version
347: There is a limit of 150 source code lines in the evaluation version
348: There is a limit of 150 source code lines in the evaluation version
349: There is a limit of 150 source code lines in the evaluation version
350: There is a limit of 150 source code lines in the evaluation version
351: There is a limit of 150 source code lines in the evaluation version
352: There is a limit of 150 source code lines in the evaluation version
353: There is a limit of 150 source code lines in the evaluation version
354: There is a limit of 150 source code lines in the evaluation version
355: There is a limit of 150 source code lines in the evaluation version
356: There is a limit of 150 source code lines in the evaluation version
357: There is a limit of 150 source code lines in the evaluation version
358: There is a limit of 150 source code lines in the evaluation version
359: There is a limit of 150 source code lines in the evaluation version
360: There is a limit of 150 source code lines in the evaluation version
361: There is a limit of 150 source code lines in the evaluation version

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