Menu

Drop Down MenusCSS Drop Down MenuPure CSS Dropdown Menu

Friday, 15 July 2016

What is Common Type System?

The common type system defines how types are declared, used, and managed in the common language run time, and is also an important part of the run time's support for cross-language integration. The common type system performs the following functions:
  • Establishes a framework that helps enable cross-language integration, type safety, and high-performance code execution.
  • Provides an object-oriented model that supports the complete implementation of many programming languages.
  • Defines rules that languages must follow, which helps ensure that objects written in different languages can interact with each other.
  • Provides a library that contains the primitive data types (such as BooleanByteCharInt32, and UInt64) used in application development.
......please share your knowledge to learn yourself and make others too learn

Creating First sample WebPage Using Asp.net in Text Editor


"First of all I would like to say thank you for your response and cooperation in regards to commenting and following my tutorials,keep going on every one should be rock in Programming filed and a step ahead to reach your goals".
Now I am Going to Create a first web page on text editor in asp.net using C# i.e.Notepad environment with following resources and setup this website in IIS .
Example:
D:\ - Physical Location on the Server Machine

SampleWebSite – Website Folder

Images - Folder-->place a image for header

firstpage.aspx- UI

firstpage.aspx.cs– Code File

let's see the UI design using server controls,

Firstpage.aspx

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="firstpage.aspx.cs" Inherits="aspsample.firstpage" %>

<!DOCTYPE html>

<html>

<head runat="server">

    <title>ASP.NET Web Site</title>

    <link href='https://fonts.googleapis.com/css?family=Open+Sans:400,300,300italic,400italic,600,600italic,700,700italic,800,800italic' rel='stylesheet' type='text/css' />
    <style>
        body {
            font-family: 'Open Sans', sans-serif;
            font-size: 12px;
        }

        .content {
            width: 65%;
            margin: 0 auto;
            padding: 5%;
        }

        .maincontent {
            width: 90%;
            margin: 0 auto;
        }
    </style>
    <script type="text/javascript">
        function validate() {

            var firstName = document.getElementById("TextBox1").value;

            var lastName = document.getElementById("TextBox2").value;

            var error = "";

            if (firstName == "")

                error += "Please Enter First Name" + "\n";

            if (lastName == "")

                error += "Please Enter Last Name" + "\n";

            if (error != "") {

                alert(error);

                return false;

            }

        }

    </script>
</head>
<body style="background-color: Azure">

    <form id="form1" runat="server">

        <div class="maincontent">

            <asp:Image ID="Image1" runat="server" ImageUrl="~/images/aspire_new.png" Width="100%"
                Height="150" AlternateText=".Net Aspires" ToolTip="Image Banner" BorderStyle="Solid"
                BorderWidth="2" BorderColor="Blue" />

            <marquee direction="right" style="background-color: #003366; color: #c08041; font-size: 23px; border: 2px solid #0c1823">

<h1>Welcome to ASP.NET Web Site</h1>

</marquee>

            <hr />

            <div class="content">

                <asp:Label ID="Label1" runat="server" Text="Enter First Name: " Font-Size="15"
                    ForeColor="#003366" />

                <asp:TextBox ID="TextBox1" runat="server" />

                <br />

                <br />

                <asp:Label ID="Label2" runat="server" Text="Enter Last Name: " Font-Size="15" ForeColor="#003366" />

                <asp:TextBox ID="TextBox2" runat="server" />

                <br />

                <br />

                <asp:Button ID="Button1" runat="server" Text="Submit" OnClientClick="return validate();"
                    OnClick="Button1_Click" />

                <br />

                <asp:Label ID="Label3" runat="server" />

            </div>

        </div>

    </form>

</body>

</html>
firstpage.aspx.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace aspsample
{
    public partial class firstpage : System.Web.UI.Page
    {


        protected void Page_Load(object sender, EventArgs e)
        {

            TextBox1.Focus();

        }

        protected void Button1_Click(object sender, EventArgs e)
        {

            string firstName = TextBox1.Text.Trim();

            string lastName = TextBox2.Text.Trim();

            string fullName = firstName + " " + lastName;

            Label3.Text = "<b>Your Name Is: </b>" + fullName;

        }

    }
}

Output:

Now run the page in browser or right click on page --> open with-->any browser . it seems like below image
designview

 Step 1:  click on submit on button with out entering  required fields and see the output.

validating input fileds

 Step 2 :Now  fill the input fields and click on submit button it will display's your firstname and lastname in label field

displaying output


...for more information about previous tutorial please visit this link  ASP.Net Tutorials and
Thank you for visiting my blog ,don't forget to comment on post or else if you want daily updates please follow in Google Plus.

ASP.NET Web Application Development Using Web Forms

Framework in Visual Studio IDE:

ASP.NET Web Forms:
  •   Based on Microsoft ASP.NET technology, in which code that runs on the server dynamically generates Web page output to the browser or client device.
  • Compatible with any browser or mobile device. An ASP.NET Web page automatically renders the correct browser-compliant HTML for features such as styles, layout, and so on.
  • Compatible with any language supported by the .NET common language run time, such as Microsoft Visual Basic and Microsoft Visual C#.
  • Built on the Microsoft .NET Framework. This provides all the benefits of the framework, including a managed environment, type safety, and inheritance.
  •  Flexible because you can add user-created and third party controls to them.
  •  Separation of HTML and other UI code from application logic.
  •  A rich suite of server controls for common tasks, including data access.
  • Powerful data binding, with great tool support.
  •  Support for client-side scripting that executes in the browser.
  • Support for a variety of other capabilities, including routing, security, performance,
  • Internationalisation, testing, debugging, error handling and state management.
  • Implementing a rich Web user interface - It can be difficult and tedious to design and implement a user interface using basic HTML facilities, especially if the page has a complex layout, a large amount of dynamic content, and full-featured user-interactive objects.
  • Separation of client and server - In a Web application, the client (browser) and server are different programs often running on different computers (and even on different operating systems). Consequently, the two halves of the application share very little information; they can communicate, but typically exchange only small chunks of simple information.
  • Stateless execution - When a Web server receives a request for a page, it finds the page, processes it, sends it to the browser, and then discards all page information. If the user requests the same page again, the server repeats the entire sequence, reprocessing the page from scratch. Put another way, a server has no memory of pages that it has processed—page are stateless. Therefore, if an application needs to maintain information about a page, its stateless nature can become a problem.
  • Unknown client capabilities - In many cases, Web applications are accessible to many users using different browsers. Browsers have different capabilities, making it difficult to create an application that will run equally well on all of them.
  •  Complications with data access - Reading from and writing to a data source in traditional Web applications can be complicated and resource-intensive.
  • Complications with scalability - In many cases Web applications designed with existing methods fail to meet scalability goals due to the lack of compatibility between the various components of the application. This is often a common failure point for applications under a heavy growth cycle. Meeting these challenges for Web applications can require substantial time and effort. 
  •      Intuitive, consistent object model - The ASP.NET page framework presents an object model that enables you to think of your forms as a unit, not as separate client and server pieces. In this model, you can program the page in a more intuitive way than in traditional Web applications, including the ability to set properties for page elements and respond to events. In addition, ASP.NET server controls are an abstraction from the physical contents of an HTML page and from the direct interaction between browser and server. In general, you can use server controls the way you might work with controls in a client application and not have to think about how to create the HTML to present and process the controls and their contents.
  •    Event-driven programming model - ASP.NET Web Forms bring to Web applications the familiar model of writing event handlers for events that occur on either the client or server. The ASP.NET page framework abstracts this model in such a way that the underlying mechanism of capturing an event on the client, transmitting it to the server, and calling the appropriate method is all automatic and invisible to you. The result is a clear, easily written code structure that supports event-driven development.
  •     Intuitive state management - The ASP.NET page framework automatically handles the task of maintaining the state of your page and its controls, and it provides you with explicit ways to maintain the state of application-specific information. This is accomplished without heavy use of server resources and can be implemented with or without sending cookies to the browser.
  •     Browser-independent applications - The ASP.NET page framework enables you to create all application logic on the server, eliminating the need to explicitly code for differences in browsers. However, it still enables you to take advantage of browser-specific features by writing client-side code to provide improved performance and a richer client experience.
  •     .NET Framework common language runtime support - The ASP.NET page framework is built on the .NET Framework, so the entire framework is available to any ASP.NET application. Your applications can be written in any language that is compatible that is with the runtime. In addition, data access is simplified using the data access infrastructure provided by the .NET Framework, including ADO.NET.
  •    NET Framework scalable server performance - The ASP.NET page framework enables you to scale your Web application from one computer with a single processor to a multi-computer Web farm cleanly and without complicated changes to the application's logic.

       Advantages of a Web Forms-Based Web Application:
  •   It supports an event model that preserves state over HTTP, which benefits line-of-business Web application development. The Web Forms-based application provides dozens of events that are supported in hundreds of server controls.
  •    It uses a Page Controller pattern that adds functionality to individual pages.
  •   It uses view state or server-based forms, which can make managing state information easier.
  •     It works well for small teams of Web developers and designers who want to take advantage of  the large number of components available for rapid application development.
  •    In general, it is less complex for application development, because the components (the Page class, controls, and so on) are tightly integrated and usually require less code than The MVC model. 

       Advantages of an MVC-Based Web Application:
  •    It makes it easier to manage complexity by dividing an application into the model, the view,        and the controller.
  •    It does not use view state or server-based forms. This makes the MVC framework ideal for      developers who want full control over the behaviour of an application.
  •    It uses a Front Controller pattern that processes Web application requests through a single       controller. This enables you to design an application that supports a rich routing infrastructure.
  •    It provides better support for test-driven development (TDD).
  •   It works well for Web applications that are supported by large teams of developers and Web   designers who need a high degree of control over the application behaviour.

Using Visual Studio, you can create ASP.NET Web Forms. The Visual Studio Integrated Development Environment (IDE) lets you drag and drop server controls to lay out your Web Forms page. You can then easily set properties, methods, and events for controls on the page or for the page itself. These properties, methods, and events are used to define the web page's behaviour, look and feel, and so on. To write server code to handle the logic for the page, you can use a .NET language like Visual Basic or C#.
ASP.NET Web Forms offer:
ASP.NET Web Forms Helps You Overcome Challenges:
Web application programming presents challenges that do not typically arise when programming traditional client-based applications. Among the challenges are,
      ASP.NET framework address these challenges in the following ways:



      Deciding When to Create a Web Forms Application:

     You must consider carefully whether to implement a Web application by using either the ASP.NET Web Forms model or another model, such as the ASP.NET MVC framework. The MVC framework does not replace the Web Forms model. You can use either framework for Web applications. Before you decide to use the Web Forms model or the MVC framework for a specific Web site, evaluate the advantages of each approach.





Monday, 11 July 2016

What is CLR?

              The Common Language Runtime (CLR) is an Execution Environment . It works as a layer between Operating Systems and the applications written in .Net languages that conforms to the Common Language Specification (CLS).
            
            The main function of Common Language Runtime (CLR) is to convert the Managed Code into native code and then execute the Program. The Managed Code compiled only when it needed, that is it converts the appropriate instructions when each function is called.The Common Language Runtime (CLR) 's Just In Time (JIT) compilation converts Intermediate Language (MSIL) to native code on demand at application run time.

       During the execution of the program, the Common Language Runtime(CLR) manages memory,Garbage Collection (GC),Exception Handling, Common Type System (CTS), code safety verifications, and other system services. The CLR ( Common Language Runtime ) defines the Common Type System (CTS), which is a standard type system used by all .Net languages . 

       That means all .NET programming languages uses the same representation for common Data Types , so Common Language Runtime (CLR) is a language-independent runtime environment.The Common Language Runtime (CLR) environment is also referred to as a managed environment, because during the execution of a program it also controls the interaction with the Operating System.



.....please share your knowledge to learn yourself and help others too learn