c# - Why I get error: are you missing a using directive or an assembly reference? -
i added c# code in aspx
file, showing error.
this code add asp file:
[system.web.services.webmethodattribute, system.web.script.services.scriptmethodattribute] public static string[] getcompletionlist(string prefixtext, int count) { string[] names = {"ram","ankit","sam","sahil","rajan","rahul","sajan"}; var nameslist = tmp in names tmp.tolower().startwith(prefixtext) select tmp; return names; }
i error:
compiler error message: cs1061: 'string' not contain definition 'startwith' , no extension method 'startwith' accepting first argument of type 'string' found (are missing using directive or assembly reference?)
here n declared in page:
<%@ import namespace="system" %> <%@ import namespace="system.io" %> <%@ import namespace="system.collections" %> <%@ import namespace="system.collections.specialized" %> <%@ import namespace="system.runtime.serialization" %> <%@ import namespace="system.text" %>
any idea how can fix error?
you forgot s in startswith
- startwith
.
Comments
Post a Comment