Bundle javascript in partial view to use as widget
Hi All,
I would like to create a small widget where it contains a search box a submit button and 3 labels and 3 texboxes for displaying employee name , email, phone number. So whenever employee id is entered and upon clicking submit button I would like to make an ajax call to my controller and get the details and fill the partial view. I do not want the ajax call in main view because that will not enable me to use it in other views.
How do I achieve this? Thanks for your time.
ASP.NETC#AJAX.NET ProgrammingWeb Applications
Last Comment
jitendra patil
8/22/2022 - Mon
Bob Learned
I am not sure what you are looking for, but you should be able to add the script reference in the parent view, and call the function in the partial view.
Jyozeal
ASKER
Thanks for your comment. In that case I will not be able to use it as unit. My intention is to use it in various views of my project by just inserting this partial view along the with script. I do not want each view to duplicate the code to load employee details in partial view.