using System;
using System.Text;
public partial class RichControl : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void btnSave_Click(object sender, EventArgs e)
{
StringBuilder sb = new StringBuilder();
if (FileUpload1.HasFile)
{
try
{
sb.AppendFormat(" Uploaded file: {0}", FileUpload1.FileName);
//save the file
FileUpload1.SaveAs(@"C:\" + FileUpload1.FileName);
//Showing the file information
sb.Append("<br/> File Name: {0}" + FileUpload1.PostedFile.FileName);
sb.Append("<br/> File type: {0}"+ FileUpload1.PostedFile.ContentType);
sb.Append("<br/> File length: {0}" + FileUpload1.FileBytes.Length);
Label1.Text = sb.ToString();
}
catch (Exception ex)
{
sb.Append("<br/> Error <br/>");
sb.Append(ex.Message);
Label1.Text = sb.ToString();
}
}
else
{
Label1.Text = sb.ToString();
}
}
}
<configuration>
<system.web>
<httpRuntime
maxRequestLength="10240"
requestLengthDiskThreshold="100" />
</system.web>
</configuration>
Event | Description |
---|---|
SelectionChanged | This event is fired when you select a day, a week or an entire month. |
DayRender | This event is fired when each data cell of the calendar control is rendered. |
VisibleMonthChanged | It is raised when user changes a month. |
using System;
using System.Text;
public partial class RichControl : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Calendar1_SelectionChanged(object sender, EventArgs e)
{
Label1.Text ="Todays date is: "+ Calendar1.TodaysDate.ToShortDateString();
Label2.Text = "Your date of birth is: " + Calendar1.SelectedDate.ToShortDateString();
}
}
<?xml version="1.0" encoding="utf-8" ?>
<Advertisements>
<Ad>
<ImageUrl>∼ /Images/logo1.png</ImageUrl>
<NavigateUrl>http://www.TutorialRide.com</NavigateUrl>
<AlternateText>Advertisement</AlternateText>
<Impressions>100</Impressions>
<Keyword>banner</Keyword>
</Ad>
<Ad>
<ImageUrl>∼ /Images/logo2.png</ImageUrl>
<NavigateUrl>http://www.TutorialRide.com</NavigateUrl>
<AlternateText>Advertisement</AlternateText>
<Impressions>100</Impressions>
<Keyword>banner</Keyword>
</Ad>
<Ad>
<ImageUrl>∼ /Images/logo3.png</ImageUrl>
<NavigateUrl>http://www.CareerRide.com</NavigateUrl>
<AlternateText>Advertisement</AlternateText>
<Impressions>100</Impressions>
<Keyword>banner</Keyword>
</Ad>
<Ad>
<ImageUrl>∼ /Images/logo4.png</ImageUrl>
<NavigateUrl>http://www.TutorialRide.com</NavigateUrl>
<AlternateText>Advertisement</AlternateText>
<Impressions>50</Impressions>
<Keyword>banner</Keyword>
</Ad>
</Advertisements>
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="RichControl.aspx.cs" Inherits="RichControl" %>
<! DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:MultiView ID="MultiView1" runat="server">
<asp:View ID="View1" runat="server">
<table style="border:1px solid black">
<tr>
<td colspan="2">
<h2>Step 1 - Product Details</h2>
</td>
</tr>
<tr>
<td>Product ID</td>
<td>
<asp:TextBox ID="txtProductID" runat="server"></asp:TextBox>
</td>
</tr>
<tr>
<td>Product Name</td>
<td>
<asp:TextBox ID="txtProductName" runat="server"></asp:TextBox>
</td>
</tr>
<tr>
<td>Price/Unit</td>
<td>
<asp:TextBox ID="txtProductPrice" runat="server"></asp:TextBox>
</td>
</tr>
<tr>
<td colspan="2" style="text-align:right">
<asp:Button ID="btnStep2" runat="server"
Text="Next >>" onclick="btnStep2_Click" />
</td>
</tr>
</table>
</asp:View>
<asp:View ID="View2" runat="server">
<table style="border:1px solid black">
<tr>
<td colspan="2">
<h2>Step 2 - Order Details</h2>
</td>
</tr>
<tr>
<td>Order ID</td>
<td>
<asp:TextBox ID="txtOrderID" runat="server"></asp:TextBox>
</td>
</tr>
<tr>
<td>Quantity</td>
<td>
<asp:TextBox ID="txtQuantity" runat="server"></asp:TextBox>
</td>
</tr>
<tr>
<td>
<asp:Button ID="btnBackToStep1" runat="server" Text="<< Previous"
onclick="btnBackToStep1_Click" />
</td>
<td style="text-align:right">
<asp:Button ID="btnStep3" runat="server" Text="Next >>"
onclick="btnGoToStep3_Click" />
</td>
</tr>
</table>
</asp:View>
<asp:View ID="View3" runat="server">
<table style="border:1px solid black">
<tr>
<td colspan="2"><h2>Step 3 - Summary</h2></td>
</tr>
<tr>
<td colspan="2"><h3>Product Details</h3></td>
</tr>
<tr>
<td>Product ID</td>
<td>
<asp:Label ID="lblProductID" runat="server"></asp:Label>
</td>
</tr>
<tr>
<td>Product Name</td>
<td>
<asp:Label ID="lblProductName" runat="server"></asp:Label>
</td>
</tr>
<tr>
<td>Price/Unit</td>
<td>
<asp:Label ID="lblPrice" runat="server"></asp:Label>
</td>
</tr>
<tr>
<td colspan="2"><h3>Order Details</h3></td>
</tr>
<tr>
<td>Order ID</td>
<td>
<asp:Label ID="lblOrderID" runat="server"></asp:Label>
</td>
</tr>
<tr>
<td>Quantity</td>
<td>
<asp:Label ID="lblQuantity" runat="server"></asp:Label>
</td>
</tr>
<tr>
<td>
<asp:Button ID="btnBackToStep2" runat="server" OnClick="btnBackToStep2_Click" style="height: 26px" Text="<<Previous" />
</td>
<td style="text-align:right">
<asp:Button ID="btnSubmit" runat="server" Text="Submit >>" OnClick="btnSubmit_Click"
/>
</td>
</tr>
</table>
</asp:View>
</asp:MultiView>
</div>
</form>
</body>
</html>
using System;
using System.Text;
public partial class RichControl : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (! IsPostBack)
{
MultiView1.ActiveViewIndex = 0;
}
}
protected void btnStep2_Click(object sender, EventArgs e)
{
MultiView1.ActiveViewIndex = 1;
}
protected void btnBackToStep1_Click(object sender, EventArgs e)
{
MultiView1.ActiveViewIndex = 0;
}
protected void btnGoToStep3_Click(object sender, EventArgs e)
{
MultiView1.ActiveViewIndex = 2;
lblProductID.Text = txtProductID.Text;
lblProductName.Text = txtProductName.Text;
lblPrice.Text = txtProductPrice.Text;
lblOrderID.Text = txtOrderID.Text;
lblQuantity.Text = txtQuantity.Text;
}
protected void btnSubmit_Click(object sender, EventArgs e)
{
Response.Redirect("SaveData.aspx");
}
protected void btnBackToStep2_Click(object sender, EventArgs e)
{
MultiView1.ActiveViewIndex = 1;
}
}
<asp:Wizard ID="Wizard1" runat="server" Height="75px" Width="140px">
<WizardSteps>
<asp:WizardStep runat="server" title="Step 1">
</asp:WizardStep>
<asp:WizardStep runat="server" title="Step 2">
</asp:WizardStep>
</WizardSteps>
</asp:Wizard>
using System;
using System.Web.UI.WebControls;
public partial class WizardControl : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Wizard1_FinishButtonClick(object sender, WizardNavigationEventArgs e)
{
Response.Redirect("SaveData.aspx");
}
protected void Wizard1_NextButtonClick(object sender, WizardNavigationEventArgs e)
{
if (e.NextStepIndex == 2)
{
lblProductID.Text = txtProductID.Text;
lblProductName.Text = txtProductName.Text;
lblPrice.Text = txtProductPrice.Text;
lblOrderID.Text = txtOrderID.Text;
lblQuantity.Text = txtQuantity.Text;
}
}
}