This is a migrated thread and some comments may be shown as answers.

Autocomplete fails after post in Asp.Net MVC

5 Answers 95 Views
AutoComplete
This is a migrated thread and some comments may be shown as answers.
Larry
Top achievements
Rank 1
Larry asked on 29 Jul 2020, 07:50 PM

I have a form with autocomplete the works fine until I post the form and it comes back. Then when entering data in the field, it does go to the server to filter, but does not show a dropdown.

Is there a way to reset the autocomplete on the form return?

5 Answers, 1 is accepted

Sort by
0
Larry
Top achievements
Rank 1
answered on 30 Jul 2020, 09:47 PM
This seems to have something to do with the returned view showing a Telerik Reporting Report on return.
0
Neli
Telerik team
answered on 31 Jul 2020, 11:39 AM

Hello Larry,

Attached you will find a sample project where the UI for ASP.NET MVC AutoComplete is used in a form. When the form is submitted the view is returned, but the AutoComplete does not disappear. Could you please try to modify the sample in order to replicate the behavior the way it is at your end and send it back to us? This way we could inspect locally and advise you further. 

Also as you mention Telerik Reporting I would like to ask you to confirm if the widget you are using is the UI for ASP.NET MVC AutoComplete or Telerik ASP.NET AutoCompleteBox. Please let me know if I am missing something.

Looking forward to your reply.

Regards,
Neli
Progress Telerik

0
Larry
Top achievements
Rank 1
answered on 31 Jul 2020, 11:57 PM

Hi Neli,

Thanks for the response. I have modified what you sent to be as much like my actual program as possible. It exhibits the same behavior as I have seen in my program.

I cannot upload the zip file as it is too large, so here is a link: https://www.dropbox.com/s/wwyy3l4io4lxsaf/Form_AutoComplete.zip?dl=0

Hope this helps,

Thanks,

Larry

0
Neli
Telerik team
answered on 04 Aug 2020, 01:39 PM

Hello Larry,

Thank you very much for providing a runnable sample.

After I have inspected the sample I would suggest you remove the following lines from your code:

 @section AddToBottom {
        <script src="@Url.Content("~/ReportViewer/js/telerikReportViewer.kendo-14.1.20.618.min.js")"></script>
        <script src="@Url.Content("~/ReportViewer/js/telerikReportViewer-14.1.20.618.min.js")"></script>
}

Here is a screencast of the behavior on my end after removing the scripts from above.

Referencing the telerikReportViewer script (marked in yellow below) is enough for the subset to be served by the Telerik Reporting REST service.

@section AddToHeadLast {
        <script src="@Url.Content("~/api/reports/resources/js/telerikReportViewer")"></script>
    }

I would also like to point out that currently when the Telerik Reporting is used along with Kendo, the recommended Kendo version is the one used in your application (2020.1.114)

I hope the provided information will help. In case you have additional questions please let me know.

Regards,
Neli
Progress Telerik

0
Larry
Top achievements
Rank 1
answered on 04 Aug 2020, 06:16 PM

That was the trick. Thank you so much.

This application has been around for years and many things have changed and some old things don't get removed.

Thanks again!

Tags
AutoComplete
Asked by
Larry
Top achievements
Rank 1
Answers by
Larry
Top achievements
Rank 1
Neli
Telerik team
Share this question
or