I have the following static method.
public static List GetAutoCompleteData(string StudentId)
{
List result = new
Dropdownlist object is non static member of your class (Web Page) and static methods can not access not static members. Pass the dropdownList value to static method when you call it.
Static Members
Static methods and properties cannot access non-static fields and events in their containing type, and they cannot access an instance variable of any object unless it is explicitly passed in a method parameter.
Static method definition
public static List GetAutoCompleteData(string StudentId, string dropdownvalue ) {
//Your code
}
Static method call
StaticMethodClass.GetAutoCompleteData("studendId", dropdown.SelectedValue);