asp:链接按钮未在Google Chrome和Mozilla Firefox中点击 [英] asp:linkbutton not getting clicked in Google Chrome and Mozilla Firefox

查看:122
本文介绍了asp:链接按钮未在Google Chrome和Mozilla Firefox中点击的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的网络应用程序中,不会在Google Chrome和Mozilla Firefox中点击asp:linkbutton。它在两个浏览器中都显示为文本。但该按钮在Internet Explorer中工作正常。



In my web application the asp:linkbutton is not getting clicked in Google Chrome and Mozilla Firefox. It appears as a text in both the browsers. But the button is working fine in Internet Explorer.

<div class="wrapper">
            <div class="header">
                <Bewise:FlashControl ID="FlashControl1"  runat="server" Height="300px" Loop="True" MovieUrl="~/Flash/AMs1.swf" SwLiveConnect="True" Width="1074px" />
            </div>
            <div id="nav">
                <div id="nav_wrapper">
                    <ul>
                        <li><a href="Home.aspx">Home</a></li><li>
                            <a href="Gallery.aspx">Gallery</a></li><li>
                            <a href="AboutUs.aspx">About Us</a></li><li>
                            <a href="ContactUs.aspx">Contact Us</a></li><li>
                            <a href="Feedback.aspx">Feedback</a></li><li>
                            <a href="Account.aspx">Account</a></li>
                    </ul>
                    <div id="Login" style="text-align: right; height: 0px; width: 85px;">
                        <asp:Label ID="lblLogin" runat="server" ForeColor="White" Text=""></asp:Label>
                          
                        <br />
                        <asp:LinkButton ID="LinkButton1" Font-Underline="false" CausesValidation="false" ValidationGroup="false" runat="server" ForeColor="White" OnClick="LinkButton1_Click">LinkButton</asp:LinkButton>
                           
                    </div>
                </div>
            </div>





以上代码是我的母版页。以下是文件背后的代码:





This above code is my master page. And below is the code behind file:

using System;
using System.Linq;

public partial class MasterPage : System.Web.UI.MasterPage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        using (AppointmentDataContext context = new AppointmentDataContext())
        {
            // Checks if a user is logged in
            if (Session["login"] != null)
            {
                var query = (from p in context.Accounts
                             where p.Email == Session["login"].ToString()
                             select p.Name).FirstOrDefault();

                lblLogin.Text = "Welcome " + query.Trim();
                lblLogin.Visible = true;
                LinkButton1.Text = "Logout";
            }

            else
            {
                lblLogin.Visible = false;
                LinkButton1.Text = "Login";
            }
        }
    }

    protected void LinkButton1_Click(object sender, EventArgs e)
    {
        // User logs in
        if (LinkButton1.Text == "Login")
        {
            Response.Redirect("~/Login.aspx");
        }

        else
        {
            // User logs out
            Session.Clear();
            Response.Redirect("~/Home.aspx");
        }
    }
}

推荐答案

在Google Chrome中

您可以采取设置 - 显示高级设置 - 内容设置 - 插件路由。

并选择自动运行..
In google Chrome
You can take the Settings – Show Advanced Settings – Content Settings – Plug-ins route.
and select Run Automatically ..


这篇关于asp:链接按钮未在Google Chrome和Mozilla Firefox中点击的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆