在asp.net中设置ClientID [英] Set ClientID in asp.net
本文介绍了在asp.net中设置ClientID的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否可以设置任何asp.net服务器控件的ClientID
?我该怎么办?
Is it possible to set the ClientID
of any asp.net server control? How can I do this?
推荐答案
The good news is that in VS 2010 .Net 4, you'll have complete control over Client IDs!
仍然可以使用.Net的当前版本,您可以付诸表决.我假设您需要JavaScript的ID.如果是这样,只需按以下方式获取ID:
Still for the current versions of .Net, you can make due. I assume you need the ID for JavaScript. If so, just get the ID like so:
<script type="text/javascript">
var myTextBox = $('#<%=TextBox1.ClientID%>');
</script>
这篇关于在asp.net中设置ClientID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文