如何从aspx.cs添加一个HTML属性 [英] How to add a HTML attribute from an aspx.cs

查看:472
本文介绍了如何从aspx.cs添加一个HTML属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要动态改变这个元素的宽度。所以我想从一个aspx.cs文件添加一个宽度=属性。我该怎么做?

 < MyControl:图形ID =Graph1=服务器HEIGHT =510px>< / MyControl:图形>


解决方案

Graph1.Width = 500; 可能就够了。

I need to change the width of this element dynamically. So I want to add an width="" attribute from an aspx.cs file. How can I do that?

<MyControl:Graph id="Graph1" runat="server" Height="510px"></MyControl:Graph>

解决方案

Graph1.Width = 500; will probably suffice.

这篇关于如何从aspx.cs添加一个HTML属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆