In this tutorial we will learn how to
create, build and run your first asp.net web app using C# and the ASP.NET.
Creating a New Project
Select File->New Project within the Visual
Studio 2013. This will open the New Project dialog screen. Click on the “Visual
C#” node in the tree-view on the left hand side of the dialog box and choose
the "ASP.NET Web Application" icon:
Choose location where you want this project to
be created on system Then give the name of this project and click ok.
Visual Studio will then create and
open a new web project within the solution explorer. By default it will create
a single page (Default.aspx), an AssemblyInfo.cs file in properties , as well
as a web.config file.
Visual stdio 2005 screen-
Visual stdio -2013
In VS-2005 this default.aspx will be
empty page but in VS-2013 there will be created page means some text are there
by default created by the Microsoft.
So for understanding purpose we will
add a new item in this project name will be “FirstWebPage.aspx”.
So for that right click on your application
and click on add new item and select a empty web Form give the for this and click Add.
After click on Add new item following
screen will open
After click on Add button this “FirstWebPage.aspx”
webform will add to the project.
Now click on “FirstWebPage.aspx”
webform it will open as HTML format(Source file) we can see it below of that
page. We can go in design mode from there.
We can made changes in screen from
Source mode and design mode.
Here we are drag and drop a calendar
and a label from toolbox .we can change view of calendar using calendar properties.
Html Code will be
<body>
<form id="form1" runat="server">
<div>
Hello your first asp.net Application<br />
<br />
<asp:Calendar ID="Calendar1" runat="server" BackColor="White" BorderColor="Black" BorderStyle="Solid" CellSpacing="1" Font-Names="Verdana" Font-Size="9pt" ForeColor="Black" Height="250px" NextPrevFormat="ShortMonth" Width="330px">
<DayHeaderStyle Font-Bold="True" Font-Size="8pt" ForeColor="#333333" Height="8pt" />
<DayStyle BackColor="#CCCCCC" />
<NextPrevStyle Font-Bold="True" Font-Size="8pt" ForeColor="White" />
<OtherMonthDayStyle ForeColor="#999999" />
<SelectedDayStyle BackColor="#333399" ForeColor="White" />
<TitleStyle BackColor="#333399" BorderStyle="Solid" Font-Bold="True" Font-Size="12pt" ForeColor="White" Height="12pt" />
<TodayDayStyle BackColor="#999999" ForeColor="White" />
</asp:Calendar>
<br />
<br />
<asp:Label ID="Label1" runat="server" Height="27px" Text="Label" Width="200px"></asp:Label>
</div>
</form>
</body>
|
When you will run this application you
will see this page on browser ,but before this we have to set “Startup project “
for that right click on “FirstWebPage.aspx” and set it as startup project and run this application or you can see this
page using open this browser With.
EmoticonEmoticon