0

프로그래밍에 익숙하지 않아서 어리석은 짓이라면 미안하지만 ASP.Net MVC3 응용 프로그램을 작성하고 있습니다. 예외가 잡히면 복합 키 위]으로 인해 메시지가 표시됩니다.Entity Framework에 HTML 동작 링크 추가 코드 첫 번째 AddModelError 문자열

나는 예외를 잡을 수 있지만 메시지에서 키 위반 테스트에 실패한 데이터를 편집하기 위해 조치 링크를 추가하려고합니다.

다음 예에서는 링크를 사용하는 방법을 배울 수 없습니다. 액션 링크를 "여기"로 만들려면 어떻게해야합니까?

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 <a href=\"url\">HERE</a>"); 
      } 

지금까지 시도하는 것 :

  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"); 
       } 

덕분에 ...

답변

1

는이 같은 링크에 대한 오류를 바로 출력 원시 HTML을 변경 시도?

관련 문제