<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-23769583</id><updated>2011-12-14T18:53:17.189-08:00</updated><title type='text'>ddw</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://provectus-solutions-ddw.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/23769583/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://provectus-solutions-ddw.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Provectus Developer</name><uri>http://www.blogger.com/profile/15587499175411016806</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>2</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-23769583.post-114381887657238154</id><published>2006-03-31T07:23:00.000-08:00</published><updated>2006-03-31T07:27:56.583-08:00</updated><title type='text'>More on devlist</title><content type='html'>Worked more on &lt;a href="http://www.devlist.com/"&gt;devlist&lt;/a&gt;. Added pages on &lt;a href="http://www.devlist.com/php.aspx"&gt;PHP&lt;/a&gt; and &lt;a href="http://www.devlist.com/java.aspx"&gt;java&lt;/a&gt;&lt;a&gt;.&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/23769583-114381887657238154?l=provectus-solutions-ddw.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://provectus-solutions-ddw.blogspot.com/feeds/114381887657238154/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=23769583&amp;postID=114381887657238154' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/23769583/posts/default/114381887657238154'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/23769583/posts/default/114381887657238154'/><link rel='alternate' type='text/html' href='http://provectus-solutions-ddw.blogspot.com/2006/03/more-on-devlist.html' title='More on devlist'/><author><name>Provectus Developer</name><uri>http://www.blogger.com/profile/15587499175411016806</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-23769583.post-114194873505112912</id><published>2006-03-09T15:57:00.000-08:00</published><updated>2006-03-09T16:06:40.876-08:00</updated><title type='text'>Using OOP to pass variables to ASP.NET user controls</title><content type='html'>Below is a simple example of using OOP to pass variables into ASP.NET user controls then creating the controls on post back. This code is currently used in &lt;a href="http://www.devlist.com/"&gt;http://www.devlist.com/&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;pre class="csharpcode"&gt;namespace DevList.Lists{using System;using System.Data;using System.Drawing;using System.Web;using System.Web.UI.WebControls;using System.Web.UI.HtmlControls;using System.Web.UI;&lt;br /&gt;/// &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;summary&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;///        Summary description for ShowList./// &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;summary&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;public class ShowList : System.Web.UI.UserControl{    protected System.Web.UI.WebControls.Label lblTitle;    protected System.Web.UI.WebControls.Label lblTable;    protected System.Web.UI.WebControls.Label lblDescription;&lt;br /&gt;    private string _Title;    private string _Description;    protected System.Web.UI.WebControls.Label lblPrintButton;    private string _List;    private string _TableName;&lt;br /&gt;    public string Title    {        get { return _Title; }        set { _Title = value; }    }&lt;br /&gt;    public string Description    {        get { return _Description; }        set { _Description = value; }    }&lt;br /&gt;    public string List    {        get { return _List; }        set { _List = value; }    }&lt;br /&gt;    public string TableName    {        get { return _TableName; }        set { _TableName = value; }    }&lt;br /&gt;    private void Page_Load(object sender, System.EventArgs e)    {&lt;br /&gt;        lblTitle.Text = _Title.ToString();        lblDescription.Text = _Description.ToString();&lt;br /&gt;        string szPrintHeader = _Title.ToString() + " - " + _Description.ToString();            Control cControlHolderPrintButton = this.FindControl("lblPrintButton");        //string szPrintButtonHTML = "&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;INPUT&lt;/span&gt; &lt;span class="attr"&gt;onclick&lt;/span&gt;=\&lt;span class="kwrd"&gt;"ShowTableInDocument('"&lt;/span&gt; +  &lt;span class="attr"&gt;_TableName&lt;/span&gt; + &lt;span class="kwrd"&gt;"','"&lt;/span&gt; + &lt;span class="attr"&gt;szPrintHeader&lt;/span&gt; + &lt;span class="kwrd"&gt;"');\"&lt;/span&gt; &lt;span class="attr"&gt;type&lt;/span&gt;=\&lt;span class="kwrd"&gt;"image\"&lt;/span&gt; &lt;span class="attr"&gt;src&lt;/span&gt;=\&lt;span class="kwrd"&gt;"Images/printer.gif\"&lt;/span&gt; &lt;span class="attr"&gt;value&lt;/span&gt;=\&lt;span class="kwrd"&gt;"Print\"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;td&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;";        string szPrintButtonHTML = "&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;INPUT&lt;/span&gt; &lt;span class="attr"&gt;onclick&lt;/span&gt;=\&lt;span class="kwrd"&gt;"ShowTableInDocument('"&lt;/span&gt; +  &lt;span class="attr"&gt;_TableName&lt;/span&gt; + &lt;span class="kwrd"&gt;"','"&lt;/span&gt; + &lt;span class="attr"&gt;szPrintHeader&lt;/span&gt; + &lt;span class="kwrd"&gt;"');\"&lt;/span&gt; &lt;span class="attr"&gt;type&lt;/span&gt;=\&lt;span class="kwrd"&gt;"button\"&lt;/span&gt; &lt;span class="attr"&gt;value&lt;/span&gt;=\&lt;span class="kwrd"&gt;"Print\"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;td&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;";        cControlHolderPrintButton.Controls.Add(new LiteralControl( szPrintButtonHTML ));&lt;br /&gt;        Control cControlHolder = this.FindControl("lblTable");        Control c2 = Page.LoadControl(_List);        cControlHolder.Controls.Add(c2);&lt;br /&gt;    }&lt;br /&gt;    #region Web Form Designer generated code    override protected void OnInit(EventArgs e)    {        //        // CODEGEN: This call is required by the ASP.NET Web Form Designer.        //        InitializeComponent();        base.OnInit(e);    }&lt;br /&gt;    /// &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;summary&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;    ///        Required method for Designer support - do not modify    ///        the contents of this method with the code editor.    /// &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;summary&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;    private void InitializeComponent()    {        this.Load += new System.EventHandler(this.Page_Load);&lt;br /&gt;    }    #endregion}}&lt;/pre&gt;&lt;p&gt;The object creation and enbedding is pretty simple:&lt;/p&gt;&lt;pre&gt;using System;using System.Collections;using System.ComponentModel;using System.Data;using System.Drawing;using System.Web;using System.Web.SessionState;using System.Web.UI;using System.Web.UI.WebControls;using System.Web.UI.HtmlControls;&lt;br /&gt;namespace DevList.Lists{/// &lt;summary&gt;/// Summary description for WebForm1./// &lt;/summary&gt;public class CSharp : System.Web.UI.Page{protected System.Web.UI.WebControls.Label lblControlHolder;protected System.Web.UI.HtmlControls.HtmlForm Form1;&lt;br /&gt;private void Page_Load(object sender, System.EventArgs e){// Put user code to initialize the page hereBuildTables(); //Leave in}&lt;br /&gt;private void BuildTables(){Control cControlHolder = Page.FindControl("lblControlHolder");&lt;br /&gt;ShowList slCSharpKeyWords = (ShowList) Page.LoadControl("Lists/ShowList.ascx");slCSharpKeyWords.Title = "C# Key Words Table";slCSharpKeyWords.Description = "Table of C# keywords and Descriptions";slCSharpKeyWords.List = "Lists/CSharpKeyWords.ascx";slCSharpKeyWords.TableName = "CSharpKeyWordsTable"; //Must match table name.  Will not show print screen correctly if not.cControlHolder.Controls.Add(slCSharpKeyWords);&lt;br /&gt;}&lt;br /&gt;#region Web Form Designer generated codeoverride protected void OnInit(EventArgs e){//// CODEGEN: This call is required by the ASP.NET Web Form Designer.//InitializeComponent();base.OnInit(e);&lt;br /&gt;}&lt;br /&gt;/// &lt;summary&gt;/// Required method for Designer support - do not modify/// the contents of this method with the code editor./// &lt;/summary&gt;private void InitializeComponent(){this.Load += new System.EventHandler(this.Page_Load);}#endregion}}&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/23769583-114194873505112912?l=provectus-solutions-ddw.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://provectus-solutions-ddw.blogspot.com/feeds/114194873505112912/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=23769583&amp;postID=114194873505112912' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/23769583/posts/default/114194873505112912'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/23769583/posts/default/114194873505112912'/><link rel='alternate' type='text/html' href='http://provectus-solutions-ddw.blogspot.com/2006/03/using-oop-to-pass-variables-to-aspnet.html' title='Using OOP to pass variables to ASP.NET user controls'/><author><name>Provectus Developer</name><uri>http://www.blogger.com/profile/15587499175411016806</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
