1

partial view Department

<div>This is deva</div>
<div id="divRead"></div>

@section scripts
{
    <script src="~/Scripts/jquery-1.9.1.min.js"></script>
    <script>
        $(document).ready(function () {
            debugger;
            $('#divRead').html('<b>This is append debugger</b>');
        })
    </script>
}

Department Action in Account controller

public PartialViewResult Department()
        {
            return PartialView();
        }

Register.cshtml in Account controller

@Html.Partial("Department")

how to debugger the jquery in partial view.?

3
  • 2
    Developer console in Google Chrome Commented May 9, 2017 at 12:12
  • 1
    @koby Douek:- but partial view data cant display in google chrome Commented May 9, 2017 at 12:15
  • 1
    It doesn't work when in partial view I faced it too. I then kept the js file in main page then I debugged it. Later once I got my js stable I placed back to partial view. Commented May 9, 2017 at 13:00

1 Answer 1

2
<div>This is deva</div>
<div id="divRead"></div>

@section scripts
{
    <script src="~/Scripts/jquery-1.9.1.min.js"></script>
    <script>
        $(document).ready(function () {
            debugger;
            $('#divRead').html('<b>This is append debugger</b>');
        })
    </script>
}

give the debugger on where you want to debug. and run the application. after you have to inspect the chrome then it will display in VM3232 then we have to use the debug.

like below:enter image description here

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.