こんにちは、メニューコントロール用のコントロールアダプタを作成しようとしています。しかし、JavaScriptのロードを停止するにはどうすればよいですか?
new Sys.WebForms.Menu({ element: 'menu1', disappearAfter: 500, orientation: 'vertical', tabIndex: 0, disabled: false });
それは私がそれを止める方法を見つけることができない次の行をレンダリングします。
Public Class MenuAdapter
Inherits WebControlAdapter
Private ReadOnly Property Menu As Menu
Get
Return CType(MyBase.Control, Menu)
End Get
End Property
Protected Overrides Sub RenderBeginTag(writer As System.Web.UI.HtmlTextWriter)
If (Not String.IsNullOrEmpty(Control.ClientID)) Then
writer.AddAttribute(HtmlTextWriterAttribute.Id, Control.ClientID)
End If
If (Not String.IsNullOrEmpty(Control.CssClass)) Then
writer.AddAttribute(HtmlTextWriterAttribute.Class, Control.CssClass)
End If
writer.RenderBeginTag(HtmlTextWriterTag.Ul)
End Sub
Protected Overrides Sub RenderEndTag(writer As System.Web.UI.HtmlTextWriter)
writer.WriteLine()
writer.RenderEndTag()
End Sub
Protected Overrides Sub RenderContents(writer As System.Web.UI.HtmlTextWriter)
RenderItems(writer, Menu.Items)
End Sub
Private Sub RenderItems(writer As System.Web.UI.HtmlTextWriter, menuItems As MenuItemCollection)
For Each menuItem As MenuItem In Menu.Items
If (HttpContext.Current.Server.MapPath(menuItem.NavigateUrl).Equals(HttpContext.Current.Request.PhysicalPath, StringComparison.OrdinalIgnoreCase)) Then
writer.AddAttribute("class", Menu.StaticSelectedStyle.CssClass)
End If
writer.RenderBeginTag(HtmlTextWriterTag.Li)
If (Not String.IsNullOrEmpty(menuItem.NavigateUrl)) Then
writer.AddAttribute(HtmlTextWriterAttribute.Href, Menu.ResolveClientUrl(menuItem.NavigateUrl))
writer.RenderBeginTag(HtmlTextWriterTag.A)
writer.Write(menuItem.Text)
writer.RenderEndTag()
Else
writer.Write(menuItem.Text)
End If
If (menuItem.ChildItems.Count > 0) Then
RenderBeginTag(writer)
RenderItems(writer, menuItem.ChildItems)
RenderEndTag(writer)
End If
writer.RenderEndTag()
Next
End Sub
End Class