从访问codebehind div标签 [英] Accessing a div tag from codebehind
本文介绍了从访问codebehind div标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在asp.net和c#的工作。我有一个类=东西
。我需要访问这个东西在我的应用程序中的 DIV
标签在codebehind.How类我可以做到这一点。
I am Working in asp.net and c#. I have a div
tag in my application with class="something"
.I need to access this something class in codebehind.How can i do that..
code
<div class="something">
//somecode
<div>
注意:我要访问的的东西类codebehind
Note:I want access Something class in codebehind.
推荐答案
给 ID
和属性 RUNAT =服务器
为:
<div class="something" ID="mydiv" runat="server">
//somecode
<div>
codebehind:
Codebehind:
您可以修改您的 的东西
这里的风格。
You can modify your something
styles here.
mydiv.Style.Add("display", "none");
这篇关于从访问codebehind div标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文