Interface using in ASP.NET
Anybody can give me sample code or demo project of interface use in asp.net .
3 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Posted Jun 30, 2011, 3:36 AM EDT
bhahanan y7 reputationPosted Jun 30, 2011, 3:50 AM EDT
Felipe RamosRank #1,409 · 1.2K reputationPosted Jun 30, 2011, 4:23 AM EDT
public interface IExport
{
void Export();
}
public class ExcelExporter : IExport
{
public void Export()
{
}
}
public class HtmlExporter : IExport
{
public void Export()
{
}
}
If you had code that that works like this
public IExport GetExporter(ExportFormat format)
{
switch (format)
{
case ExportFormat.Excel:
return new ExcelExporter();
}
}
Than you can say
GetExporter(ExportFormat.Excel).Export(); and be sure that any class that implemented IExport will be exposing an Export function.