【发布时间】:2011-06-11 22:05:48
【问题描述】:
我对编程很陌生,如果我很愚蠢,很抱歉,但我正在编写一个 ASP.Net MVC3 应用程序,如果捕获到特定异常,则会由于复合键违规而显示一条消息。
我可以捕捉到异常,但我想在消息中添加一个操作链接来编辑未通过密钥违规测试的数据。
我不知道如何在以下示例中使用链接。如何将“HERE”设为操作链接?
catch (DataException)
{
if (duplicateKeyAttempt == true)
{
ModelState.AddModelError("", "A delivery charge already exists for this combination of customer type and delivery method. " +
"Please check the information you have provided, this selection cannot be saved. " +
"If you want to edit the existing database entry, click HERE");
}
谢谢...
【问题讨论】:
标签: c# asp.net-mvc-3 entity-framework-4 code-first html.actionlink