Click here to Skip to main content
15,898,035 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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
Posted

use the ascx filein the div tag or panel on the page to set the width and height.
like this :
XML
<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. :)
 
Share this answer
 
Comments
ravi0207 10-Feb-12 0:38am    
Hi Manish

Thanks for prompt reply, actually i am loading ascx file dynamically, below is my code to load file,

Dim ObjMedicalHistory As Object
ObjMedicalHistory = LoadControl("~/Controls/MedicalHistory.ascx")

ctrls.Add(ObjMedicalHistory)

How do i put this in div tag??

Regards
Ravi
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.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900