jquery - Testing WebApi availability from Javascript or C# -


my asp.net mvc 4 website connects external webapi service. have page set baseaddress uri , consequently want know webapi service status everytime baseaddress changed.

i don't want page blocked while status if being checked.

i tried on controller side, need have api call async task, don't know how deplayed response.

so thought doing jquery ajax method.

my question : correct place ? , if on controller, how result ?

thanks

it makes sense on client side using jquery ajax method. think best practice client-side validation when can avoid round trips server. if understand trying do, validate user has entered valid base uri points them web api. validation can done on client jquery ajax long web api call make not update state information on server. have javascript functions associated success , error events on ajax method. if hits success function validation successful; if hits error function validation fails.


Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -