【问题标题】:Hide Button when type a string on url in Dot.Net VB在 Dot.Net VB 中的 url 上键入字符串时隐藏按钮
【发布时间】:2016-09-05 19:58:54
【问题描述】:

我需要您的帮助,因为我有以下情况: 我有一个名为“更新”的按钮,带有 ID="Update",大​​多数情况下它会被隐藏,但我希望在我的 URL 中键入一些字符串时它可以看到,例如: URL = localhost:80 我想添加 ?string=updateme 如何在我的 aspnet VB loadPage 上编写代码?

感谢您的支持。

【问题讨论】:

    标签: asp.net vb.net visual-studio-2012


    【解决方案1】:

    我认为这将引导您朝着正确的方向前进。

    If (Not (Request.QueryString("string")) Is Nothing) Then
        If (Request.QueryString("string").ToString = "updateme") Then
            Update.Visible = true
        End If    
    End If
    

    或者

    If Request.Url.ToString.Contains("localhost") Then
        Update.Visible = true
    End If
    

    PS 代码是用http://www.carlosag.net/tools/codetranslator/ 从 C# 翻译成 VB,所以它可能不是 100% 正确的。

    【讨论】:

    • 谢谢 VDWWD,我明天试试,告诉你,不过还是谢谢
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-11-04
    • 2011-09-20
    • 2012-01-23
    • 1970-01-01
    • 1970-01-01
    • 2016-05-07
    相关资源
    最近更新 更多