如何设置ASCX文件的高度和宽度 [英] How to set ASCX file height and width

查看:90
本文介绍了如何设置ASCX文件的高度和宽度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我已经创建了包含Gridview的ascx文件,加载到页面后其高度和宽度保持不变,如果有人提出建议,将不胜感激.

问候
Ravi

Hi
I have created ascx file contains Gridview, after loading into page its height and width remains constant, would be appreciated if anyone give some suggestion.

Regards
Ravi

推荐答案

使用div标签或页面上面板中的ascx文件设置宽度和高度.
像这样:
use the ascx filein the div tag or panel on the page to set the width and height.
like this :
<asp:Panel  ID="panelgrid" runat="server" ScrollBars="Auto"  style="overflow: auto; padding: 5px; width: 325px; height: 450px; ">
  <uc1:CategoryTree ID="ucCategoryTree" runat="server" />  </asp:Panel>


希望对您有帮助.
并且,如果有帮助,别忘了将其标记为答案. :)


Hope this will help you.
And don''t forget to mark as answer if it helps. :)


您可以在aspx页面中使用asp:PlaceHolder控件并设置其高度和宽度.然后在服务器端,您可以使用PlaceHolder的ID将用户控件加载到其中.
You can use a asp:PlaceHolder control in the aspx page and set its height and width. Then on the server side , you can use the id of PlaceHolder to load the user control into it.


这篇关于如何设置ASCX文件的高度和宽度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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