Click here to Skip to main content
12,299,109 members (48,950 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: C# ASP.NET
hi,

Pls some one tell that how and when we use interfaces in class in asp.net c#
like we want to create a login coding then i want to know how we generate and use ILogin interface in my asp.net c# programming.
Pls some one tell that how we create code in class file for ILogin Interface.

Thanks
Posted 11-Mar-12 20:47pm
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

  Permalink  
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 2

  Permalink  
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 3

.NET does not support multiple inheritances directly because in .NET, a class cannot inherit from more than one class. .NET supports multiple inheritances through interfaces.
for more..

Spam removed.
  Permalink  
v2
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 4

Hii buddy...

Interfaces allow you to program against a "description" instead of a type, which allows you to more-loosely associate elements of your software.

Think of it this way: You want to share data with someone in the cube next to you, so you pull out your flash stick and copy/paste. You walk next door and the guy says "is that USB?" and you say yes - all set. It doesn't matter the size of the flash stick, nor the maker - all that matters is that it's USB.

In the same way, interfaces allow you to generisize your development. Using another analogy - imagine you wanted to create an application that virtually painted cars. You might have a signature like this:

public void Paint(Car car, System.Drawing.Color color)...

This would work until your client said "now I want to paint trucks" so you could do this:

public void Paint (Vehicle vehicle, System.Drawing.Color color)...

this would broaden your app... until your client said "now I want to paint houses!" What you could have done from the very beginning is created an interface:

public interface IPaintable{
void Paint(System.Drawing.Color color);
}

...and passed that to your routine:

public void Paint(IPaintable item, System.Drawing.Color color){
item.Paint(color);
}

Hopefully this makes sense - it's a pretty simplistic explanation but hopefully gets to the heart of it.

taken by this link for more information go throw this link...
http://stackoverflow.com/questions/122883/interfaces-why-cant-i-seem-to-grasp-them[^]
  Permalink  
Comments
Marcus Kramer 25-Feb-13 9:00am
   
Please don't add answers to old questions like this that already have answers.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160525.2 | Last Updated 25 Feb 2013
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100