Posts

Showing posts from August, 2014

How to add an active class in navigation menu item in asp.net website?

How to add an active class in navigation menu item in asp.net website? Generally active class show which page /link you are visiting currently. Active class will be added in css class, but the problem is only one item can have active class at one time. But we need to show active class dynamically.

how to do url rewrite in C#.net. implemented in asp.net4.0 version

how to do url rewrite in C#.net. implemented in asp.net4.0 version

Url rewriting is just to display a friendly and readable url instead of a comlex or unfriendly url.

Suppose there is a url in your website just like below:

http://sharepointcafe.net/Page.aspx?userid=23456

The disadvantages of above mentioned url are:

1. This is not a friendly url.
2. The url does nt looks descent.
3. Last but the major thing is this url is not readable by Google and other search engine.

So, if your website contains url like above then there is no meaning of your content of that page because it will not be indexed by google.

So, how can it be avoid and how it can be re write in a seo friendly and readable url.

In asp.net 3.0 it was not an easy task to complete. But in asp.net4.0 it is very easy.

I am explaining this for asp.net 4.0 version.

First add a Global.asax file in your project.

Add the reference of System.Web.Routing in your project.
And then add this <%@ Import Namespace="System.Web.Ro…

Three tier architecture in ASP.Net using C# code

Image
3-Tier architecture is well known in software development for web and windows software.
3-Tier architecture contains UI (Presentation) Layer, Business Logic and Data Access Layer.

In below structure you can see- Program.cs is Presentation Layer (i.e. for User Input) BAL.cs - Business Logic, BO.cs - Business Entity DAL.cs - Data Access Layer

Lets see code one by one for 3 tier architecture.
Program.cs
namespace Practice {     class Program     {         static void Main(string[] args)         {             Program objP = new Program();             objP.InsertRecordFunction();             objP.PrintData();         }         private void PrintData()         {             Practice.BAL objBusinessLayer = new BAL();             objBusinessLayer.GetEmployeeRecord();         }         private void InsertRecordFunction()         {             BO objBusinessEntity = new BO();
            Console.WriteLine("Enter Login");             objBusinessEntity.Login = Console.ReadLine();
            Console.WriteLi…

How to send email to a user using workflow in SharePoint2010

How to send email to a user using workflow in SharePoint2010

Suppose there is a scenario that when ever you add a new item to a list in SharePoint site immediately an email should be sent to a specific member or user.
Here I will explain this scenario by using SharePoint designer 2010.
Please follow below steps:
1. Open SharePoint site in SharePoint designer. 2. File-New-Workflow  3. Once the dialog box opened then Enter the name of workflow and then select sharepoint list or library on which you want your workflow to be execute. and click Next. 5. Dont forget to select workflow start option, i.e. whether you want it to be started automatically or manually. 5. From Actions select send an Email. 6. Now click on this message, in the action that appears now. 7. Now in the new dialog box, enter the user email id in To box. 8. Then type a subject in subject box. 9. Now click OK.
Now, you can test your workflow by adding an item in list.