Learn the fundamentals of Angular 2, a JavaScript framework for developing dynamic single page applications.
Do more with
ucDatePicker.ascx
--------------------------------------------------------------------------
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ucDatePicker.ascx.cs" Inherits="eDelivery.UserControls.ucDatePicker" %>
<table width="900px" cellpadding="0" cellspacing="0">
<tr>
<td align="right" style="height:20px; font-family:Arial; font-size:12pt; width:900px;">
<label style="color:#0287b4; size:2;">Click calendar for date:</label>
<asp:TextBox ID="txt" runat="server" />
<asp:ImageButton ID="img" runat="server" ImageUrl="~/Images/Calendar.png" OnClick="imgCal" />
</td>
</tr>
<tr>
<td align="right" style="height:3px; font-family:Arial; font-size:12pt; width:900px; background-color:#ffffff; ">
</td>
</tr>
<tr>
<td align="right" style="height:1px; font-family:Arial; font-size:12pt; width:900px;">
<asp:Panel ID="Panel1" runat="server" Visible="false">
<asp:Calendar ID="Calendar1" runat="server" BackColor="White" BorderColor="#999999" CellPadding="4" DayNameFormat="Shortest" Font-Names="Verdana" Font-Size="8pt" ForeColor="#D1D1D1" Height="180px"
Width="200px" OnSelectionChanged="cal_DayRender" >
<SelectedDayStyle BackColor="#666666" Font-Bold="True" ForeColor="White" />
<SelectorStyle BackColor="#CCCCCC" />
<WeekendDayStyle BackColor="#AABAD2" ForeColor="White" />
<TodayDayStyle BackColor="#CCCCCC" ForeColor="Black" />
<OtherMonthDayStyle ForeColor="#808080" />
<NextPrevStyle VerticalAlign="Bottom" />
<DayHeaderStyle BackColor="#B5D1FA" Font-Bold="True" Font-Size="7pt" ForeColor="Black" />
<TitleStyle BackColor="#284775" BorderColor="Black" Font-Bold="True" ForeColor="White" />
</asp:Calendar>
</asp:Panel>
</td>
</tr>
</table>
ucDatePicker.ascx.cs
--------------------------------------------------------------------------
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace eDelivery.UserControls
{
public partial class ucDatePicker : System.Web.UI.UserControl
{
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
txt.Text = "Enter a date";
}
}
protected void imgCal(object sender, ImageClickEventArgs e)
{
Panel1.Visible = true;
}
protected void cal_DayRender(object sender, EventArgs e)
{
txt.Text = Calendar1.SelectedDate.ToString("dd/MM/yyyy");
Panel1.Visible = false;
ucReports rpts = (ucReports)this.Page.FindControl("Rpt");
rpts.str();
}
}
}
ucReports.ascx
--------------------------------------------------------------------------
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ucReports.ascx.cs" Inherits="eDelivery.UserControls.ucReports" %>
<asp:GridView ID="GridView1" runat="server" CellPadding="4" ForeColor="#333333" BorderStyle="Solid" BorderWidth="2px" GridLines="Horizontal" Width="900px" ShowFooter="false" >
<FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
<RowStyle BackColor="#F7F6F3" ForeColor="#333333"/>
<PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
<SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
<HeaderStyle BackColor="#284775" Font-Bold="True" ForeColor="White" />
<EditRowStyle BackColor="#999999" />
<AlternatingRowStyle BackColor="#D8D8D8" ForeColor="#284775" />
</asp:GridView>
ucReports.ascx.cs
--------------------------------------------------------------------------
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace eDelivery.UserControls
{
public partial class ucReports : System.Web.UI.UserControl
{
protected void Page_Load(object sender, EventArgs e)
{
}
public void str()
{
Response.Write("Got it here!");
}
}
}
ucTest.aspx
--------------------------------------------------------------------------
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="UCtest.aspx.cs" Inherits="WebApplication1.UCtest" %>
<%@ Register TagPrefix="eDel" TagName="ucDt" Src="ucDatePicker.ascx" %>
<%@ Register TagPrefix="eDel" TagName="ucRpt" Src="ucReports.ascx" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<table width="900px" cellpadding="0" cellspacing="0">
<tr>
<td align="right" style="height:70px; font-family:Arial; font-size:34pt; width:900px; background-color:#ffffff; ">
<label style="color:#0287b4; size:4;">Previous Case Reporting</label>
</td>
</tr>
<tr>
<td>
</td>
</tr>
<tr>
<td>
<eDel:ucDt id="Pckr" runat="server" />
</td>
</tr>
<tr>
<td>
<eDel:ucRpt id="Rpt" runat="server" />
</td>
</tr>
</table>
</form>
</body>
</html>
Premium Content
You need an Expert Office subscription to comment.Start Free Trial