Using C# does anyone know how to build a list of Dynamic HTML links going down the page?
at the moment i'm using link buttons,but this is not very friendly when viewing the page on a mobile phone browser..Thanx in advance.
DataTable dtSite = GetSiteList(intTechId);
int i = 0;
foreach (DataRow row in dtSite.Rows)
strLink = getSiteName(Convert.ToInt32(row["SiteID"].ToString()));
TableRow tr = new TableRow();
TableCell tcLinkButton = new TableCell();
LinkButton linkButton = new LinkButton();
linkButton.ID = row["SiteID"].ToString();
linkButton.Text = strLink;
linkButton.Command += new CommandEventHandler(OnLinkClick);
linkButton.CommandName = row["SiteID"].ToString();
linkButton.CommandArgument = row["SiteID"].ToString();
You inherit a functionality. Interface does not gives you any kind of functionality. Even if I have a method say Sum in my interface, any class implementing it can write anything in the method definition. There is no way an interface can force you write code that will calculate sum if it has a method called sum.
It's not necessary to be so stupid, either, but people manage it. - Christian Graus, 2009 AD
If Dog class implements IDog interface, then you can do something like:
IDog dog = new Dog();
I think this is what you are asking. You cannot "call" an interface directly. However, you can use an instance of an interface type to call a method provided the instance points to an object that implements that interface.