tonelm54
asked on
Accessing Site.Master in another page
Good afternoon,
Ive got my <body> tag setup in my site.master file, and I want to be able to set an attribute of the body in a WebForm.
I thought I could just try and set the page in site.master like '<body id="divBody" runat="server">', and then in my PageLoad on the webform I want to set it on do:-
Public Class _Default
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
divBody.Attributes.Add("on contextmen u", "return false"))
End Sub
End Class
But this doesnt work.
Any ideas how I can set the Body attributes in a different form?
Thank you
Ive got my <body> tag setup in my site.master file, and I want to be able to set an attribute of the body in a WebForm.
I thought I could just try and set the page in site.master like '<body id="divBody" runat="server">', and then in my PageLoad on the webform I want to set it on do:-
Public Class _Default
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
divBody.Attributes.Add("on
End Sub
End Class
But this doesnt work.
Any ideas how I can set the Body attributes in a different form?
Thank you
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
If you wanted to you could add a MasterType directive to your page and then you wouldn't need to do the CType either.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.