私はプログラミングにかなり慣れていないので、ばかげている場合は申し訳ありませんが、特定の例外がキャッチされた場合に複合キー違反のためにメッセージが表示される 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");
}
ありがとう...