AutoComplete extender

G

Guest

I’m trying to figure out how I can achieve the followings:


While typing in a textbox, making a webservice call gets possible values
from DB in Autocomplete textbox. I need to validate that the user selection
is one of the value list in AutoComplete textbox. If not, I need to display
a warning message. Does anyone know how I can do this? I can do this by
customValidate controls. But how. Could you please give me code as
wellThanks in advance,
 
D

densial

I'm trying to figure out how I can achieve the followings:

While typing in a textbox, making a webservice call gets possible values
from DB in Autocomplete textbox. I need to validate that the user selection
is one of the value list in AutoComplete textbox. If not, I need to display
a warning message. Does anyone know how I can do this? I can do this by
customValidate controls. But how. Could you please give me code as
wellThanks in advance,

in the aspx

<asp:Label ID="lblRegion" runat="server"
AssociatedControlID="txtRegion" Text="region:" style="color: White" />
<conduit:TextBox ID="txtRegion" runat="server"
AutoPostBack="true" Width="200" />
<AjaxControlToolkit:AutoCompleteExtender ID="AutoRegion"
runat="server"
TargetControlID="txtRegion"
ServicePath="~/services/AutoComplete.asmx"
ServiceMethod="RegionSelectByCountryCode"
CompletionSetCount="12"
MinimumPrefixLength="1"
ContextKey="0" />
<asp:CustomValidator ID="valRegion" runat="server"
Text="please enter a valid region" />
<br />


in the .vb
(pseudocode because I use custom data component)

make storedprocedure("RegionSelectByRegion")
add parameter txtRegion.Text
try
dim oreader as reader = storedprocedure.executereader
valRegion.IsValid = oreader.read

Catch ex As Exception
End Try

hope this helps
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top