|
Forums » .NET » ASP.NET »
|
Auto suggestion ajax in mobile webforms in vs 2005 |
Posted Date: 30 Jun 2012 Posted By:: siva Member Level: Bronze Member Rank: 3581 Points: 4
Responses:
1
|
Hi,
Am developing mobile application in visual studio 2005. I want to implement auto suggestion textbox in mobile application.
Am using ajax control in normal web application. But not in mobile applcaiton.
I don't know mobile application whether support ajax or not .
Please advise me freinds ....How to achieve auto suggestion feature in mobile application using ajax or any other (jquery,dojo script) methods.
Thank you
....siva....
|
Responses
|
#678222 Author: Rajasekar.K Member Level: Silver Member Rank: 417 Date: 30/Jun/2012 Rating:  Points: 4 | Hi Siva,
use this code,
i have given code below, download it.
ASPX Code :
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="SuggestionDropdown.aspx.vb" Inherits="SuggestionDropdown" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <script type="text/javascript" src="jquery-1.7.1.min.js"></script> <script type="text/javascript" src="jquery.searchabledropdown.js"></script> <html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server"> <title></title> <script type="text/javascript"> $(document).ready(function () { $("#myselect").searchable(); });
// demo functions $(document).ready(function () { $("#value").html($("#myselect :selected").text() + " (VALUE: " + $("#myselect").val() + ")"); $("select").change(function () { $("#value").html(this.options[this.selectedIndex].text + " (VALUE: " + this.value + ")"); }); });
function modifySelect() { $("select").get(0).selectedIndex = 5; }
function appendSelectOption(str) { $("select").append("<option value=\"" + str + "\">" + str + "</option>"); }
function applyOptions() { $("select").searchable({ maxListSize: $("#maxListSize").val(), maxMultiMatch: $("#maxMultiMatch").val(), latency: $("#latency").val(), exactMatch: $("#exactMatch").get(0).checked, wildcards: $("#wildcards").get(0).checked, ignoreCase: $("#ignoreCase").get(0).checked });
alert( "OPTIONS\n---------------------------\n" + "maxListSize: " + $("#maxListSize").val() + "\n" + "maxMultiMatch: " + $("#maxMultiMatch").val() + "\n" + "exactMatch: " + $("#exactMatch").get(0).checked + "\n" + "wildcards: " + $("#wildcards").get(0).checked + "\n" + "ignoreCase: " + $("#ignoreCase").get(0).checked + "\n" + "latency: " + $("#latency").val() ); } </script> <style type="text/css"> body { font-family: sans-serif; font-size: 13px; } h1 { font-size: 20px; } h2 { font-size: 16px; margin: 50px 0 8px 0; } h3 { font-size: 14px; } #myselect { border: 2px solid red; padding: 4px; font-weight: bold; text-transform: uppercase; background-color: #CCC; } </style> </head>
<body>
<form id="form1" runat="server"> <div> <asp:DropDownList ID="myselect" runat="server" AutoPostBack="true" > <asp:ListItem Text ="Aachener Stra" Value="1"></asp:ListItem> <asp:ListItem Text ="Abbestra" Value="2"></asp:ListItem> <asp:ListItem Text ="Barbarossastra" Value="3"></asp:ListItem> <asp:ListItem Text ="Berkaer Stra" Value="4"></asp:ListItem> <asp:ListItem Text ="Christophstra" Value="5"></asp:ListItem> <asp:ListItem Text ="Crivitzer Stra" Value="6"></asp:ListItem> <asp:ListItem Text ="Dahrendorfzeile" Value="7"></asp:ListItem> <asp:ListItem Text ="English" Value="8"></asp:ListItem> <asp:ListItem Text ="Aache" Value="9"></asp:ListItem> <asp:ListItem Text ="Danckelmannstra" Value="10"></asp:ListItem> <asp:ListItem Text ="Stra" Value="11"></asp:ListItem>
</asp:DropDownList> </div> </form> </body> </html>
Regards Rajasekar.K
jQueryDropdownSuggestions1.rar |
|
| Post Reply |
|
|
|
 | | This thread is locked for new responses. Please post your comments and questions as a separate thread. If required, refer to the URL of this page in your new post. |
|
|
|
|
 Follow us on Twitter: https://twitter.com/dotnetspider
|
|