Sunday, February 23, 2014

How to install new theme in wordpress

Introduction: In this article I will how we can install new theme in wordpress

Description:

To install/change theme in wordpress firstly login to your Wordpress admin. Now look for Appearance tab on left side and click on Themes. Theme page will be open, here you can see all the currently installed themes. To install new theme click on Install themes option as shown in attached snapshot:

Sunday, February 16, 2014

URL routing in asp.net website

Introduction: In this article today I will explain how we can implement  URL routing in asp.net website similar as done in asp.net MVC application.

Description:
In the previous article I have explained Populate Dropdown List dynamically using Asp.net MVC RazorCode First migration in asp.net MVC 4, Populate Cascading Dropdown List in Asp.net MVC4 using Json and Jquery and What is Asp.net MVC? Its advantages and disadvantges.

URL routing provide the SEO friendly and clean url for application. To implement the clean url functionality in asp.net application follow the given steps:

Step 1:
Go to Tools>>Library Package Manager>>Package Manager Console and type the below given command:

Install-Package Microsoft.AspNet.FriendlyUrls

After its installation you get a successfully added message. Now you see in your application RouteConfig.cs and Site.Mobile.Master page has been added. See attached snapshot:
 
URL routing
(Click To Enlarge)
In VB:
You see the RouteConfig file in C#. To implement the routing in VB application you have to add RouteConfig.vb file instead of RouteConfig.cs and write the code:
Imports System.Web.Routing
Imports Microsoft.AspNet.FriendlyUrls

    Public Shared Sub RegisterRoutes(routes As RouteCollection)
        Dim settings = New FriendlyUrlSettings()
        settings.AutoRedirectMode = RedirectMode.Permanent
        routes.EnableFriendlyUrls(settings)
    End Sub

Note: You can delete/exclude the Site.Mobile.Master and ViewSwitcher.ascx files if you want.

Step 2:
Add a Global.asax file to application. Write the following code to file:
using System.Web.Routing;

protected void Application_Start(object sender, EventArgs e)
        {
            RouteConfig.RegisterRoutes(RouteTable.Routes);
        }

In VB:
Imports System.Web.Routing

Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)
        RouteConfig.RegisterRoutes(RouteTable.Routes)
End Sub


Build the application, run and check the result.

Is this article helpful for you?

If yes post your comment to appreciate my work and fell free to contact me. You can like me on Facebook, Google+, Linkedin and Twitter via hit on Follow us Button and also can get update follow by Email.

Sunday, February 2, 2014

File Upload and save path to Database in asp.net MVC code first

Introduction: In this article today I am going to explain how we can File Upload and save path to Database in asp.net MVC code first

Description:

To upload image and save image path to database follow the below given steps:

Step 1:
 I have added Class to Model and name it FileUpload.cs:

using System.ComponentModel.DataAnnotations;

public class FileUpload
    {
        [Key]
        public int ID { get; set; }
        public string length { get; set; }

    }
After that add the Class to ProjectContext.cs.

public DbSet<FileUpload> FileUploads { get; set; }

How to add the class sees this article Create, Read, Update and Delete in Asp.net with MVC 4 Razor view Engine using Entity framework with Code first approach.