I am creating a composite control that has a textbox and uses a jquery plugin to add a watermark. Lets say I have a bas开发者_运维问答ic function that looks like this
$(function () {$('#MyTextBoxID').watermark('Enter your username');});
Can anyone suggest what I need to do to insert the above?
TIA!
You can register a startup script and using it you can do following:
Dim cs As ClientScriptManager = Page.ClientScript
If (Not cs.IsStartupScriptRegistered(cstype, csname1)) Then
Dim cstext1 As String = "$(function () {$('#" & Me.ClientID & "').watermark('Enter your username');});"
cs.RegisterStartupScript(cstype, csname1, cstext1, True)
End If
精彩评论