Reputation: 8646
I want to render the page when i click on particular div.
For that i written div as:
<div id="idFlip" onclick="javascript:renderPages();">
-----------content---------------------
</div>
written javascript function as:
function renderPages()
{
alert("Inside");
@RenderPage("~/Views/PP/Teacher_Observation.cshtml");
}
But its showing me that page while the page itself is load.(i.e. showing me both views current one and Teacher_Observation.cshtml
Its not showing me on div click.
What can i do???
Please help me.
I want to render page on click of div through javascript function
Upvotes: 0
Views: 197
Reputation: 14618
You could render the view on page load inside of a hidden div e.g:
<div id="idFlip">
<div id="i-am-the-view" style="display:none">
I am some hidden content
</div>
</div>
And then in Javascript/jQuery:
$(document).ready(function(){
$('#idFlip').click(function(){
$('#i-am-the-view').toggle();
});
});
Upvotes: 1