Click here to Skip to main content
15,892,737 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I created a MVC 4 Web Application and using View and partial view. In my Web App when clicking on link to open partial view then it open perfectly but the problem occur when open a partial view with right click "open in new tab" then the main view content is not loaded and my layout is crash. How i can solve this problem?
Posted
Updated 25-Mar-14 23:25pm
v2
Comments
BELGIUMsky 26-Mar-14 5:43am    
Can't you make a view instead of using partial view?
Sampath Lokuge 26-Mar-14 5:47am    
Can you put the code snippets with related to your partial view and the button ?
littleGreenDude 27-Mar-14 8:51am    
You can't directly control this, because it's an option controlled by browser configuration. It may open as a tab, or as a new window.

Are you using something like

window.open('Home/MyPartialView', '_blank');
Guruprasad.K.Basavaraju 31-Mar-14 15:40pm    
Guess, you might have misunderstood the concept of Partial view here or I am mis reading your issue. Could you please post a code snippet ?
Vi(ky 1-Apr-14 4:01am    
here my code
On view
@Html.ActionLink("Roles", "showAllRole", "User")

On controller
[HttpGet]
public ActionResult showAllRole()
{
try
{
return PartialView();
}
catch (Exception ex)
{
return Json(new NotifyMsg { status = "error" , Msg = "Error" });
}
}

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900