9 Years
Discussion Span
Last Post by dilipv

just create a usercontrol and create a table in it. drag and drop the usercontrol to your webform. without a webform(.aspx) you can not display usercontrols


The great thing about ASP.NET is just about everything can be turned into a control. But before you can have a control, you need to create a form runat the server (webform). Example:

<form runat="server">

Then, you can create just about anything as a server control by adding "runat='server'" to it. Certain controls turn into HTML code when spit out on the page from the server. A Datalist turns into a <table> element, a label turns into a <div> element, and so forth.

To display a table using a user control, either use a Datalist or just create a table and add the "runat='server'" code addition to it. Example:

<table border="0" cellpadding="0" cellspacing="0" width="100%" runat="server">

how can i display a table using user control

You have to create a user control and you can create table in it save the user control. and then from the toolbar you can directly drag and drop the user control on your web form or windows form.

hope this will help you out.

Thank you
.Net Consulting

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.