Passing Parameters To WebControls

ASPX consuming Control:

<%@ Page Language="C#" MasterPageFile="~/lib/mp/Interior.master" Inherits="AEPcomPage"
    Section="Investors" Title="" %>

<%@ Register Src="~/lib/uc/finance/FilingsGridControl.ascx" TagName="FilingsGridControl" TagPrefix="uc2" %>


<script runat="server">
    protected override void OnLoad(EventArgs e)
    {
        base.OnLoad(e);
        
        FilingsGridControl.DataToDisplay = "APCOData";         
        
    }
    
    
</script>

<asp:Content ID="c2" ContentPlaceHolderID="cphCol2"  runat="Server">
    <uc2:FilingsGridControl
        ID="FilingsGridControl1"
        runat="server"
        />
    
   
</asp:Content>

Control

<%@ Control Language="C#" ClassName="FilingsGridControl" %>
<%@ Import Namespace="System.Web.Mail" %>

<script runat="server">
   
    protected override void OnLoad(EventArgs e)
    {
        base.OnLoad(e);

        lblPagingInformation.Text = DataToDisplay;
    }

   static string sDataToDisplay;

    public static string DataToDisplay
    {
        get { return sDataToDisplay; }
        set { sDataToDisplay = value; }
    }   
 ...
..
.       
    

Also see Passing Parameters From Page (aspx) to WebControl (ascx) Where control exists in another project

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s