You must Sign In to post a response.
  • Category: .NET

    Not Working Asp.net C# button Event

    hi all,

    Am using asp.net c# button. In my local system button event working good but after publishing server button event not working...

    My Code:

    connection();
    con = new SqlConnection(con_str);
    con.Open();

    string query = "insert into TourPlace values(@Category,@locationId,@location)";
    using (SqlCommand Cmd = new SqlCommand(query, con))
    {
    Cmd.Parameters.AddWithValue("@Category", Drpcategory.Text);
    Cmd.Parameters.AddWithValue("@locationId", txtlocId.Text);
    Cmd.Parameters.AddWithValue("@location", txtlocation.Text);
    Cmd.ExecuteNonQuery();
    con.Close();
    Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", "<script>alert('Added Successfully.');</script>");
    clearAll();
    }
  • #768131
    Hi,

    There might be many reason for this issue.
    Infact you might get the error symbol in side of your internet explorer while you clicking the button.

    1. If you are using IFrame then check that completely
    2. while clicking the button what is the expectation, If it was download or upload button then permission issue might be a reason.
    3. Check you have on the trace logging

    <trace enabled="true" requestLimit="15" localOnly="false" Output="false" />


    4. Also check the Proxy settings.
    5. Important : Check the Java is enabled on the browser. Many time this happens when the browser was not compatible.

    Thanks,
    Mani

  • #768145
    Deploy again your application..

  • #768147
    what error you got ? is event fire or it does not fire ? have you try to put some logs after button click ? Please elaborate your issue
    Many times it happens that browser settings are not allowed button to fire that event, is your web site running under compatibility mode or without compatibility mode

    Thanks
    Koolprasd2003
    Editor, DotNetSpider MVM
    Microsoft MVP 2014 [ASP.NET/IIS]


  • Sign In to post your comments