Click here to Skip to main content
15,886,799 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi everyone, i'm trying to insert an autocomplete text box in my vb.net web application and i found some answers on forums after having googled but here is my problem.
When i try to add the AutoComplete page method i get this error " Cannot create page method "GetCompletitionList" because No CodeBehind or Codefile was found!"
There is a fix i found much interesting but my browser's history is now 10 miles long and i don't know exactly on which website i found it, i send the link as soon as i figure it out.
I'm new at Asp.Net and using VB.Net and after having tried most of fixes i found on the net i got no result.
Can someone help please?
Tell where to put the source codes in your answers please, thanks a lot.
Found the website, here is it :https://ajaxcontroltoolkit.codeplex.com/wikipage?title=Displaying%20a%20Simple%20Auto-Complete%20TextBox&referringTitle=AutoComplete%20Control[^]
Posted
Comments
jkirkerx 13-Nov-14 17:21pm    
Nobody really uses the ajax control toolkit anymore. It was sort of replaced by JQuery about 2 or 3 years ago.

You have to go to design view of your webform, where you placed your textbox.
Make sure you added the autocomplete extender to the textbox

Then click on that little symbol in the upper right hand corner of the textbox
and add the page method.

With the new page method loaded, copy the function code into the page method.
Make sure you copy the first 2 lines as well, because this completes the function so that it works.
<system.web.services.webmethodattribute(),>
Public Shared Function GetCompletionList(ByVal prefixText As String, ByVal count As Integer, ByVal contextKey As String) As String()
	' Create array of movies
	Dim movies() As String = {"Star Wars", "Star Trek", "Superman", "Memento", "Shrek", "Shrek II"}

	' Return matching movies
	Return (
	    From m In movies
	    Where m.StartsWith(prefixText,StringComparison.CurrentCultureIgnoreCase)
	    Select m).Take(count).ToArray()
End Function


You should be able to press [F5] and it will work.
 
Share this answer
 
Thanks for answering.

Quote:
Make sure you added the autocomplete extender to the textbox

Then click on that little symbol in the upper right hand corner of the textbox
and add the page method.

That's where i have trouble because when it try to add the page method, it prompts me that error. I don't know where to put that codebehind or codefile, i don't even know what it is.
 
Share this answer
 
Comments
Shweta N Mishra 14-Nov-14 3:36am    
this is not solution reply to the answer instead of creating another solution to avoid down voting.
Member 11230232 15-Nov-14 7:59am    
Quote:
Make sure you added the autocomplete extender to the textbox

Then click on that little symbol in the upper right hand corner of the textbox
and add the page method.

That's where i have trouble because when it try to add the page method, it prompts me that error. I don't know where to put that codebehind or codefile, i don't even know what it is.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900