Showing posts with label ASP.NET. Show all posts
Showing posts with label ASP.NET. Show all posts

Sunday

.Net Core: What Is New In ASP.NET Core 2.0

Introduction

ASP.NET is the next evolution of Microsoft for the web pages that are supposed to be server driven. Rather than modifying and amending the ASP and adding new features and functionalities into it, new software called the ASP.NET has come up. It is completely and overhauls as it provides an interface for programming that lets the developers keep coding in an advanced way for the internet. These are the developers who are familiar with the concepts of Visual Basic as well as the other tools that are based on the development of relations between client and server. The most well-known providers of hosting services support the technologies that have a .NET extension; they support both ASP.NET core 2.0 and ASP.NET core 3.5.  The new .net core 2.0 features are also supported by these providers.

Things to know about the latest ASP.NET Core 2.0:

In the latest ASP.NET core 2.0 hosting those developers who have a past record of developing different stuff in the world of client and server are allowed for transferring their skills seamlessly to the web. Those developers and programmers who also have been writing programs in different languages including Java, Visual Basic, C++, etc. for the purpose of development on the internet are allowed for using the already existing components. This lets them keep working with their web pages of ASP.NET core and the web forms as well. In the latest release of ASP.NET, these functionalities have been enhanced to a great level.
What Is New In ASP.NET Core 2.0

New features added in ASP.NET core:

Support for Razor Pages

The support for Razor pages is one of the features that have been recently added to the functionality of ASP.NET core. MVC has the same features as the Razor pages.

New framework capabilities

The APIs, as well as the ability for referencing the complete Framework Libraries, has been expanded in the .NET core 2.0.

New OS addons

There is an expanded support of Operating System.

New Optimisations

Now .NET core is supported by the Visual Beginners All-purpose Symbolic Instruction Code. It allows the users to make console applications and the class libraries.

Csproj is the new game

The project files of xproj are to be replaced by the csproj’s new version.

Legacy Support

The MS builds have started working again in the new version.

New updates for visual studio

There are certain tooling enhancements done by Visual Studio 2017 in the new version of .NET.

Conclusion

You should keep over viewing ASP.NET Core 2.0, and its latest versions so that you do not miss out any of its new functionalities. Recently, the tools for developers and the integration of the database for the latest version of ASP.NET have also been designed in such a way that it becomes very easy to use. By following the easy steps, you can go for .net core 2.0 download and further explore about the software.

Suggested Reading

Saturday

MVC Compression: How to use GZIP Compression in ASP.net MVC

Introduction

GZIP compression can help to our website to reduce its bandwidth usage. In this article, we can incorporate GZIP feature in our MVC app. We can enable GZIP header through our website, alternatively we can also enable GZIP through our website IIS. Here describing, how to use GZIP compression in our ASP.net MVC app.

Already Discussed on ASP.Net MVC Security & Performance

Main benefits of GZIP compression are under below:

  • It helps to reduce sizes of our website pages.
  • It helps to increase speed of web pages.
  • It mounts to cost-benefit ratio high.

Namespace:

We need to add two namespaces before to write code of GZIP compression.

using System.Web.Mvc;
using System.IO.Compression;

Code of GZIP Compress under FilterConfig.cs

Write this code under FilterConfig.cs in App_Start folder of your MVC App.

public class CompressAttribute : ActionFilterAttribute
    {
        public override void OnActionExecuting(ActionExecutingContext filterContext)
        {

            var _encodingsAccepted = filterContext.HttpContext.Request.Headers["Accept-Encoding"];
            if (string.IsNullOrEmpty(_encodingsAccepted)) return;

            _encodingsAccepted = _encodingsAccepted.ToLowerInvariant();
            var _response = filterContext.HttpContext.Response;

            if (_encodingsAccepted.Contains("deflate"))
            {
                _response.AppendHeader("Content-encoding", "deflate");
                _response.Filter = new DeflateStream(_response.Filter, CompressionMode.Compress);
            }
            else if (_encodingsAccepted.Contains("gzip"))
            {
                _response.AppendHeader("Content-encoding", "gzip");
                _response.Filter = new GZipStream(_response.Filter, CompressionMode.Compress);
            }
        }
    }

Call Compress Attribute in MVC Controller

Now call Compress attribute on your controller action to get done this functionality in your MVC application.

Working Sample:

Here, I am showing statistics of my web page difference between zipped and unzipped webpage.

Unzip Webpage:

unzipped Webpage

Unzip Webpage

Requests 34
Size124 KB
Finish5.33s
DOContentLoaded617 ms
Load689 ms

Gzip Webpage:

Gzip Webpage
Gzip Webpage

Requests 34
Size123 KB
Finish1.36s
DOContentLoaded523 ms
Load582 ms

Finally, you can find difference between unzip and zip web pages. It is very required that your web pages should be Gzip enabled through IIS or visual studio project so that it will increase performance of your web pages in web browser (Chrome, IE, FF, Opera etc.). Here, I have explained how to use GZIP compression in ASP.net MVC app.

[Compress]
public ActionResult Index()
{
    /// write here your logic to pull data from database
    return View();
}

Conclusion

GZIP compression helps to our site pages and other resource files before sending them over to the program. This radically decreases exchange time since the documents are considerably littler. Here, I have explained how to use GZIP compression in asp.net MVC.

Tuesday

MVC Session: Asp.net mvc session management example

Introduction

In this example, showing how to use and validate session (HttpContext.Current.Session) in MVC application. In my earlier article, one of more secured feature to keep up your website healthy cross-site request forgery explained. MVC application has provided us facility to apply filter like
  1.  Authorization 
  2.  Action Filter 
  3.  Result Filter 
  4.  On Error Filter
I am here applying OnActionExecuting filter helps us to manage ASP.net MVC session management whether session is preserving or not, if session is expired, it will not let you access your authorised area and throw away to login area or someone page.
Asp.net mvc session management example

Add below code in FilterConfig.cs under App_Start folder

This code is written under OnActionExecuting in FilterConfig.cs file
public class UserSessionActionFilter : ActionFilterAttribute, IActionFilter
{
    public override void OnActionExecuting(ActionExecutingContext filterContextORG)
    {
        HttpContext ctx = HttpContext.Current;
        if (HttpContext.Current.Session["User"] == null)
        {
            /// this handles session when data is requested through Ajax json
            if (filterContextORG.HttpContext.Request.IsAjaxRequest())
            {
                JsonResult result = new JsonResult { Data = "Session Timeout!" };
                filterContextORG.Result = result;
            }
            else
            {
                /// If session is expired then redirected to logout page which further redirect to login page. 
            filterContextORG.Result = new RedirectResult("~/Main/Home/Logout");
                return;
            }
        }
}

In Global.asax Should register FilterConfig.cs

protected void Application_Start()
{
 AreaRegistration.RegisterAllAreas();
 WebApiConfig.Register(GlobalConfiguration.Configuration);
 FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
 RouteConfig.RegisterRoutes(RouteTable.Routes);
}

Checking Session is expired or not

We have to call action attribute [UserSessionActionFilter] in MVC controller to check whether session is preserving or not. If session is expired it will throw to other page.
[UserSessionActionFilter]
public ActionResult ContactDetail()
{
 return View();
}

Conclusion

This example is showing how to handle session in ASP.net MVC application. This example helps us to asp.net MVC session management example with all required steps.

Suggested Reading

Thursday

MVC Areas: Organizing an Application using Areas

Introduction

MVC architecture is inherently separated into three separate layers like Model (database), Presentation (UI, View), and Controller (Business layer). Releasing of MVC 2 introduces new feature of Area which provide solid capability to further separate files of file structure. Using with Area, we can define same controller in different areas to make our application more modular, manageable and robust. In this demonstration, I have used two areas Main (Public website) and blog area. In my earlier article, how to stop cross-site request forgery. I am explaining all steps how to organizing an application using areas in MVC.
mvc area

Why We Need MVC Areas

When we need multiple departments to maintain with different controllers even having with the same name in different areas. It makes our application more manageable, easy and maintainable to make our development faster.

Create a New MVC Project

First of all, create a new fresh project of MVC

create new project mvc area

New Project Crated

New project created for playing MVC feature of Area.

new project created

Create a New Area

Let’s now start to create a new area. Right click on project then move to Add >>> Area then provide a new relevant name of area.
Create mvc area

Creating Blog Area

Here typing relevant new area name like “Blog”.
type blog area name

Blog Area Created

Now you can see new created area “Blog” under the project.
Area Blog Created

Blog Area File Registration

You can see a new file crated of Blog Area Registration (BlogAreaRegistration.cs) under blog area.

public override string AreaName
{
    get
    {
 return "Blog";
    }
}

public override void RegisterArea(AreaRegistrationContext context)
{
    context.MapRoute("Blog_default",
        "Blog/{controller}/{action}/{id}",
 new { action = "Index", id = UrlParameter.Optional }
    );
}

Area Registration in Global.asax

Area registration is also done in Global.asax file.
public class MvcApplication : System.Web.HttpApplication
{
    protected void Application_Start()
    {
    AreaRegistration.RegisterAllAreas();

        WebApiConfig.Register(GlobalConfiguration.Configuration);
    FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
        RouteConfig.RegisterRoutes(RouteTable.Routes);
    }
} 

Main Area Creation

Next one new main area is crating in this section.
Main blog area created
Area Registration File Created
In the same way, as in blog area a registration file (MainAreaRegistration.cs) is also created.

public class MainAreaRegistration : AreaRegistration
{
 public override string AreaName
        {
        get
        {
            return "Main";
        }
    }

public override void RegisterArea(AreaRegistrationContext context)
    {
        context.MapRoute(
            "Main_default",
            "Main/{controller}/{action}/{id}",
            new { action = "Index", id = UrlParameter.Optional }
        );
    }

Create Home Controller for Main Area

Creating home controller under main area.
Home controller for main area

Create Home Controller For Blog

Alike main area, Home controller is also creating under blog area. Area feature let allow us to create same controller name to make our development more lucrative.
Home controller for blog area

Create View for Both Home controllers of Main & Blog

Here is creating view for Blog and main area.

@{
ViewBag.Title = "Index";
}
<h2>Welcome to Blog Area</h2>
<div> @Html.ActionLink("Back to Main", "Index", "Home", new { area = "Main" }, new { }) </div>
 Main Area View
@{ ViewBag.Title = "Index"; }
<h2>Welcome to Main Area</h2>
<div>
    @Html.ActionLink("Go to Blog", "Index", "Home", new { area = "Blog" }, new { })
</div>

Set Default Area/Controller/Action

Here, you can set your default area, controller and method to launch your application (landing page of your application). Before to set, you need to right click on project and click on properties to navigate on Web tab to set application default page (Area/controller/action).

Area Default Page

or Alternatively can set in RouteConfig.cs

Routes.MapRoute(
                name: "Default",
                url: "{controller}/{action}/{id}",
                defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional },
                namespaces: new[] { "slnMvcArea.Areas.Main.Controllers" }
            ).DataTokens.Add("area","Main");

Now Run your MVC area application

Finally run your MVC app to see how works MVC area feature.

welcome to main area

Navigate to Blog Area

Click on “Go to Blog” to navigate blog area.

welcome to blog area
Now you are on blog area, here is also a link to navigate “Back to Main”.

Conclusion

MVC areas helps us to make more manageable our MVC application to further divides into different files. In each area, we can define same controller like Main area contain “Home” Controller then also other areas can contain same area name “Home”, this code will compile perfectly even we have same controller name in different areas. Thus, it will help us to make large volume of applications with multiple departments so that can build awesome MVC apps with area feature. I tried here to demonstrates all necessary steps to organize an application using areas in MVC app.

Video: This video also demonostrates about Organizing an Application using Areas.

Saturday

.Net OOPS: OOPS interview questions

Introduction (OOPS)

OOPS Programming allows us to develop smaller to smaller logical modules, later we can integrate into one form of software. OOPS includes classes under that methods, entities, events, properties, modules etc. By creating objects can access data in OOPS programming. .Net framework supports only OOPS languages such as vb.net, c#, asp.net, C++ etc. In my earlier example, I have covered almost all MVC ASP.Net Interview Questions And Answers.

1) What is class in .Net OOPS Programming?

Access modifiers allows us to access its class members in different types like Public, Private, Protected, Internal, Protected internal, Static.
Class Inheritance allow us to do to access its base class information and behaviour. Colon image permits us to inherit its base class from derive class.
public class Furniture
    {
        //Fields, properties, methods, members, events, constructors, destructors etc.
    }

2) What is Class and Class Inheritance in OOPS Programming?

public class Furniture
    {
        //Fields, properties, methods, members, events, constructors, destructors etc.
    }
 Public class Sandal:Furniture
    {
        //Fields, properties, methods, members, events, constructors, destructors etc.
    }

3) What are objects in OOPS?

Objects are like variable those who enable to encapsulate data and behaviour
Furniture _obj = new Furniture();

4) What are the basic concepts of OOPS ?

Main top four main features of OOPS are as follows:
I) Abstraction:- In .net framework, abstraction enable to use multiple inheritance, with the access of abstraction can hide important data and show only important data to show user.
II) Polymorphism: It capable to use one form into multiple forms.
II) Encapsulation: We can say encapsulation is subset of abstraction. We can restrict user to show data with the use of encapsulation.
IV) Inheritance: While we are using inheritance there are two main parts one is derived class and other one is base class. Inheritance provides to capable our application to reuse our code and reduce code size.
oops main components
OOPS main components

5). Which of the following type of class allows only one object of it to be created?

  • Virtual class
  • Abstract class
  • Singleton class
  • Friend class

6). Which of the following statements is correct?

  • Base class pointer cannot point to derived class.
  • Derived class pointer cannot point to base class.
  • Pointer to derived class cannot be created.
  • Pointer to base class cannot be created.

7). Which of the following is not the member of class?

  • Static function
  • Friend function
  • Const function
  • Virtual function

8). Which of the following concepts means determining at run time what method to invoke?

  • Data hiding
  • Dynamic Typing
  • Dynamic binding
  • Dynamic loading

9). Which of the class’s instances themselves are classes?

  • Subclass
  • Abstarct Class
  • Metaclass
  • Object Class

10). Which of the following concept of oops allows compiler to insert arguments in a function call if it is not specified?

  • Call by value
  • Call by reference
  • Default arguments
  • Call by pointer

11). Which of the following cannot be friend?

  • Function
  • Class
  • Object
  • Operator function

12). Which of the following concepts of OOPS means exposing only necessary information to client?

  • Encapsulation
  • Abstraction
  • Data hiding
  • Data binding

13). Why reference is not same as a pointer?

  • A reference can never be null.
  • A reference once established cannot be changed.
  • Reference doesn't need an explicit dereferencing mechanism.
  • All of the above.

14) Initialise var to null in C# ?

  • var _myVal = (dynamic)null; 
  • var _myVal = (int32)null; 
  • var _myVal = (int)null; 
  • var _myVal = (string)null; 
  • None;

15) What is Mutable string in .Net framework OOPS? 

  • A mutable string state can't be change 
  • A mutable string state can be change 
  • None 

16) What is Immutable string in .Net framework OOPS?

  • A Immutable string state can't be change 
  • A Immutable string state can be change
  • None
Read More: Difference between mutable and immutable string in .Net framework

17) What is boxing ?

  • Object to value 
  • Value to object 
  • Both A and B 
  • None
int a = 123;
object o = a;  //boxing

18) What is unboxing ? 

  • Object to value 
  • Value to object 
  • Both A and B 
  • None
o = 123;
a = (int)o;  // unboxing
Read More: What is Boxing and Unboxing in .Net Framework

19) Which modifier is used to class as a sealed class? 

  • Protected 
  • Private 
  • Sealed 
  • None 

20) A sealed class cannot be used as a base class? 

  • Yes 
  • No 
  • None 

21) Can be use sealed class as an abstract class? 

  • Yes 
  • No 
  • None 

22) Can be use sealed class for inheritance?

  • No 
  • Yes 
  • None 

23) Can be structs considered like sealed class? 

  • No 
  • Yes 
  • None
public sealed class Csharp
{
    // Class members here.
}

24) Can we instantiate Interface class ? 

  • Interface can be instantiated 
  • Interface cannot be instantiated 
  • Both A and B 
  • None 

25) Does Interface class require inheriting ?

  • No 
  • Yes 
  • None 

26) Which keyword is used to class as a sealed class?

  • Protected 
  • Private 
  • Sealed 
  • None 

 27) Does Interface class support inheriting?

  • Yes 
  • No 
  • None 

28) Can Interfaces contain only the declaration of the members?

  • Yes 
  • No 
  • None 

29) Which keyword is required to make Interface class?

  • Keyword
  • Sealed 
  • Interface
  • None

30) Interface class can contains only properties, indexers, methods, delegates and events signature?

  • No 
  • Yes 
  • None 

31) Can we instantiate abstract class?

  • No 
  • Yes 
  • None 

32) Can be an abstract class as a sealed class?

  • No
  • Yes
  • None

33) Can be an abstract class inherited from more than one class?

  • No 
  • Yes 
  • None 

34) An abstract class can contain constructors and destructor?

  • No 
  • Yes 
  • None 

35) Can it an abstract method likely implicitly virtual method?

  • No 
  • Yes 
  • None

Conclusion (OOPS)

OOPS provides great capability with Re-usability, Inheritance, Data Hiding, Reduced complexity of a problem, Easy to Maintain and Upgrade, Modifiable and Message Passing to develop high quality software with cost cutting.

OOPS, IIS and Other ASP.Net Interview Questions and Answers:

SMS API: How to send SMS using C#

Introduction

SMS stands for Short Message Service is widely used to communicate to another mobile devices. Earlier, provided resolution to resolve issue Authentication the Server Response was 5.5.1 Authentication required in gmail, now today explaining how to send SMS using C#. We can send SMS up to 160 characters through our mobile devices. Long message can split up into small multiple parts automatically. On mobile device can send text message only. Here, I am exposing how to send text SMS (Short Message Service) using c# code.
  1. First of all. We need to create an URL to send text message on mobile device.
  2. We require web or IP address with parameters like username, password, recipient, senderid, text message and response etc.
  3. Parameters can vary depend on SMS provider service. Providers provide complete information to send SMS.
  4. Now we need to create web request to send SMS using C# code.
  5. We can also track response after sending text message on mobile device.
SMS API
Fig: SMS API

Code Snippet


public ActionResult SendSMSInCsharp()
{
    //we creating the necessary URL string:
    string _URL = "192.168.1"; //where the SMS Gateway is running
    string _senderid = "TESTTC";   // here assigning sender id 
            
    string _user = HttpUtility.UrlEncode("TestSMS"); // API user name to send SMS
    string _pass = HttpUtility.UrlEncode("123456");     // API password to send SMS
    string _recipient = HttpUtility.UrlEncode("9999999999");  // who will receive message
    string _messageText = HttpUtility.UrlEncode("testing sms..."); // text message

    // Creating URL to send sms
    string _createURL = _URL + 
    "username =" + _user +
       "&pass=" + _pass +
       "&senderid=" + _senderid +
       "&dest_mobileno=" + _recipient +
       "&message=" + _messageText;

    try
    {
        // creating web request to send sms 
        HttpWebRequest _createRequest = (HttpWebRequest)WebRequest.Create(_createURL);
        // getting response of sms
        HttpWebResponse myResp = (HttpWebResponse)_createRequest.GetResponse();
        System.IO.StreamReader _responseStreamReader = new System.IO.StreamReader(myResp.GetResponseStream());
        string responseString = _responseStreamReader.ReadToEnd();
        _responseStreamReader.Close();
        myResp.Close();
    }
    catch
    {
        //
    }
    return View();
}

Conclusion

SMS (Short Message Service) is now used across the world through mobile devices to instant communication medium. In this article, demonstrated explained all steps to send SMS using C# code. You can send SMS through this code in ASP.Net, MVC using C# code.

Suggested Reading

SQL Table Size: How to Get Database tables size in sql server

Introduction

In Last article, I have explained very known SQL Server Error 25 And 87, here going to fully explain how to get database tables size in SQL server. Tables stores information in rows and columns in database. I am here explaining how to check tables storage in SQL database. This is very important to check database tables storage to optimise our application performance. Explaining all steps to check our database tables storage in single command. Here, you can see how to get all database tables size with detail.

Solution I (Shows usage one by one table)

1. Open your SQL Server Management Studio and login into your database.
2. Now navigate to Query Analyser (Ctrl + N).
3. Then now write given T-SQL command select 'exec sp_spaceused ' + TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_TYPE = 'BASE TABLE' in query analyser.

database table list

4. Now copy all records from result window.
5. Again now open a New Query (Ctrl + N) Analyser and paste all records copied from result window.
6. Next select option from top toolbar Results to File (Ctrl + Shift + F).


7. Now hit button Execute (F5) from top toolbar to run T-SQL command to store all database tables storage stats into a report file (.rpt).
8. Now open file saved into your machine hard drive to check the database tables storage stats. This file contains given columns  name (name of table), rows (total rows in table), reserved (reserved space), data (stored data size), index_size (total indexed size), unused (shows unused data).

tables space used file

Solution II (Consolidated Database Usage)

1. Open your SQL Server Management Studio and Right click on Database.
2. Now navigate to Reports >> Standard Reports >> Disk Usage.

Disk Usage Report
3. You will see here showing consolidated data usage detail Total Space Usage, Data Files Space Usage, Transaction Log Space Usage with graphical representation.

Total Space Usage

Conclusion

Database is soul of our application so it requires well-tuned, managed and optimised to run our application superbly. Here, I have managed all steps to get database tables size in SQL server so that we can manage accordingly.

Relevant Reading

Sunday

Count Down Timer: Jquery Timer Countdown in MVC Application

Introduction

Timer countdown is very important in our web apps while we are restricting to end user within specified time frame for example apps online Quiz, online survey etc. Here, in this article I am explain in full depth, how to implement Jquery/JavaScript timer count down in our web apps.

Step 1:First of all add following time to start count down while open our MVC web app, here I am adding 2 minutes of time count down.

public ActionResult Index()
{
  if (Session["Rem_Time"] == null)
  {
     Session["Rem_Time"] = DateTime.Now.AddMinutes(2).ToString("dd-MM-yyyy h:mm:ss tt");
   }
   ViewBag.Rem_Time = Session["Rem_Time"];

   ViewBag.Message = "Modify this template to jump-start your MVC application.";
   return View();
}
Step 2: Add following div in Index page of our MVC apps _layout.cshtml page.

id timecountdown

Step 3: Add following script in our MVC web app which will display time (hour, minutes, secs).

Interval Time Count Down

Populating JavaScript Timer Count Down in MVC Web Application

Finally, you can see how populating JavaScript Timer Count Down in MVC Web Application. I hope it will help you all. 
MVC Timer Count Down

Conclusion

I have explained fully with step to step, how we can implement Jquery timer count down in our MVC web apps. If any queries then let me know, I am very happy to reply all of your queries.

Download Complete Project

Download

Suggested Reading

Saturday

RDLC reports in C#

Introduction

Here is disclosed in point of interest to create RDLC reports in C#, RDLC is great business insight (BI) instrument. RDLC is the best part to show reports in tabular form.

Step 1: Add new project, select Windows Desktop, then select Windows Forms Application and afterwards solution name and then lastly hit on OK button.

Create Solution for RDLC Report

Thursday

ArrayList in C#

Introduction

Today, I bet to throw light on ArrayList in C#. ArrayList has great feature because it can increase and decrease its size dynamically. ArrayList accepts also null value, moreover it allows to add duplicate values.

Namespace:

using System.Collections;
using System;

Saturday

Master And Content Pages in ASP.Net

ASP.Net Master Page’s application allows us to create a consistent layout of the UI. We can create a master page in asp.net application; moreover can create multiple content pages where ever we can display content.
Master page has a extension with .Master

Friday

Export Gridview to Excel in C#

Introduction

Everyday tons of millions data is manipulated in Excel/CSV across the world daily. I have manipulated data with Excel and CSV in ASP.Net (C#). Normally when we are showing data in Gridview, end user demand from development agency to manipulate data in Excel and CSV. To fulfill this requirement, I have provided best example how can we export data from Gridview to Excel and CSV. I have provide all steps to pull data into Excel/CSV as follows:

Saturday

How to Add FTP Site in IIS

Introduction

I am publishing another article on how to add FTP Site in IIS, who are newbie in IIS (Add FTP site in IIS). I have provided steps as below:

HTTP Error 503. The service is unavailable

Introduction

I have explained all main steps to resolve issue HTTP Error 503. The service is unavailable . When we are deploying our web application though IIS then sometime issue arise HTTP Error 503. The service is unavailable due to some features are not started through our IIS.


Step 1: I ran into issue  “HTTP Error 503. The service is unavailable” when I launched my website through IIS (internet Information Services). I ran website through IIS suddenly popup message me in browser i.e. “HTTP Error 503. The service is unavailable”.

Tuesday

Connection Timeout In IIS

Introduction

I have provided below few complete steps to adjust your connection timeout in IIS as following.

Step 1: Press Windows & run (Win + R) to open your IIS (Internet Information Services) or you can run from your program files also.

Saturday

MVC 4 Sample

Introduction

I have suggested below MVC 4 sample project step by step with snapshots attached as well.

Could not open a connection to SQL Server

Introduction

One day, I was attempting to connect with MS SQL Server but it didn't succeeded not even after making attempt once more and once more. I ran into error provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server on server. I'm providing you all necessary steps to resolve issue error: 40 - Could not open a connection to SQL Server. To succeed this issue, I would recommend to experience gave all strides one by one until your issue get resolve. This error comes out in many ways so that you need to check out all steps provided in this article until you succeed your issue.  

Detail Error Description:

A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1016


Sunday

Online Document Editing in ASP.NET C#

I got requirement to make document online. I started to look for third party controls, but this kind of requirement through third party very rare in across global market, only few solutions with third party solutions, I was some very specific requirement to fulfill this idea. I need to edit document online & save back to his earlier location. Here is www.stackoverflow.com question (http://stackoverflow.com/questions/1839616/online-document-editing-in-asp-net) question which is very close to this requirement. I have few most brilliant solutions as following:

Could not load file or assembly Microsoft.Practices.EnterpriseLibrary.Configuration.Design

Introduction

I am providing my best solution as following. I am much assure, you will fix your issue after going through given below steps.

Saturday

3 Tier Architecture in asp.net


Introduction

I am publishing next version 3 tier architecture article of asp.net 4.5, In asp.net c# 4.5 have some new up gradations to know when  working on 3 tier architecture,  I have provided key steps to know on 3 tier architecture asp.net 4.5 given below: