You are here: > ESRI Forums > arcgis server forums > Thread Replies

ArcGIS Server Forums

ArcGIS Server .Net: Developing applications forum

AutoComplete   Bryan Pittman Dec 04, 2008
Re: AutoComplete   Michal Gasparovic Dec 04, 2008
Re: AutoComplete   Chris Jones Dec 10, 2008
Re: AutoComplete   Bryan Pittman Dec 12, 2008
Re: AutoComplete   Mohammed Rahman Dec 12, 2008
Re: AutoComplete   J H Dec 13, 2008
Re: AutoComplete   Chris Jones Dec 16, 2008
Re: AutoComplete   Ganeshmoorthi Mylsamy Apr 07, 2009
Re: AutoComplete   Smith T May 27, 2009
Re: AutoComplete   Pragnesh Patel May 27, 2009
Re: AutoComplete   Smith T May 27, 2009
Re: AutoComplete   Radik AkhmetzyanovRN Jun 26, 2009
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject AutoComplete 
Author Bryan Pittman 
Date Dec 04, 2008 
Message Has anyone been able to get auto complete working in their web application? I am trying to populate a search box as the user types with addresses from a parcel file, to be used in an address search. Ideally, I would like to auto complete the out of the box address search using a geocoding service. I have been able to set up a database connection and use the AJAX auto complete in a separate project with the code below. So maybe more than anything I need to find the code behind the out of the box address search to insert the following AJAX auto complete. Any help would be greatly appreciated. 
 
{
    [WebMethod]
    public string[] GetCountriesList(string prefixText)
    {
        DataSet dtst = new DataSet();
        SqlConnection sqlCon = new SqlConnection(ConfigurationManager.AppSettings["ConnectionString"]);
        string strSql = "SELECT Address FROM ShakopeeParcels WHERE Address LIKE '" + prefixText + "%' ";
        SqlCommand sqlComd = new SqlCommand(strSql, sqlCon);
        sqlCon.Open();
        SqlDataAdapter sqlAdpt = new SqlDataAdapter();
        sqlAdpt.SelectCommand = sqlComd;
        sqlAdpt.Fill(dtst);
        string[] cntName = new string[dtst.Tables[0].Rows.Count];
        int i = 0;
        try
        {
            foreach (DataRow rdr in dtst.Tables[0].Rows)
            {
                cntName.SetValue(rdr["Address"].ToString(), i);
                i++;
            }
        }
        catch { }
        finally
        {
            sqlCon.Close();
        }
        return cntName;
    }
}
 
   
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: AutoComplete 
Author Michal Gasparovic 
Date Dec 04, 2008 
Message I'm not sure if you will be ever be able to achieve that without having the source code... why not to develop your own control ? well, not necessarily a control, but own html element and use either ajax control toolkit, yahoo api, or prototype..there is many many samples on the net on how to do it.
not really helpful.sorry ;)
regarding your code, I'd probably serialize it in json...better than xml. But maybe my assumption that your service is returning an xml instead of json is wrong
[ScriptMethod(ResponseFormat=ResponseFormat.Json)]
 
   
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: AutoComplete 
Author Chris Jones 
Date Dec 10, 2008 
Message As Michal suggested we wrote our own User control using the Ajax autocomplete extender and just imbedded it into a custom ArcServer application.

It worked pretty well in allowing users to search on addresses, street names and local gpin account numbers.

If you would like some more info on how just reply to my post

I attached a screen shot below

Chris 
  norfolkair.JPG (opens in new window)
 
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: AutoComplete 
Author Bryan Pittman 
Date Dec 12, 2008 
Message Chris, your web application is exactly what I am looking to do, letting users search on address, street, or Parcel ID. Any help would be greatly appreciated. I have the AutoCompete working in a separate visual studio project using the AJAX autocomplete extender, I just have to figure out how to embed it in my ArcGIS Server application. Thanks.

Bryan 
   
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: AutoComplete 
Author Mohammed Rahman 
Date Dec 12, 2008 
Message You can use AJAX ControlToolkit Auto Complete sample to create the same thing:
http://www.asp.net/AJAX/AjaxControlToolkit/Samples/AutoComplete/AutoComplete.aspx

Download AJAX toolkit from here and also they have many many tutorial/help:
http://www.asp.net/ajax/ajaxcontroltoolkit/
 
  ========================================
M. Rahman

GIS JOBS : http://www.gisjobs.org/
Zip Code Map : http://www.aboutzipcode.com/
GPS Information: http://www.gpshacks.com/
========================================

 
   
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: AutoComplete 
Author J H 
Date Dec 13, 2008 
Message AJAX ControlToolkit Auto Complete Control can satisfy your requirement easily.refer to the samples that provided with the AjaxControltoolkit.:-D 
   
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: AutoComplete 
Author Chris Jones 
Date Dec 16, 2008 
Message For ease of install I built my autocomplete as a user control that I can easily drag into my applications as I use it in a number of different apps.

It has a custom hidden field that will allow you to capture what type of search it was that generated the user selected input. My search draws from a number of different databases.

I also try and identify what the user is searching on by parsing the string before looking in the databases to try and speed things up.

It is actually pretty fast on our systems. I am unable to outtype the search. I spent a lot of time tweaking it.

Included is the custom control and the web service .asmx.

The Autocomplete.vb file will have to reside in your App_Code directory. Just like the ajax example.

You will also need a script manager on the form as well that registers the service.






You'll have to fill in your own css classes though

-fish 
 
script manager code
<asp:ScriptManager ID="ScriptManager1" runat="server" >
        <Services>
        <asp:ServiceReference Path="AutoComplete.asmx" />
        </Services>
        </asp:ScriptManager>
 
  Search.zip (opens in new window)
 
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: AutoComplete 
Author Ganeshmoorthi Mylsamy 
Date Apr 07, 2009 
Message Hi,

We have tried to use AJAX autocomplete control in Web Mapping application(ArcGIS server 9.2, VS 2005,.Net framework 2.0), but it is not working. But the same control with floating panel is working fine in other asp.net projects. I have attached the sample code.

What i am trying is, i want put the autocomplete control in Web Mapping Application Floating panel. Any help will really appreciated.

Regards,
M. Ganeshmoorthi 
  AutoComplete_with_FloatingPanel.zip (opens in new window)
 
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: AutoComplete 
Author Smith T 
Date May 27, 2009 
Message HI Ganesh,

Did you solve your proble? If yes, can you share you experience with the updated code?

Thanks

Smith 
   
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: AutoComplete 
Author Pragnesh Patel 
Date May 27, 2009 
Message hi ,
try the following arcscript.
It has sample to use the search & Also Autocomplete for search box.

http://arcscripts.esri.com/details.asp?dbid=15471


Thanks
Pragnesh

 
  Pragnesh Patel 
   
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: AutoComplete 
Author Smith T 
Date May 27, 2009 
Message Thanks Pragnesh 
   
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: AutoComplete 
Author Radik AkhmetzyanovRN 
Date Jun 26, 2009 
Message I'm attempting to define a new Transverse Mercator projection using ArcGIS Server.
But it blows up exception - Error on server. (Exception from HRESULT: 0x80010105 (RPC_E_SERVERFAULT))
Thank's. 
 
int first_last_point = 0;

                string server = "ip";
                ESRI.ArcGIS.ADF.Identity ident =
                new ESRI.ArcGIS.ADF.Identity("user", "pswd", "domain");

                ESRI.ArcGIS.ADF.Connection.AGS.AGSServerConnection connection =
                    new ESRI.ArcGIS.ADF.Connection.AGS.AGSServerConnection(server,ident);
                connection.Connect();
                if (!connection.IsConnected) { throw new Exception("Unable to connect to server '" + server + "', make sure an ArcGIS Identity has been set."); }

                ESRI.ArcGIS.Server.IServerContext sc;
                sc = connection.ServerObjectManager.CreateServerContext("mapservice", "MapServer");
				ISpatialReferenceFactory2 pSpRFc1 = (ISpatialReferenceFactory2)
                    sc.CreateObject("esriGeometry.SpatialReferenceEnvironment");

                IProjectionGEN pProjection = (IProjectionGEN)pSpRFc1.CreateProjection(
                    (int)esriSRProjectionType.esriSRProjection_TransverseMercator);

                ILinearUnit pUnit = //(ILinearUnit)sc.CreateObject("esriGeometry.LinearUnit");
                    (ILinearUnit)pSpRFc1.CreateUnit((int)esriSRUnitType.esriSRUnit_Meter);

                IParameter[] aParamArray = pProjection.GetDefaultParameters();
				aParamArray[0].Value = 2300000.00;
                
                aParamArray[1].Value = -200.00;
                aParamArray[2].Value = 52.033;
                aParamArray[4].Value = 0.083;               
                aParamArray[3].Value = 1.0;
				
				IProjectedCoordinateSystem pProjCoordSys = (IProjectedCoordinateSystem)
                    sc.CreateObject("esriGeometry.ProjectedCoordinateSystem");
                    
                IProjectedCoordinateSystemEdit pProjCoordSysEdit =
                    (IProjectedCoordinateSystemEdit)pProjCoordSys;

                IGeographicCoordinateSystem pGCS1 = pSpRFc1.CreateGeographicCoordinateSystem
                    ((int)esriSRGeoCSType.esriSRGeoCS_Pulkovo1942);

                //IProjectedCoordinateSystemEdit pProjCoordSysEdit;
                object oname = "Transverse_Mercator";
                object name = "Transverse_Mercator";
                object alias = "Trans_Merc";
                object abbreviation = "TM";
                object remarks = "This PCS is Transverse Mercator";
                object useage = "When making maps of Tatarstan";
                object opGCS1 = pGCS1;// as object;
                object opUnit = pUnit; //as object;
                object opProjection = pProjection;// as object;
                object oaParamArray = aParamArray;// as object;
                  
				//error!!!				  
                pProjCoordSysEdit.Define(
                    ref oname, ref alias, ref abbreviation, ref remarks, ref useage, ref opGCS1, 
                    ref opUnit, ref opProjection, ref oaParamArray);