|
<%@ Page Language="C#" MasterPageFile="~/Site.master" %>
<%@ Import Namespace="MessageBoard.Web" %>
<script runat="server">
protected void SaveChanges_Click(object sender, EventArgs e)
{
TimeZoneUtility.SaveTimeZoneInfoInCookie(
TimeZoneUtility.GetTimeZoneFromId(TimeZoneList.SelectedValue));
Response.Redirect("~/Default.aspx");
}
protected override void OnPreRender(EventArgs e)
{
base.OnPreRender(e);
TimeZoneList.SelectedValue = TimeZoneUtility.GetRequestTimeZone().Id;
}
</script>
<asp:Content ContentPlaceHolderID="MainContent" runat="Server">
<div id="SettingsPanel">
<h2>
Manage Settings</h2>
<div id="TimeZonePanel">
<asp:Label runat="server" AssociatedControlID="TimeZoneList" CssClass="TimeZoneLabel"
Text="Time Zone:" />
<asp:DropDownList runat="server" ID="TimeZoneList" CssClass="TimeZoneList" DataSourceID="TimeZoneSource"
DataTextField="DisplayName" DataValueField="Id" AppendDataBoundItems="true">
<asp:ListItem Text="Universal Time" Value="UTC" />
</asp:DropDownList>
<asp:ObjectDataSource runat="server" TypeName="System.TimeZoneInfo" SelectMethod="GetSystemTimeZones"
ID="TimeZoneSource" />
</div>
<div id="Settings-ButtonPanel">
<asp:Button ID="SaveChanges" Text="Save Changes" runat="server"
onclick="SaveChanges_Click" />
</div>
</div>
</asp:Content>
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.