Nitish
Nitish

Reputation: 14113

Call jQuery function from controller in MVC

How can I call a jQuery function from a MVC controller?

I was looking at this answer but I am not sure what "page" means here.

Upvotes: 1

Views: 2367

Answers (2)

YD1m
YD1m

Reputation: 5895

You can't call js functions from mvc controller. But you can send messages from server side to client side that will rise events via websockets or server push technology.

Upvotes: 1

Oleksandr Kobylianskyi
Oleksandr Kobylianskyi

Reputation: 3370

Something strange about page for me too. I think that you can use SignalR library for your purpose. It allows to call javascript functions from client side inside controller and much much more cool things.

Upvotes: 1

Related Questions