Can I programmatically add attribute to a custom t

ReDBuLLeT

New Member
Hi I have a Header.ascx file and a Product.aspx.<BR><BR>Here are some codes in my Product.aspx to call the Header:<BR><%@ Page Language="vb" EnableViewState="true" CodeBehind="Product.aspx.vb" AutoEventWireup="false" Inherits="Project.Product" %><BR><%@ Register TagPrefix="page" TagName="header" Src=http://aspmessageboard.com/archive/index.php/"./ascx/header.ascx" %><BR><%@ Register TagPrefix="page" TagName="footer" Src="./ascx/footer.ascx" %><BR><!-- ************************************************** **********--><BR><page:header runat="server" ID="myHeader" /><BR><form runat="server" ID="myForm"><BR> <table cellpadding="0" cellspacing="0" border="0" width="100%" height="100%"><BR> <tr> ............... Etc..<BR><BR>My question is can I add an attribute to <page:header> tag programmatically.<BR><BR>This is my code in the Product.aspx.vb codebehind page.<BR>Public Class Product<BR> Inherits System.Web.UI.Page<BR><BR> Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load<BR> <BR> myHeader.Attributes.Add("OnLoad", "document.forms[0].ProductName.focus();")<BR><BR> End Sub<BR>End Class<BR><BR>But it doesn't work because it said myHeader is not declaire, how do I declare it.<BR><BR>Thanks<BR>Matthew
 
Back
Top