I'm using MVC.Net and my view with RGraph causes a second execution of that controller


« Back to message list

Enter your email address to get email updates on this topic. You can stop receiving updates by clicking the link in the update email messages.

Posted by John C on 10th January 2018
I use C# MVC.Net. Unlike older ASP.Net which had Master Pages, this uses a common Layout page where you normally put all your scripts. You can't do that with RGraph scripts. They have to be in the specific view where the charts are rendered or you get an error in the RGraph javascript.

However, wherever I have that code, the Controller gets executed twice. Normally, I've only seen this sort of duplication if you accidentally put validate.unobtrusive javascript in the View, as well as in the _Layout page. However, it's happening to me here. Obviously without the javascript there, you don't get your RGraph charts. Do you know a way around this issue?

- John C
Posted by Richard on 10th January 2018
Hi there,

No idea I'm afraid! I have no experience with C# or MVC.Net. Are you meaning that your C# controller gets executed twice if you add JavaScript? That seems a little strange to me since your C# is, presumably, running before any JavaScript.

Richard
Posted by John C on 10th January 2018
Yes, that's what I mean. Was hoping you might have a clue, or someone else on here.

- John C

Add a reply




« Back to message list