Refinance now before rates go up! Get multiple rate quotes at GetMyLender.com.
Showing posts with label Dot Net. Show all posts
Showing posts with label Dot Net. Show all posts

Minify CSS and JS file using Visual Studio 2012

Before going on our main topic we have to discuss about one of the Dot Net feature i.e. Microsoft’s Web Optimization Framework. So, what is Web Optimization Framework and how to use this framework in Asp.net web form application? Microsoft’s (ASP.NET) Web Optimization Framework introduces a way to bundle and optimize CSS and JavaScript files.

If anyone wants to install Microsoft ASP.NET Web Optimization Framework, run the following command in the Package Manager Console of Visual Studio 2012.

C-Sharp Code to Check if Internet Connection is Available or Not

In some of our applications it is necessary to connect to Internet. So before connecting to Internet it is necessary to check, whether your application has Internet access.

May be you are thinking to solve this problem just by ping -ing to google.com or any websites. Yes this will work in most of the cases, and it is also a simple, good and important method. But as an Application developer it is not the best method to do that.

Difference between GET and POST Methods

In this article, we will discuss about difference between GET and POST Methods. So that it will usefull in your apllications.

GET Method ():

1) Data is appended to the URL.
2) Data is not secret.
3) It is a single call system.
4) Maximum data that can be sent is 256.

How To Create Best Tooltip Only Using HTML & CSS

Tooltip is used to describe information about anything which may on HTML pages. It is possible to create tooltip to show information about fields so that user will not be confused about what and how to enter correct data in fields.

Here is the general code to create tooltip design.

Difference between Library and Framework

A Library and a Framework are a set of classes, modules and/or code (depending on the programming language) that can be used in your applications.

Suppose you have to maintain log or debugging info in your applications, draw charts, create an specific file formats like .html, .pdf, .xls, connect to a data base, create applications using Design Patterns or simply create some/complete application etc.

These types of problems can be solved using Framework or a Library.

Get Current URL at Client Side Using JavaScript and jQuery

Sometimes it is necessary to know current URL, so that we will perform different operations on that or use that URL for various purposes. In this post, you will learn to get current URL from browser at client side using JavaScript and jQuery.


Using JavaScript

The window.location read-only property returns a Location object with information about the current location of the document.

What is the Difference between Ref and Out in c sharp with Examples

In this post we will learn about ref and out parameters in c# with examples. While looking forward, we have to know about ref and out parameters and how we can use it and where to use ? Both ref and out parameters are used to pass as an arguments to a method. Actually method can return zero or one value, so these parameters are very helpful whenever methods want to return more than one value.

So, what is the main difference between these both parameters?

Both parameters used for same purpose but ref parameter need to initialize it before passing to the method and out parameter you don’t need to initialize before passing to function. Here we will go in more detail by using examples.

Four Methods of Adding CSS to HTML

There are many more ways of adding a Cascading Style Sheet (CSS) to your Hyper Text Markup Language (HTML) document. In this tutorial I will explain the strengths and weaknesses of the four main methods.

* Adding Inline CSS to HTML tags
* Embedding CSS into the HTML
* Linking to a separate CSS file
* Importing a CSS file from within CSS

How to Increase Performance of Stored Procedures

When we fire SQL for the first time, three things happen:

• The SQL syntax is checked for any errors.
• The best plan is selected to execute the SQL (choice to use clustered index, non-clustered etc.).
• Finally the SQL is executed.

As in one of the article Mr. Shivprasad koirala says that Stored Procedures Do Not increase performance. Performance of inline parameterized SQL is the same as that of Stored Procedures. They had also proved why Stored procedure to be used.

Regular Expression in Dot Net Framework Part I - Character Escapes and Character Classes

A regular expression is a pattern that the regular expression engine attempts to match in input text. A pattern consists of one or more character literals, operators, or constructs.

Each section in this quick reference lists a particular category of characters, operators, and constructs that you can use to define regular expressions:

Regular Expression in Dot Net Framework Part V - Regular Expression Options and Miscellaneous Constructs

A regular expression is a pattern that the regular expression engine attempts to match in input text. A pattern consists of one or more character literals, operators, or constructs.


Regular Expression Options

You can specify options that control how the regular expression engine interprets a regular expression pattern. Many of these options can be specified either inline (in the regular expression pattern) or as one or more RegexOptions constants.

Regular Expression in Dot Net Framework Part IV - Alternation Constructs and Substitutions

A regular expression is a pattern that the regular expression engine attempts to match in input text. A pattern consists of one or more character literals, operators, or constructs.


Alternation Constructs

Alternation constructs modify a regular expression to enable either/or matching. These constructs include the language elements listed in the following table.

Regular Expression in Dot Net Framework Part II - Anchors Grouping and Constructs

A regular expression is a pattern that the regular expression engine attempts to match in input text. A pattern consists of one or more character literals, operators, or constructs.


Anchors

Anchors, or atomic zero-width assertions, cause a match to succeed or fail depending on the current position in the string, but they do not cause the engine to advance through the string or consume characters. The metacharacters listed in the following table are anchors.

Regular-Expression-in-Dot-Net-Framework-Part-III-Quantifiers-and-Backreference-Constructs

A regular expression is a pattern that the regular expression engine attempts to match in input text. A pattern consists of one or more character literals, operators, or constructs.


Quantifiers

A quantifier specifies how many instances of the previous element (which can be a character, a group, or a character class) must be present in the input string for a match to occur. Quantifiers include the language elements listed in the following table.

What is AutoEventWireup attribute and its use in ASP.NET ?

AutoEventWireup attribute in ASP.NET

AutoEventWireup is an attribute of the @ Page directive. The AutoEventWireup attribute may have a value of true or false. The value is set to false when you create a new ASP.NET Web Application.

This article describes what is AutoEventWireup attribute and its use in ASP.NET. This article also describes some of the options of this attribute by using coding and examples of the ASP.NET Web Forms code that is written in Microsoft Visual C# .NET.

You can specify a default value of the AutoEventWireup attribute in several places:
1) The Machine.config file
2) The Web.config file
3) Individual ASP.NET Web Forms (.aspx files)
4) Web User Controls (.ascx files)

Difference between Int32.Parse(), Convert.ToInt32() and Int32.TryParse() in C#

In this article, we will discuss what are the differences between Int32.Parse(), Convert.ToInt32() and Int32.TryParse() in C# and when and which will be useful in programs.

As you are already known about int in C#. It is used to hold integer value in memory which represents a 32-bit signed integer. While coding many times you come across int, Int16, Int32, Int64. int and Int32 are likely to be same.
All these are stuct type means value type/premetive type.
int => System.Int32 and Represents a 32-bit sigened integer.
Int16 => System.Int16 and Represents a 16-bit sigened integer.
Int32 => System.Int32 and Represents a 32-bit sigened integer.
Int64 => System.Int64 and Represents a 64-bit sigened integer.

Singleton Pattern In C Sharp

What is Singleton Pattern ?

Singleton pattern is one of the simplest design patterns. This pattern ensures that a class has only one instance and provides a global point of access to it.

History of Design Patterns :

Singleton pattern falls under Creational Pattern of Gang of Four (GOF) Design Patterns in .Net.

In 1994, four authors Erich Gamma, Richard Helm, Ralph Johnson and John Vlissides published a book (Design Patterns : Elements of Reusable Object-Oriented Software) for explaining the concept of Design Pattern in Software development. These four authors are collectively known as Gang of Four (GOF).

The 23 Design patterns are defined by the Gang of Four programmers. These 23 patterns are divided into three groups depending on the nature of the design problem they intend to solve.

Groups are 1) Creational Design Patterns 2) Structural Design Patterns 3) Behavioral Design Patterns.

Out of these three groups, singleton is the Creational Design Patterns.

Differences between Stored Procedure and User Defined Function in SQL Server

Stored Procedure is a group of SQL statements that has been created once and stored in server database. It’s pre-compile objects which are compiled for first time and its compiled format is saved which executes (compiled code) whenever it is called. Stored procedures will accept input parameters so that single stored procedure can be used over network by multiple clients using different input data. Stored procedures will reduce network traffic and increase the performance.

Benefits of Stored Procedures
- Precompiled execution
- Reduced client/server traffic
- Efficient reuse of code and programming abstraction
- Enhanced security controls

Difference Between SQL And PL/SQL

SQL pronounced as a sequal which is stands for Structured Query Language. With the help of SQL, you can view data using Data Definition Language (DDL) Commands as well as manipulate data using Data Manipulation Language (DML) Commands.

PL/SQL stands for Procedural Language/Structured Query Language. It is the Oracle’s procedural extension of SQL, is an advanced fourth-generation programming language (4GL). It offers software-engineering features such as data encapsulation, overloading, collection types, exceptions, and information hiding. PL/SQL also supports rapid prototyping and development through tight integration with SQL and the Oracle database.

A potentially dangerous Request.Form value was detected from the client in asp.net

A few days ago, while working on an ASP.NET 4.0 Web project, I got following issue.

“A potentially dangerous Request.Form value was detected from the client…..”

This issue occurred when I tried to enters some non-encoded HTML content as a product details into the rich textbox.

e.g.: “<p>Hello</p>”

After enter the above html data in Rich Textbox and I tried to insert data then I got error message like