Hi, I’m in process of creating dlls for Web User Controls in ASP.NET v 2.0. Let me explain what exactly my problem is.
UserControl.ascx.cs to be wrapped into dll:
public partial class Controls_Search : System.Web.UI.UserControl
{
protected void Page_Load(object sender, EventArgs e)
{
Label1.Text = testMethod();
}
public string testMethod()
{
return "Yes Iam here " + Sample.testMethod1();
}
}
public class Sample
{
public static string testMethod1()
{
return "Only";
}
}
I’ve created the dll successfully with the name Search.dll. Also i referenced this dll inside my new project. Now, whenever I load this in my page, testMethod() is being called, consequently the output is "Yes Iam here Only". That’s cool. But I should be in a position to override Sample.testMethod1()Wrapped inside the dll with my project’s App_Code class say class1.cs.
This is my new class within the project in App_Code/Class1.cs.
public class Sample
{
public static string testMethod1()
{
return "Only1";
}
}
I also tried virtual & override with testMethod1() being defined as non-static member of that class. Nothing works.
My output should be: "Yes Iam here Only1"
Thanks in advance,
chandrasekar