Click here to Skip to main content
Rate this: bad
good
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 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 at 25-Feb-13 9:00am
   
Please don't add answers to old questions like this that already have answers.
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  

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

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 6,532
1 OriginalGriff 5,976
2 CPallini 2,473
3 Richard MacCutchan 1,687
4 Abhinav S 1,550


Advertise | Privacy | Mobile
Web03 | 2.8.140821.2 | Last Updated 25 Feb 2013
Copyright © CodeProject, 1999-2014
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