Code Behind Page Page /Resources/Article.aspx.cs (C#)
Used by Page /Resources/Article.aspx (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 _Article : QuiznetOnline.Web.UI.BusinessClasses.BasePage  
13:     {  
14:         protected override void Page_Load(object sender, EventArgs e)  
15:         {  
16:             if (!Page.IsPostBack)  
17:             {  
18:                 base.Page_Load(sender, e);  
19:   
20:                 Topic topic=new Topic();  
21:                 lstTopics.DataSource = Topic.LoadTopics(null, false, new SqlWrapper());  
22:                 lstTopics.DataTextField = "TopicDesc";  
23:                 lstTopics.DataValueField = "TopicCode";  
24:                 lstTopics.DataBind();  
25:   
26:                 lstTopics.Items.Insert(0, new ListItem("Select a Topic",""));  
27:             }  
28:         }  
29:   
30:   
31:         protected void lstTopics_SelectedIndexChanged(object sender, EventArgs e)  
32:         {  
33:             if (lstTopics.SelectedItem.Value != "")  
34:             {  
35:                 Article article = new Article();  
36:                 gridArticles.DataSource = article.Get(new Topic(lstTopics.SelectedItem.Value));  
37:                 gridArticles.DataBind();  
38:             }  
39:         }  
40:     }  
41: }

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