Avatar of Daniel Van Der Werken
Daniel Van Der Werken
Flag for United States of America asked on

ASP .NET Telerik Button Click Event Not Firing

IIS 8.5 on Windows Server 2012 R2. There is no public access to this site.

I have a website that uses Telerik controls. The login button link doesn't fire the event associated with it. This issue doesn't happen in my local development environment. It only occurs when I deploy to my IIS servers.

I've run this in IE and Chrome, and it behaves the same way. I have a JavaScript popup that fires when you refresh the page that you need to click on to get to the login button. It is a site warning that says "By using this site, you agree..blah blah blah". It's only JavaScript and when you click Confirm, it goes away and you can type in your credentials and click Login.

When you click Login, the JavaScipt popoup fires and you have to hit Confirm again to get to the login.

At first, I noticed that I was getting a "sys is undefined" error in the scripting on the page. I looked that up and it appeared that some stuff might be missing from the web.config regarding Telerik. I updated the IIS server's web.config and the problem seemed resovled.

Except, it's back and I can't seem to figure out what to do about this. I'm hoping for some troubleshooting tips or other help. I'm not sure how much the Telerik controls are causing this or even if they are. The actual button that's not firing is just a plain old ASP .NET button anyway.

Here's some code:

First off, the AutoEventWireUp on the page directive is set to True:

<%@ Page Language="C#" AutoEventWireup="True" CodeBehind="Default.aspx.cs" Inherits="xxx.Default" %>

Open in new window


The ASPX HTML for the button itself is in a table (I know a table is a terrible place for this, but I will blame this on the person who wrote this.) It's the login button:

<td>
<asp:Button ID="login" runat="server" Text="Login" OnClick="Login_Click" SkinID="Button" ForeColor="White" Width="100px" />
</td>

Open in new window


The code-behind does a few things, but the main point here is that it simply never fires at all. Instead, the page refreshes to itself:

 protected void Login_Click(object sender, EventArgs e)
        {
            if (Helper.DoWriteToLogFile())
            {
                Helper.WriteToCLogFile("Default.aspx -- Login_Click() clicked....");
            }
:
:

Open in new window


Yes, I have logging enabled and the log file never gets written to.

For the actual Page_Load event, I do log the event, and the logging does successfully occur:

Open in new window


     
protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (Helper.DoWriteToLogFile())
                {
                    Helper.WriteToLogFile("Default.aspx -- DoWriteToLogFile is enabled.");
                }
:
:

Open in new window


Hence, I know the logging works. I know the page load works, but I can't seem to get the login button to fire off.

I'm only guessing there might be a Telerik involvement because of what occured before.

With IE, I've used Developer Tools (F12) with script debugging enabled, but I don't see any direct issues. I do see this:

DOM7011: The code on this page disabled back and forward caching. For more information, see: http://go.microsoft.com/fwlink/?LinkID=291337
File: mysite.com
HTML1300: Navigation occurred.
File: mysite.com
DOM7011: The code on this page disabled back and forward caching. For more information, see: http://go.microsoft.com/fwlink/?LinkID=291337
File: mysite.comm

Open in new window


These are all warnings and not errors, and I can't seem to get any issue to show up in the script debugger.

I'm stumped. I'd appreciate any help on this at all. The Handlers and HttpHandlers sections of the web.config are matched between my local dev and the IIS server, so I don't know if there is anything mroe I need to do there. Here are the sections:

 
  <httpHandlers>
      <add path="ChartImage.axd" type="Telerik.Web.UI.ChartHttpHandler" verb="*" validate="false" />
      <add path="Telerik.Web.UI.SpellCheckHandler.axd" type="Telerik.Web.UI.SpellCheckHandler" verb="*" validate="false" />
      <add path="Telerik.Web.UI.DialogHandler.aspx" type="Telerik.Web.UI.DialogHandler" verb="*" validate="false" />
      <add path="Telerik.RadUploadProgressHandler.ashx" type="Telerik.Web.UI.RadUploadProgressHandler" verb="*" validate="false" />
      <add path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" verb="*" validate="false" />
      <add type="Telerik.ReportViewer.WebForms.HttpHandler, Telerik.ReportViewer.WebForms, Version=5.1.11.713, Culture=neutral, PublicKeyToken=a9d7983dfcc261be" path="Telerik.ReportViewer.axd" verb="*" validate="true" />
    </httpHandlers>
    <httpModules>
      <add name="RadUploadModule" type="Telerik.Web.UI.RadUploadHttpModule" />
      <add name="RadCompression" type="Telerik.Web.UI.RadCompression" />
    </httpModules>
    <trace writeToDiagnosticsTrace="false" enabled="false" pageOutput="false" localOnly="true" requestLimit="400" />
    <httpCookies httpOnlyCookies="true" requireSSL="false" />
    <authorization>
      <deny users="?" />
      <allow users="*" />
    </authorization>
  </system.web>
  <system.webServer>
    <validation validateIntegratedModeConfiguration="false" />
    <modules runAllManagedModulesForAllRequests="true">
      <remove name="RadUploadModule" />
      <remove name="RadCompression" />
      <add name="RadUploadModule" type="Telerik.Web.UI.RadUploadHttpModule" preCondition="integratedMode" />
      <add name="RadCompression" type="Telerik.Web.UI.RadCompression" preCondition="integratedMode" />
      <add name="Glimpse" type="Glimpse.Core.Module,Glimpse.Core" preCondition="integratedMode" />
    </modules>
    <handlers>
      <remove name="ChartImage_axd" />
      <remove name="Telerik_Web_UI_SpellCheckHandler_axd" />
      <remove name="Telerik_Web_UI_DialogHandler_aspx" />
      <remove name="Telerik_RadUploadProgressHandler_ashx" />
      <remove name="Telerik_Web_UI_WebResource_axd" />
      <add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
      <add name="ChartImage_axd" path="ChartImage.axd" type="Telerik.Web.UI.ChartHttpHandler" verb="*" preCondition="integratedMode" />
      <add name="Telerik_Web_UI_SpellCheckHandler_axd" path="Telerik.Web.UI.SpellCheckHandler.axd" type="Telerik.Web.UI.SpellCheckHandler" verb="*" preCondition="integratedMode" />
      <add name="Telerik_Web_UI_DialogHandler_aspx" path="Telerik.Web.UI.DialogHandler.aspx" type="Telerik.Web.UI.DialogHandler" verb="*" preCondition="integratedMode" />
      <add name="Telerik_RadUploadProgressHandler_ashx" path="Telerik.RadUploadProgressHandler.ashx" type="Telerik.Web.UI.RadUploadProgressHandler" verb="*" preCondition="integratedMode" />
      <add name="Telerik_Web_UI_WebResource_axd" path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" verb="*" preCondition="integratedMode" />
      <add name="Telerik.ReportViewer.axd_*" type="Telerik.ReportViewer.WebForms.HttpHandler, Telerik.ReportViewer.WebForms, Version=5.1.11.713, Culture=neutral, PublicKeyToken=a9d7983dfcc261be" path="Telerik.ReportViewer.axd" verb="*" preCondition="integratedMode" />
      <add name="Glimpse" path="glimpse.axd" verb="GET,POST" type="Glimpse.Core.Handler,Glimpse.Core" preCondition="integratedMode" />
    </handlers>

Open in new window


Let me know if there is anything else you think I can provide for info. Thanks.
Web ApplicationsMicrosoft Development

Avatar of undefined
Last Comment
Daniel Van Der Werken

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Jerry Miller

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Daniel Van Der Werken

ASKER
I ended up removing some things out of the web.config to solve this. Essentially, I got rid of everything in the assemblies section. Seemed to do the trick. There was some session management stuff I did that had a similar affect too though. They could be related.

To answer your question, as this issue would only occur deployed with no Visual Studio available, I could not set break point. The page load did occur but not the button click event.
Daniel Van Der Werken

ASKER
Good suggestions, so I'll give you credit.
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes