CodeVerge.Net Beta


   Explore    Item Entry   Register  Login  
Microsoft News
Asp.Net Forums
IBM Software
Borland Forums
Adobe Forums
Novell Forums




Can Reply:  No Members Can Edit: No Online: Yes
Zone: > NEWSGROUP > Asp.Net Forum > general_asp.net.faq_frequently_asked_questions Tags:
Item Type: NewsGroup Date Entered: 6/3/2007 1:17:37 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
NR
XPoints: N/A Replies: 3 Views: 41 Favorited: 0 Favorite
4 Items, 1 Pages 1 |< << Go >> >|
generalproblem
Asp.Net User
control placement6/3/2007 1:17:37 PM

0

Hello All,

 could anybody tell me how to exactly place a dynamically generated control in a webpage.

 for example, in a web page i have created a table,

and at a particular instance of time on a certain condition i need to place dynamically generated control in that table next to a given label's cell. How can i figure out which is that cell where i need to place the control.

thanks and Regards,

 General Problem

XIII
Asp.Net User
Re: control placement6/3/2007 1:29:44 PM

0

Hi,

you can place a PlaceHolder control in the cell where you want the dynamic controls to appear and in your code use:

PlaceHolder1.Controls.Add(instanceOfYourControl);

Grz, Kris.


Kris van der Mast [MVP] || 101 LINQ to SQL samples
generalproblem
Asp.Net User
Re: control placement6/4/2007 6:10:29 AM

0

Thank you VERY much Kris.

Primillo
Asp.Net User
Re: control placement6/4/2007 6:40:55 AM

0

Or using a table

In the html:

TD id="ContentsCell" runat="server"

In page load:

' Save DepartmentID from the query string to a variable

Dim departmentId As String = Request.Params("departamentoID")

If Not departmentId Is Nothing Then

Dim control As Control

control = Page.LoadControl("~/yourcontrol.ascx")

ContentsCell.Controls.Add(control)

End If

 


Best Regards
Primillo
4 Items, 1 Pages 1 |< << Go >> >|


Free Download:




   
  Privacy | Contact Us
All Times Are GMT