How do I pass a server control's actual client Id to a javascript function?

前端 未结 6 617
鱼传尺愫
鱼传尺愫 2020-12-19 07:00

I have the following textbox server control in my web page:



        
6条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-19 07:12

    Put the <%= txtZip.ClientId %> between single quotes, to be like this:

    '<%= txtZip.ClientId %>'
    
    
    
    

    Update

    Please check this article: http://www.jagregory.com/writings/how-to-use-clientids-in-javascript-without-the-ugliness/

    Also I like this answer

提交回复
热议问题