Code Behind Page Page /UserLogin/CreateUser.aspx.cs (C#)
Used by Page /UserLogin/CreateUser.aspx (C#)
1: using System;  
2: using System.Configuration;  
3: using System.Web;  
4: using System.Web.Security;  
5: using System.Web.UI.WebControls;  
6: using System.Text;  
7: using Microsoft.ApplicationBlocks.Data;  
8: using QuizNetOnline.Logic;  
9:   
10: namespace QuiznetOnline.Web.UI.UserLogin  
11: {  
12:     struct ProfileDetails  
13:     {  
14:         static private string _NickName;  
15:         static public string NickName  
16:         {  
17:             set { _NickName = value; }  
18:             get { return _NickName; }  
19:         }  
20:         static private string _City;  
21:         static public string City  
22:         {  
23:             set { _City = value; }  
24:             get { return _City; }  
25:         }  
26:         static private string _State;  
27:         static public string State  
28:         {  
29:             set { _State = value; }  
30:             get { return _State; }  
31:         }  
32:         static private string _CountryCode;  
33:         static public string CountryCode  
34:         {  
35:             set { _CountryCode = value; }  
36:             get { return _CountryCode; }  
37:         }  
38:         static private bool _GetNewsletter;  
39:         static public bool GetNewsletter  
40:         {  
41:             set { _GetNewsletter = value; }  
42:             get { return _GetNewsletter; }  
43:         }  
44:     }  
45:   
46:     public partial class CreateUser : QuiznetOnline.Web.UI.BusinessClasses.BasePage  
47:     {  
48:         protected Controls_AddressInput UcAddressInput;  
49:   
50:         protected override void Page_Load(object sender, EventArgs e)  
51:         {  
52:             // Initialize the create user wizard on first load  
53:             if (!IsPostBack)  
54:             {  
55:                 base.Page_Load(sender, e);  
56:   
57:                 Master.ShowLogin(false);  
58:                 Master.ShowHideMenu(true);  
59:                 InitializeCreateUserWizard();  
60:   
61:                 Label lblFullAccess = (Label)CompleteWizardStep1.ContentTemplateContainer.FindControl("lblFullAccess");  
62:                 Button cmdNoFreeAccess = (Button)CompleteWizardStep1.ContentTemplateContainer.FindControl("cmdNoFreeAccess");  
63:   
64:                 if (Convert.ToInt32(ConfigurationManager.AppSettings["NumberOfFreeQuestions"]) != 0)  
65:                 {  
66:                     Question question = new Question();  
67:                     TableInformation tableInformation = new TableInformation();  
68:   
69:                     lblFullAccess.Text = string.Format("Would you like to get access to {0} questions as opposed to the restricted " + ConfigurationManager.AppSettings["NumberOfFreeQuestions"].ToString() + " questions by just submitting at least one .Net related question", question.GetTotalQuestionsCount(tableInformation));  
70:                 }  
71:             }  
72:   
73:             TextBox password = CreateUserWizardStep1.ContentTemplateContainer.FindControl("Password") as TextBox;  
74:             password.Attributes.Add("value", password.Text);  
75:             password = CreateUserWizardStep1.ContentTemplateContainer.FindControl("ConfirmPassword") as TextBox;  
76:             password.Attributes.Add("value", password.Text);  
77:   
78:         }  
79:   
80:         /// <summary>  
81:         /// Initializes the create user wizard  
82:         /// </summary>  
83:         protected void InitializeCreateUserWizard()  
84:         {  
85:             // If confirmation key is provided, process it  
86:             string keyConf = Request["conf"];  
87:             if (!string.IsNullOrEmpty(keyConf))  
88:             {  
89:                 ProcessRequestConfirmation(Server.UrlDecode(keyConf));  
90:             }  
91:   
92:             // If destination key is provided, initialize referral information  
93:             string keyDest = Request["dest"];  
94:             if (!string.IsNullOrEmpty(keyDest))  
95:             {  
96:                 InitializeDestinationUrl(Server.UrlDecode(keyDest));  
97:             }  
98:         }  
99:   
100:         /// <summary>  
101:         /// Initializes the destination url based on the destination key  
102:         /// </summary>  
103:         protected void InitializeDestinationUrl(string key)  
104:         {  
105:             // Don't do anything if key is not specified  
106:             if (!string.IsNullOrEmpty(key))  
107:             {  
108:                 // Get the decrypted confirmation value  
109:                 string dKey = Crypto.Decrypt(key, new Crypto());  
110:   
111:                 CreateNewUserWizard.ContinueDestinationPageUrl = dKey;  
112:             }  
113:         }  
114:   
115:         /// <summary>  
116:         /// Process request confirmation based on the confirmation key  
117:         /// </summary>  
118:         protected void ProcessRequestConfirmation(string key)  
119:         {  
120:             // Don't do anything if key is not specified  
121:             if (!string.IsNullOrEmpty(key))  
122:             {  
123:                 // Get the decrypted confirmation value  
124:                 string dKey = Crypto.Decrypt(key, new Crypto());  
125:   
126:                 // Set the email for the create new user wizard control  
127:                 CreateNewUserWizard.Email = dKey;  
128:   
129:   
130:                 // Skip to Create User step  
131:                 CreateNewUserWizard.ActiveStepIndex = 2;  
132:             }  
133:         }  
134:   
135:         /// <summary>  
136:         /// Generates and sends an email to confirm the request for a new user account  
137:         /// </summary>  
138:         /// <param name="toRecipients">Email TO: recipients</param>  
139:         protected void SendRequestConfirmationEmail()  
140:         {  
141:             string Body = "";  
142:             UriBuilder ub = new UriBuilder(Request.Url);  
143:             ub.Query = string.Empty;  
144:   
145:             // If the app settings contains a URI host name, override URI  
146:             string uriHostName = ConfigurationManager.AppSettings["uriHostName"];  
147:             if (!string.IsNullOrEmpty(uriHostName))  
148:             {  
149:                 ub.Host = uriHostName;  
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

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