0

I have a pop up window which uses the following code to call an action method when a checkbox is checked:

window.location.href('@Url.Action("process", "wip")');

This works fine, but I also need the window to refresh itself when the checkbox is checked. So I added the following under the previous line:

window.location.reload(true);

But somehow this causes the first line to not call the action method at all. Are the two "window.location" lines tripping over each other or something?

Nathan R
  • 840
  • 5
  • 13
  • 32
  • Not clear what your trying to do here - `indow.location.href` redirects to another page so what would be the point of `window.location.reload`? –  Nov 12 '16 at 23:42
  • I was just trying to call that method. Other ways I tried didn't seem to work... what should I be using instead? All it is supposed to do is submit information to a DB, and I'm trying to make it refresh the window afterwards too. – Nathan R Nov 13 '16 at 00:32
  • `window.location.href('@Url.Action("process", "wip")');` does not _submit information to a DB_ (and you never use a GET to change data anyway). You have not explained what your trying to achieve in the question or shown any code so its difficult to understand what your really trying to do. –  Nov 13 '16 at 00:35
  • I can only guess that perhaps you want to update some data immediately when you click on your checkbox in which case, use ajax to post some data to a method which updates the database, and return a value indicating of successful or otherwise –  Nov 13 '16 at 00:38

0 Answers0