Avatar of Jyozeal
Jyozeal
Flag for United States of America asked on

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

Avatar of undefined
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.
SOLUTION
Bob Learned

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
ASKER CERTIFIED SOLUTION
jitendra patil

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes