Server tag in OnClientClick

前端 未结 4 1627
孤独总比滥情好
孤独总比滥情好 2021-01-05 02:03

The following gives me an error of \"The server tag is not well formed\"



        
4条回答
  •  星月不相逢
    2021-01-05 03:03

    The problem is the binding nugget and the use of single and double quotes.

    Delete
    

    Then on the code-behind add the function...

    Public Function CreateConfirmation(ByVal Username As String) As String
        Return String.Format("return confirm('Are you sure you want to delete {0}?');", Username)
    End Function
    

    When the binding nugget is used as the value for an attribute, you'll note you have to use single quotes. Your script also needed quotes for the embedded string parameter to the confirm function. You basically ran out of quotes.

自定义标题
段落格式
字体
字号
代码语言
提交回复
热议问题