Click here to Skip to main content
16,016,537 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
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.

ASP.NET
<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:

C#
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");
        }
    }
}
Posted

1 solution

In google Chrome
You can take the Settings – Show Advanced Settings – Content Settings – Plug-ins route.
and select Run Automatically ..
 
Share this answer
 
Comments
Amit Jangid 3-Nov-14 8:56am    
Thank you for helping. My settings was this only. I rechecked it but not working. Let me know if you have other solutions in mind.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900