Banner Ad

Monday, September 7, 2015

How to Hosting Asp.net MVC Web Application in Local Machine?

By Francis   Posted at   2:32 PM   IIS No comments

                     In this post I’m going to discuss about how to host an ASP.Net MVC Application in your  local machine. Most of the steps to deploy a web form application and MVC applications are equivalent.

Prerequisite:

           In order to explain the steps, I assume you have a complete ASP.Net MVC Application that is ready to build with out any error.

Step 1:

Publish you MVC application in a local file path, using publish option in Visual Studio.

publishOptionInVS

For this example, I have published my application in the below path like : C:\MVCDemo

ASPNETPublishedFiles

Step 2:

Create a Virtual directory in IIS and mapped the above published file path to it.

MVCAppVirtualDirectory

If you have any doubts in creating virtual directory refer my below blog posts:

Create virtual directory on IIS using Visual Studio.

Create Virtual directory on IIS

Step 3:

You are almost done! The only thing pending is you need to browse the website, that just published. This is where most of the ASP.Net developer (especially who is a newbie to ASP.Net MVC), what they were doing : Expand the Virtual directory –> Views –> Switch to content view –> select the cshtml file –> right click on it and click “Browse”, which throws 404 Error in browser.

BrowseMVCFile

404Error

 

The above issue is common to all ASP.Net developers, who are all comes with ASP.Net  WebForm background. In order to browse the  mvc application, you need to mention the path in the form like “http://localhost/YourControllerName/YourActionMethod", which is the url routing pattern specified by default.

 

ASPNetApplication

 

Hope this helps!

Thursday, September 3, 2015

Daily Interview Questions #15 : What is the difference between the C# keywords ‘ref’ and ‘out’?

By Francis   Posted at   5:26 AM   C# Interview Questions No comments

ref

out

Parameters passed with the prefix “ref”. By using “ref” C# implements the concept called “Call by reference”. Parameters passed with the prefix “out”.
An argument passed by ref must be assigned with a value before the call. ‘out’ parameter must assigned with some value prior to the termination of the function.

Tuesday, August 18, 2015

How to Send SMS From ASP.Net Web Application?

By Francis   Posted at   7:14 PM   SMS Gateways 20 comments
Disclaimer:
            In this article I have used a Third party SMS Gateway service provider, which is I have personally used and experienced.
Introduction:
                    In my previous article I explained SMS Gateways and the various schemes available for them. This article explains how to integrate those SMS gateways into an ASP.Net web application.
What a "SMS Gateway" is?
                   A SMS Gateway allows a computer to send or receive SMS to or from a telecommunications network. This Wikipedia URL provides more detail.
Some “facts” about SMS Gateways
                  When I did some experimentation and Googling of SMS gateways some of the tutorials suggested use of “free” SMS gateways. But nothing worked for me. Latter I understood that “Nothing comes free”. Also most people asked the same question: “Is there any free SMS service is available to send SMS from my website?”. In my experience the answer is no. So my point here is, don’t waste your time searching for the free API. Instead, find a well-suited SMS Gateway provider and sign up with them.

Sunday, July 26, 2015

Visual Studio Tips and Tricks-12 : Create ASP.NET 5 Website in Visual Studio 2015(Community Edition)

By Francis   Posted at   11:19 AM   Visual Studio Tips and Tricks No comments

1) Open Visual Studio 2015.

2) Select File –> New –> Project

3) In the “New Project” window, select Templates –> Visual C# –> ASP.NET Web Application. Give valid name and select location then click “OK”.

NewProject-Window

4) During this post, ASP.Net 5 is in Preview. So in the next screen you can see the “ASP.Net 5 Preview Template” and select “Website”.

TemplateWindow

5) That’s it! You have created ASP.Net 5 website. It looks like below:

ASPNet5_Website

 

Happy Coding!!!

Monday, June 29, 2015

Visual Studio Tips and Tricks–11 : Various ways to open Visual Studio IDE in Windows

By Francis   Posted at   10:51 AM   Visual Studio Tips and Tricks No comments

In my previous articles I have explained various of tips and tricks for Visual studio. In this post i ‘m going to explain various ways that are available to open the Visual Studio IDE.

 

Way #1:

Click the Start button and type “v” in the “search” box. It will listed the programs (including Visual Studio) and select the Visual Studio.

image

 

Way #2:

Click “Start” button and type “devenv” in “Search” box. “Devenv” is the short form for “Development Environment”, which denotes Visual Studio in Windows OS.

 

image

 

Way #3:

Windows 7 offers the concept called “pin and unpin the programs” in task bar. Just pin the Visual Studio in task bar as shown below. This is another shortcut to open VS in a quicker manner.

image

Connect with Us