Click here to Skip to main content
15,886,578 members
Articles / Web Development / ASP.NET

Web Scheduler for managing timed jobs with ASP.NET pages

Rate me:
Please Sign up or sign in to vote.
4.76/5 (11 votes)
20 Jul 2011CPOL5 min read 91.3K   6.5K   78  
Schedule timed tasks through ASP.NET administration pages.
<%@ Page Title="Home Page" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
    CodeBehind="Default.aspx.cs" Inherits="jobs._Default" %>

<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
</asp:Content>

<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
    <h2>
        Welcome to Schedule Tasks!
    </h2>
    <asp:GridView ID="gridJobs" runat="server" CellPadding="4" 
        EnableModelValidation="True" ForeColor="#333333" GridLines="None" 
        AutoGenerateColumns="False" Width="100%">
        <AlternatingRowStyle BackColor="White" />
        <Columns>
            <asp:BoundField DataField="id" HeaderText="id" />
            <asp:BoundField DataField="description" HeaderText="description" ItemStyle-Width="100" />
            <asp:BoundField DataField="schedule" HeaderText="schedule" />
            <asp:BoundField DataField="next_run" HeaderText="next_run" DataFormatString="{0:yyyy-MM-dd HH:mm}" ItemStyle-Width="120" />
            <asp:BoundField DataField="last_run" HeaderText="last_run" DataFormatString="{0:yyyy-MM-dd HH:mm}" ItemStyle-Width="120" />
            <asp:BoundField DataField="status" HeaderText="status" ItemStyle-Width="80" />
            <asp:BoundField DataField="enabled" HeaderText="enabled" />
            <asp:TemplateField HeaderText="action" ItemStyle-Width="260">
                <ItemTemplate>
                    <asp:Button ID="btnEdit" runat="server" Text="edit" onclick="btnEdit_Click" />
                    <asp:Button ID="btnEnableDisable" runat="server" Text="enable/disable" onclick="btnEnableDisable_Click" OnClientClick="return confirm('Are you sure you want to perform the operation?')" />
                    <asp:Button ID="btnDelete" runat="server" Text="delete" onclick="btnDelete_Click" OnClientClick="return confirm('Are you sure you want to delete this job?')" />
                    <asp:Button ID="btnRun" runat="server" Text="run" onclick="btnRun_Click" />
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
        <EditRowStyle BackColor="#2461BF" />
        <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
        <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
        <RowStyle BackColor="#EFF3FB" />
        <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
    </asp:GridView>
    <asp:Button ID="btnCreateJob" runat="server" Text="Create Job" PostBackUrl="~/CreateJob.aspx" />
</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.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Website Administrator
Hungary Hungary
Working with Microsoft Dynamics NAV since 2007.

Comments and Discussions