private void SendToEmail(object sender, EventArgs e) { HtmlButton button = (HtmlButton)sender; string QuizID = Server.UrlEncode(MD5EncryptionHelper.Encrypt(SecurityClass.DecryptString(button.Attributes["quizid"], "QuizID"))); string QuizTableName = Server.UrlEncode(MD5EncryptionHelper.Encrypt(SecurityClass.DecryptString(button.Attributes["value"], "TableNamePhrase"))); string UserID = Server.UrlEncode(MD5EncryptionHelper.Encrypt(Session["UserID"].ToString())); string ResponseString = string.Format("TakeQuiz.aspx?QuizID={0}&QuizTableName={1}&UserID={2}", QuizID, QuizTableName, UserID); Response.Redirect(ResponseString); }
protected void InitializeQuizSetup() { var parameterTableName = Session["TableName"]; var parameterAction = Session["Action"]; var parameterQuizID = Session["QuizID"]; if (parameterAction != null && parameterTableName != null) { string decoded_parameterTableName = SecurityClass.DecryptString(parameterTableName.ToString(), "TableNamePhrase"); string decoded_action = SecurityClass.DecryptString(parameterAction.ToString(), "ActionPhrase"); tableName = decoded_parameterTableName; action = decoded_action; if (decoded_action == "Create") { ChooseAction(decoded_action, decoded_parameterTableName); } else if ((decoded_action == "Edit" || decoded_action == "Delete") && parameterQuizID != null) { quizid = SecurityClass.DecryptString(parameterQuizID.ToString(), "QuizID"); ChooseAction(decoded_action, decoded_parameterTableName); } else { testLabel.Text = "Error, Select a table"; tableName = ""; action = ""; Response.Redirect("Dashboard.aspx"); } } else { testLabel.Text = "Error, Select a table"; tableName = ""; action = ""; Response.Redirect("Dashboard.aspx"); //Set Error Message and redirect to the dashboard.aspx page. } }