首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > VB Dotnet >

哪位懂C#的大神,请帮忙改成vb.net,多谢

2012-03-30 
哪位懂C#的大神,请帮忙改成vb.net,谢谢!C# codepublic partial class _Default : System.Web.UI.Page {pro

哪位懂C#的大神,请帮忙改成vb.net,谢谢!

C# code
public partial class _Default : System.Web.UI.Page {    protected void Page_Load(object sender, EventArgs e)    {         }    protected void MainMenu_MenuItemDataBound(object sender, System.Web.UI.WebControls.MenuEventArgs e)    {        if (e.Item.DataItem is SiteMapNode)            e.Item.Target = (e.Item.DataItem as SiteMapNode)["Target"];    }    // Adding this override so that the asp:Menu control renders properly in Safari and Chrome    // See http://geekswithblogs.net/bullpit/archive/2009/07/08/aspmenu-rendering-problems-in-ie8-safari-and-chrome.aspx    protected override void AddedControl(Control control, int index)    {        string str = Request.ServerVariables["http_user_agent"].ToLower();        if (str.Contains("safari") || str.Contains("chrome"))        {            this.Page.ClientTarget = "uplevel";        }        base.AddedControl(control, index);    }}


[解决办法]
http://www.developerfusion.com/tools/convert/csharp-to-vb/
[解决办法]
这个几乎都不用怎么转的吧
Protected Sub MainMenu_MenuItemDataBound(sender As Object, e As System.Web.UI.WebControls.MenuEventArgs)
If (e.Item.DataItem is SiteMapNode) Then
e.Item.Target = (CType(e.Item.DataItem, SiteMapNode))("Target")
End If
End Sub

Protected Override Sub AddedControl(control As Control, index As Integer)
Dim str As String = Request.ServerVariables("http_user_agent").ToLower
If (str.Contains("safari") Or str.Contains("chrome")) Then
Me.Page.ClientTarget = "uplevel"
End If
base.AddedControl(control, index)
End Sub

热点排行