开发者

Prevent user from clicking html.routelink in MVC2?

I'm using a routelink and setting parameters based on what I get from my viewModel. I开发者_运维问答s there a way to prevent the user from even being able to click the link?


There is no way to prevent a user from clicking an hyperlink once it is on the page.Even there is, it doesn't make any sense. Maybe what you were trying to do was, render the link in view only on some conditions like this:

<% if(someCondition)
{
Html.RouteLink(
            item.Head,
            "Details",
            new
            {
              controller = "Article",
              action = "Details",
              id = item.ID
            });
}
%>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜