mgo config loaded

Adapted from ASPAlliance

Thanks to Douglass who submitted this where it explains on how to access Public variables/functions of a Dynamically created User control or custom control in ASP.net c#. Apologies if this post upsets anyone in infrignes anything. Please contact me to let me know if theres a problem.

Enjoy

——————————————————–

Title: Solution to accessing properties dynamically
Name: Daniel C. Douglass
Date: 5/20/2005 12:25:31 PM
Comment:
Class name of Custom Control: New_Vote
Public Properties (in New_Vote): DirectorName, VoteID
Custom Control Filename: New.Vote.ascx

The following code should be placed in the code-behind of the web form calling the user control:

//### load user control
Control c = LoadControl(“Controls/New.Vote.ascx”);

//### cast the generic control to be voting control
New_Vote Vote = (New_Vote)c;

//### set control properties
Vote.DirectorName = “Daniel C. Douglass”;
Vote.VoteID = 117;

TitlePanel.Controls.Add(Vote);
This should help everyone!

Thursday, 28 Aug 2008 11:54 am Leave comment RSS 2.0 Trackback

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>