Hi all, I'm trying to set a table style property in a user control called dnrreesfooter.ascx. I have dragged and drop the control onto my login.aspx page. I've looked at multiple posts to try and glean what my issue is - to no avail. I want to set a property
in dnrreesfooter called topposition1. I can't get to the property from the login.aspx page. Any thoughts? Coding is as follows: /////////////////// dnrreesfooter.ascx ///////////////// Public Class DnrReesFooter Inherits System.Web.UI.UserControl Private topposition
As String #Region " Web Form Designer Generated Code " 'This call is required by the Web Form Designer. Private Sub InitializeComponent() End Sub Protected WithEvents HyperLink4 As System.Web.UI.WebControls.HyperLink Protected WithEvents HyperLink1 As System.Web.UI.WebControls.HyperLink
Protected WithEvents HyperLink3 As System.Web.UI.WebControls.HyperLink Protected WithEvents HyperLink2 As System.Web.UI.WebControls.HyperLink Protected WithEvents HyperLink5 As System.Web.UI.WebControls.HyperLink Protected WithEvents HyperLink6 As System.Web.UI.WebControls.HyperLink
Protected WithEvents HyperLink7 As System.Web.UI.WebControls.HyperLink Protected WithEvents HyperLink8 As System.Web.UI.WebControls.HyperLink Protected WithEvents HyperLink9 As System.Web.UI.WebControls.HyperLink Protected WithEvents Hyperlink10 As System.Web.UI.WebControls.HyperLink
Protected WithEvents ReesFooter As System.Web.UI.HtmlControls.HtmlTable 'NOTE: The following placeholder declaration is required by the Web Form Designer. 'Do not delete or move it. Private designerPlaceholderDeclaration As System.Object Private Sub Page_Init(ByVal
sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init 'CODEGEN: This method call is required by the Web Form Designer 'Do not modify it using the code editor. InitializeComponent() End Sub #End Region Private Sub Page_Load(ByVal sender
As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 'Put user code to initialize the page here End Sub Public Property topposition1() As String Get Return topposition End Get Set(ByVal Value As String) topposition = Value ReesFooter.Style.Item("TOP")
= topposition End Set End Property End Class ///////////////////////// Login.aspx //////////////////////// vb code is.... Imports System.Data Imports System.Data.SqlClient Imports System.Web.Security Public Class Login Inherits System.Web.UI.Page #Region "
Web Form Designer Generated Code " 'This call is required by the Web Form Designer. don't think it's important as it defines my stored proceedures and such... Protected WithEvents panel1 As System.Web.UI.WebControls.Panel Protected WithEvents Panel2 As System.Web.UI.WebControls.Panel
Protected WithEvents tb_InstrNbr As System.Web.UI.WebControls.TextBox Protected WithEvents tb_ssn As System.Web.UI.WebControls.TextBox Protected WithEvents ValidationSummary1 As System.Web.UI.WebControls.ValidationSummary Protected WithEvents rfv_InstrNbr
As System.Web.UI.WebControls.RequiredFieldValidator Protected WithEvents RegularExpressionValidator1 As System.Web.UI.WebControls.RegularExpressionValidator Protected WithEvents RegularExpressionValidator2 As System.Web.UI.WebControls.RegularExpressionValidator
Protected WithEvents RequiredFieldValidator1 As System.Web.UI.WebControls.RequiredFieldValidator Protected WithEvents Submit1 As System.Web.UI.HtmlControls.HtmlInputButton Protected WithEvents StatusBarPanel1 As System.Windows.Forms.StatusBarPanel Protected
WithEvents sqlcon_rees As System.Data.SqlClient.SqlConnection Protected WithEvents sqlcmd_authenticateinstructor As System.Data.SqlClient.SqlCommand Protected WithEvents sqlcmd_SelectInstData As System.Data.SqlClient.SqlCommand Protected WithEvents dnrreesfooter
As System.Web.UI.UserControl 'NOTE: The following placeholder declaration is required by the Web Form Designer. 'Do not delete or move it. Private designerPlaceholderDeclaration As System.Object Private Sub Page_Init(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles MyBase.Init 'CODEGEN: This method call is required by the Web Form Designer 'Do not modify it using the code editor. InitializeComponent() End Sub #End Region Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles MyBase.Load 'Put user code to initialize the page here ~~~~~~~~~ NOTE: I know I need to set the property here and I'm thinking something like: me.dnrreesfooter.topposition1 = "500" but this doesn't work.... :o/ ~~~~~~~~~~ End Sub here's its HTML....
Hope this helps and I hope to get some.... ;o) Thanks!
Priya, Thanks for your reply. Unfortunately when I make that substitute I get this error msg: Type 'projectname.dnrreesfooter' is not defined. When I've attempted to set the property in the login.aspx with my old declaration I get (codeded in the Load event):
Me.dnrreesfooter.topposition1 = "400" I get this error: 'topposition1' is not a member of 'System.Web.UI.UserControl'. So, basically I'm stumped as I've looked at Jim Ross' replies to others and I'm making the same type of declaration as he suggested, but
it doesn't fly for some reason.... :o/
did u type "projectname" string itself? what i meant is u've to write u'r application name there. say if u r developing webapplication1 then it shld be webapplication1.dnrreesfooter
MiGovUser
Participant
800 Points
160 Posts
Setting UC property from holder page - can't do it
Aug 25, 2003 03:25 PM|LINK
Priya Sriniv...
Member
175 Points
35 Posts
Re: Setting UC property from holder page - can't do it
Aug 25, 2003 05:59 PM|LINK
MiGovUser
Participant
800 Points
160 Posts
Re: Setting UC property from holder page - can't do it
Aug 25, 2003 07:05 PM|LINK
Priya Sriniv...
Member
175 Points
35 Posts
Re: Setting UC property from holder page - can't do it
Aug 25, 2003 07:12 PM|LINK
MiGovUser
Participant
800 Points
160 Posts
Re: Setting UC property from holder page - can't do it
Aug 25, 2003 07:44 PM|LINK