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.
Unfortunately, activation email could not send to your email. Please try again.

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

Thread ID:





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

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 01:51 AM

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.

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.