Thursday, August 8, 2013
Monday, April 22, 2013
Sunday, April 14, 2013
Sunday, April 7, 2013
Friday, April 5, 2013
BlogEngine.NET - An innovative open source blogging platform developed with ASP.NET
BlogEngine.NET - An innovative open source blogging platform developed with ASP.NET
Features
Here's a short list of all the features of BlogEngine.NETPlug ’n play
BlogEngine.NET is very easy to setup and customize. To make it work, just upload the files to an ASP.NET 4.0 webserver and you’re ready to start writing. No database configuration, just plug ‘n play.Full featured
BlogEngine.NET comes with all the features you would expect from a modern blog engine as well as new unique features such as AJAX comments and screenshot trackbacks.Web 2.0
BlogEngine.NET features social bookmarks, OpenSearch support, XFN tags, AJAX, FOAF, SIOC, APML, Gravatars, coComments, tag cloud, Google sitemap and other so called Web 2.0 features.Referrer stats
The referrer statistics enables you to see which websites link to you, so you can follow up with comments or just to have fun. This feature is a real time killer that you cannot live without.Cool widgets
There is a variety of cool widgets that such as an AJAX post calendar or a blogroll that automatically retrieves the latest posts from each blog and displays the title beneath the blog. Most of the controls are configurable from the admin section.Advanced comment system
Comments are a very important part of a blog, so BlogEngine.NET features a very advanced commenting system in AJAX that supports country flags, live preview, Gravatars, coComments – all of which can easily be modified in the admin section.Full syndication suite
BlogEngine.NET supports syndication feeds in any possible location. You can find feeds on comments, categories, authors and a main feed. Both RSS 2.0 and ATOM 1.0 are fully supported.Trackbacks and pingbacks
All outgoing links from the posts is tracked- and pinged back, so your blog will get listed in the comments on the linked website if it supports it. When a new post is created, BlogEngine.NET automatically pings Technorati, Feedburner, Ping-o-Matic etc.Search
The search capability of BlogEngine.NET is one of the most advanced and it even allows the visitors to search in the comments. Everything about the search can be configured in the admin section.Standalone pages
Besides regular blog posts, BlogEngine.NET supports the creation of static pages that exist outside the blog chronology. Pages are useful for all kinds of information about you or your blog.Multi-author support
BlogEngine.NET fully supports multiple authors to write posts on the same blog. Visitors are then able to subscribe to the individual author’s RSS feed or view only the posts from their favourite author.Cool themes
BlogEngine.NET comes with some very cool themes for you to choose from. If you want to modify or create a new theme you can do so easily with just a basic understanding of HTML and CSS.XHTML compliance
All the controls in BlogEngine.NET are 100% XHTML 1.0 compliant. All posts you write automatically become compliant thanks to the tinyMCE text editor.Extendable
BlogEngine.NET is built from the ground up using nothing but C# and ASP.NET 4.0 all with simplicity in mind. It means that you can write new controls and themes by using the skills you already have as a .NET developer.Thursday, April 4, 2013
ASP.NET Custom Validator
Asp.Net Custom validator allows us to validate the controls on page on client side as well as server side, But mainly the validation is done on client side through javascript.
In this article, I will explain the custom validator to validate check boxes using client validation function.
Add 2 check box controls on the page as follows:
Add a custom validation control as follows:
Client validation function is written in javascript as follows:
And we're done. Run the code in browser on following button click.
In this article, I will explain the custom validator to validate check boxes using client validation function.
Add 2 check box controls on the page as follows:
<asp:CheckBox ID="chkMobileAlerts" runat="server" />
Sign up for Mobile Alerts<br/>
<asp:CheckBox ID="chkTermsConditions" runat="server" />
I agree to Terms and Conditions
Add a custom validation control as follows:
<asp:CustomValidator ID="CustomValidator1" runat="server" ErrorMessage="Please sign up for mobile alerts and agree to terms and conditions."
ValidationGroup="1" ClientValidationFunction="ValidateCheckBoxes"></asp:CustomValidator> <br />
Client validation function is written in javascript as follows:
<script lang="javascript">
function ValidateCheckBoxes(source, arguments) {
if (document.getElementById("<%=chkMobileAlerts.ClientID%>").checked == true && document.getElementById("<%=chkTermsConditions.ClientID%>").checked == true)
arguments.IsValid = true;
else
arguments.IsValid = false;
}
</script>
And we're done. Run the code in browser on following button click.
<asp:Button ID="btnRegister" runat="server" Text="Click Here to Register" ValidationGroup="1" OnClick="btnRegister_Click" CssClass="submit" />
.Net Framework Architecture
The .Net Framework is an inbuilt windows component
that supports Building and running the next generation of application
xml web services. The .Net Framework has been developed to cater to the
following objectives and Requirements:
- To provide a consistent object-oriented environment to develop applications;
- To provide a code execution environment that simplifies deployment and versioning;
- To provide a code execution that eliminates the issues faced by scripted environments with respect to performance.
- To provide a common programming model where the choice of a programming
- Language becomes a matter of choice.
The .Net framework is made up of two
components- Common Language Runtime (CLR) and the .Net Framework Class
Library (FCL).The CLR is the basic for the .Net Framework and provides
various services that application can use. It also forms the environment
that other application run on.
The runtime is supposed to be an
agent that manages code at execution time, providing core services, such
as memory management, thread management, and remoteing. It also
encourages security and robustness by implementing safety and other type
of code accuracy. Since code management is a basic principal of the
runtime is known as unmanaged code. The .Net framework consists of web
Forms, Windows Forms and console applications the pertain to the
presentation layer of an application.
- Web forms are used in web-based application whereas windows forms are used in windows based application.
- You can create a character-based console application that can be executed from the command line.
- .Net Framework consists of two other component the .Net Framework Base classes the CLR.
Common Language Runtime
-
The Common Language Runtime (CLR) is a core component of Microsoft's .NET initiative. It is Microsoft's implementation of the Common Language Infrastructure (CLI) standard, which defines an execution environment for program code. In the CLR, code is expressed in a form of bytecode called the Common Intermediate Language (CIL, previously known as MSIL—Microsoft Intermediate Language).
-
Developers using the CLR write code in a language such as C# or VB.NET. At compile time, a .NET compiler converts such code into CIL code. At runtime, the CLR's just-in-time compiler converts the CIL code into code native to the operating system. Alternatively, the CIL code can be compiled to native code in a separate step prior to runtime by using the Native Image Generator (NGEN). This speeds up all later runs of the software as the CIL-to-native compilation is no longer necessary.
-
Although some other implementations of the Common Language Infrastructure run on non-Windows operating systems, Microsoft's implementation runs only on Microsoft Windows operating systems.
In the .NET environment, a source code which is written in any one of the programming languages should be translated into a byte code format before its execution. This byte code format is called Common Intermediate Language(CIL) or Microsoft Intermediate Language (MSIL).
Common Intermediate Language:
-
Common Intermediate Language (CIL, pronounced either "sil" or "kil") (formerly called Microsoft Intermediate Language or MSIL) is the lowest-level human-readable programming language defined by the Common Language Infrastructure specification and used by the .NET Framework and Mono. Languages which target a CLI-compatible runtime environment compile to CIL, which is assembled into bytecode. CIL is an object-oriented assembly language, and is entirely stack-based. It is executed by a virtual machine.
-
CIL was originally known as Microsoft Intermediate Language (MSIL) during the beta releases of the .NET languages. Due to standardization of C# and the Common Language Infrastructure, the bytecode is now officially known as CIL. Because of this legacy, CIL is still frequently referred to as MSIL, especially by long-standing users of the .NET languages.
-
The high level programming languages that need to be compiled require a runtime, so that the architecture on which the language runs is provided with details on how to execute its code.
- All the programming languages use its corresponding runtime to run the application.
-
For example, To run an application developed using Visual Basic, the computer on which the application will be run must be installed with the Visual Basic runtime. The Visual Basic runtime can run only the applications developed with Visual Basic and not the ones developed with any other programming language like Java.
-
In the .NET Framework, all the Microsoft .NET languages use a common language runtime, which solves the problem of installing separate runtime for each of the programming languages. Microsoft .NET Common Language Runtime installed on a computer can run any language that is Microsoft .NET compatible.
-
The main advantage of the .NET Framework is the interoperability between different languages. As all the Microsoft .NET languages share the same common runtime language, they all work well together. For example, you can use an object written in C# from Visual Basic.NET. The same applies for all the other Microsoft .NET languages.
-
When you compile a Microsoft.NET language, the complier generates code written in the Microsoft Intermediate Language (MSIL). MSIL is a set of instructions that can quickly be translated into native code.
-
A Microsoft.NET application can be run only after the MSIL code is translated into native machine code. In .NET Framework, the intermediate language is complied "just in time" (JIT) into native code when the application or component is run instead of compiling the application at development time. The Microsoft.NET runtime consists of two JIT compilers. They are standard JIT compiler and the EconoJIT compiler. The EconoJIT compiler compiles faster than the standard JIT compiler, but the code it produces is not as optimized as the code obtained from the standard JIT compiler.
The code whose execution is managed
by the .Net Framework Common Language Runtime is known as Managed code.
It refers to a contract of cooperation between natively executing code
and the runtime.The process of compiling and executing managed code in
given below.
-
Compile a programs developed in a language that targets the CLR, instead of compiling the source code into machine level code, the compiler translates it into Microsoft Intermediate language(MSIL) or Intermediate language (IL).No matter which lang has been used to develop the application , it always get translated into IL. This ensure languages interoperability.
- In addition to translating the code into IL, the
compiler also produce metadata about the program during the process of
compilation. Meta data contains the description of the program
- The IL and the metadata are linked in an assembly.
- The compiler creates the .EXE or .DLL file.
- Execute the .Exe or .DLL file, the code and all the
other relevant information from the base class library is sent to the
class loader. The class loader the code in the memory.
-
Before the code can be executed, the .Net framework needs to convert the IL into native or CPU-specific code. The Just-In-Time (JIT) compiler translator the code from IL into managed native code.
- The CLR supplies a JIT compiler for each supported CPU architecture.
-
During JIT compilation, the code is also checked for type safety. Type safety ensures that objects are always accessed in a compatible way, you try to pass an 8-byte value to a method the accepts a 4-byte value as it parameter.
- After translating the IL into native code, the converted code is sent to the .Net runtime manager.
-
The .Net runtime manager executes the code. While executing the code, security check the performed to ensure that the code has the appropriate permissions for accessing the available resources.
Metadata
-
Metadata is binary information describing your program that is stored either in a common language runtime portable executable (PE) file or in memory. When you compile your code into a PE file, metadata is inserted into one portion of the file, while your code is converted to Microsoft intermediate language (MSIL) and inserted into another portion of the file.
-
Every type and member defined and referenced in a module or assembly is described within metadata. When code is executed, the runtime loads metadata into memory and references it to discover information about your code's classes, members, inheritance, and so on.
Metadata is the key to a
simpler programming model, eliminating the need for Interface Definition
Language (IDL) files, header files, or any external method of component
reference. Metadata allows .NET languages to describe themselves
automatically in a language-neutral manner, unseen by both the developer
and the user. Additionally, metadata is extensible through the use of
attributes. Metadata provides the following major benefits:
- Common language runtime modules and assemblies are self-describing. A module's metadata contains everything needed to interact with another module.
-
Metadata automatically provides the functionality of IDL in COM, allowing you to use one file for both definition and implementation. Runtime modules and assemblies do not even require registration with the operating system.
-
As a result, the descriptions used by the runtime always reflect the actual code in your compiled file, which increases application reliability.
- Metadata provides all the information required about compiled code for you to inherit a class from a PE file written in a different language.
- You can create an instance of any class written in
any managed language (any language that targets the common language
runtime) without worrying about explicit marshaling or using custom
interoperability code.
-
The .NET Framework allows you to declare specific kinds of metadata, called attributes, in your compiled file. Attributes can be found throughout the .NET Framework and are used to control in more detail how your program behaves at run time.
- Additionally, you can emit your own custom metadata
into .NET Framework files through user-defined custom attributes. For
more information, see Extending Metadata Using Attributes.
Several tools are used to handle metadata.
- Reflection is a tool which is used to handle metadata.
- Third party tools (Ex : Post sharp, Mono ceil) are used to retrieve and manipulate metadata.
- Manifest is a text file that contains metadata about .NET assemblies.
Automatic memory management is one of the services
that the common language runtime provides during Managed Execution. The
common language runtime's garbage collector manages the allocation and
release of memory for an application. For developers, this means that
you do not have to write code to perform memory management tasks when
you develop managed applications. Automatic memory management can
eliminate common problems, such as forgetting to free an object and
causing a memory leak, or attempting to access memory for an object that
has already been freed. This section describes how the garbage
collector allocates and releases memory.
- Allocating Memory
- Releasing Memory
- Generation and Performance
- Releasing memory for Unmanaged Resource
Subscribe to:
Posts (Atom)