Link in validation summary message

后端 未结 6 1487
野性不改
野性不改 2020-12-20 17:33

Is it possible to put a HTML link in validation summary message? For example I want to put a link to another page in case there is validation error:

@Html.Va         


        
6条回答
  •  庸人自扰
    2020-12-20 17:39

    Finally I chose another way to do it: create a div containing the link etc. outside of validation summary, and add the div only if modelstate is not valid:

    @If Not ViewData.ModelState.IsValid Then
        @
    read more
    End If

    This is inspired by an answer to similar question.

提交回复
热议问题