domaindropdownlist.cs
来自「cnForums是功能强大的论坛。开发语言c#,三层结构。模块设计很值得学习」· CS 代码 · 共 59 行
CS
59 行
using System;
using System.Web.UI.WebControls;
using AspNetForums.Enumerations;
using AspNetForums.Components;
using System.Collections;
namespace AspNetForums.Controls {
public class DomainDropDownList : DropDownList {
public DomainDropDownList() {
ArrayList applications = SiteSettings.AllSiteSettings();
foreach (SiteSettings settings in applications) {
Items.Add(new ListItem(settings.SiteDomain, settings.SiteID.ToString()));
}
if (Items.FindByText(ForumContext.GetApplicationName()) == null) {
Items.Add(new ListItem(ForumContext.GetApplicationName(), "0"));
Items.FindByValue("0").Selected = true;
} else {
Items.FindByText(ForumContext.GetApplicationName()).Selected = true;
}
}
public int SelectedSiteID {
get {
return int.Parse(base.SelectedValue);
}
}
public string SelectedDomain {
get {
return base.SelectedItem.Text;
}
}
}
}
//此源码由程序太平洋收集整理发布,任何人都可自由转载,但需保留本站信息
//╭⌒╮┅~ ¤ 欢迎光临程序太平洋╭⌒╮
//╭⌒╭⌒╮╭⌒╮~╭⌒╮ ︶ ,︶︶
//,︶︶︶︶,''︶~~ ,''~︶︶ ,''
//╔ ╱◥███◣═╬╬╬╬╬╬╬╬╬╗
//╬ ︱田︱田 田 ︱ ╬
//╬ http://www.5ivb.net ╬
//╬ ╭○╮● ╬
//╬ /■\/■\ ╬
//╬ <| || 有希望,就有成功! ╬
//╬ ╬
//╚╬╬╬╬╬╬╬╬╬╬╗ ╔╬╬╬╬╝
//
//说明:
//专业提供VB、.NET、Delphi、ASP、PB源码下载
//包括:程序源码,控件,商业源码,系统方案,开发工具,书籍教程,技术文档
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?