开发者

Adding jquery into a composite control

开发者 https://www.devze.com 2023-01-04 18:31 出处:网络
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

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



0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号