We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Retrieving the value in an auto complete box after a post of the page

Thread ID:





105522 Nov 1,2012 08:25 PM UTC Nov 2,2012 05:51 AM UTC ASP.NET MVC (Classic) 1
Tags: Tools
Marc Oden
Asked On November 1, 2012 08:25 PM UTC

Is there a way to retrieving the value in an auto complete box after a post of the page?
An example that does not work follows:

// POST: /Organizations/DeleteOrganization

public ActionResult DeleteOrganization(string querystring)
    string errormessage = string.Empty;
    OrganizationModel om = null;

    if (!_provider.IsUserLoggedOn())
 return RedirectToAction("LogOn", "Account");

    AutocompleteTextBox myBox = (AutocompleteTextBox)ViewData["Organization"];

    // ******* This does not work *********************

    string orgid = myBox.Field("Value").ToString();
    if (string.IsNullOrEmpty(orgid))
 OrganizationProvider op = new OrganizationProvider();
 om = op.GetOrganizationByName(orgid, out errormessage);
 if (om != null)
     if (!om.Destroy(out errormessage))
  ModelState.AddModelError("", errormessage);
     om = null;
     ModelState.AddModelError("", errormessage);
 ModelState.AddModelError("", "No organization selected");

    return View(new OrganizationModel());





































Varalakshmi R.S [Syncfusion]
Replied On November 2, 2012 05:51 AM UTC

Hi Marc,


Thanks for contacting Syncfusion forums.


We suggest you to use the AutoComplete controls ID at the post for getting the selected value. Please refer the below code snippet,



@using (Html.BeginForm())





        <input type="submit" value="submit" />




        public ActionResult Index(string txtTest)



            return View();





We have also prepared a simple sample to show case this behavior and the same can be downloaded from the following link,


Kindly try the sample and let us know if it helps.





This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon