Code Behind Page Page /Admin/UserQuestionRating.aspx.cs (C#)
Used by Page /Admin/UserQuestionRating.aspx (C#)
1: using System;  
2: using System.Data;  
3: using System.Configuration;  
4: using System.Collections;  
5: using System.Web;  
6: using System.Web.Security;  
7: using System.Web.UI;  
8: using System.Web.UI.WebControls;  
9: using System.Web.UI.WebControls.WebParts;  
10: using System.Web.UI.HtmlControls;  
11: using System.Data.SqlClient;  
12: using QuiznetOnline.Data;  
13: using QuizNetOnline.Logic;  
14:   
15: public partial class UserQuestionRating : System.Web.UI.Page  
16: {  
17:     protected void Page_Load(object sender, EventArgs e)  
18:     {  
19:         DataFunctions dataFunctions = DataFunctions.GetInstance();  
20:         SqlDataSource1.ConnectionString = dataFunctions.GetConnectionString();  
21:         if (Session["Validated"] == null || (bool)Session["Validated"] == false)  
22:             Response.Redirect("Default.aspx");  
23:   
24:         //this.SqlDataSource1.ConnectionString = ConnectionObj.GetConnection().ConnectionString;  
25:   
26:     }  
27:   
28:     public void GridView1_RowCommand(Object sender, GridViewCommandEventArgs e)  
29:     {  
30:         if (e.CommandName == "DeleteUserQuestionRating")  
31:         {  
32:             int index = Convert.ToInt32(e.CommandArgument);  
33:             int QuestionID = Convert.ToInt32(GridView1.Rows[index].Cells[1].Text);  
34:   
35:             UserQuestion userQuestion = new UserQuestion();  
36:             userQuestion.UserQuestionId = QuestionID;  
37:             userQuestion.DeleteUserQuestionRating();  
38:   
39:             GridView1.DataBind();  
40:         }  
41:     }  
42: }  

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