Irakli Lekishvili
Irakli Lekishvili

Reputation: 34198

asp.net mvc 3 razor and html iframe

I have page there is button which shows iframe where is small list with clickable rows like this:

<tr onclick="location.href = '@(Url.Action("Show", "Messages", new { id = item.FriendID }))'">

So my problem is when user click on tr Redirect is working but on i frame i want to redirect my parent page.

Upvotes: 0

Views: 1414

Answers (1)

Jeow Li Huan
Jeow Li Huan

Reputation: 3806

Instead of location.href, use top.href or parent.href

<tr onclick="top.href = '@(Url.Action("Show", "Messages", new { id = item.FriendID }))'">

Upvotes: 1

Related Questions