Eğer uygulamanızda body tag'inin bulunduğu yerde değişiklik lazımsa aşağıdaki class yardımcı olabilir(Body tag'i literal control olarak bulunuyor.)
Public MustInherit Class BasePage
Inherits System.Web.UI.Page
Public Event OnBodyTagRender(ByVal sender As Object, ByVal e As System.EventArgs)
Protected Overrides Sub OnPreRenderComplete(ByVal e As System.EventArgs)
MyBase.OnPreRenderComplete(e)
Dim _page As Object = Me.Page
If Not Me.Page.Master Is Nothing Then
_page = Me.Master
While Not _page.Master Is Nothing
_page = DirectCast(_page.Master, System.Web.UI.MasterPage).Page
End While
End If
Dim list = From ctrl In DirectCast(_page, System.Web.UI.Control).Controls _
Where TypeOf ctrl Is System.Web.UI.LiteralControl
If list.Count >0 Then
Dim list2 = From lit As System.Web.UI.LiteralControl In list _
Where lit.Text.ToLower.Contains("<body")
If list2.Count = 1 Then
RaiseEvent OnBodyTagRender(list2(0), New System.EventArgs)
End If
End If
End Sub
End Class
Sanırsam yukarıdaki kod pek stabil çalışmıyor:( <body runat="server"> yazmak daha makul bir çözüm gibi olacak!