troubleshooting Question

ASP .NET Telerik Button Click Event Not Firing

Avatar of Daniel Van Der Werken
Daniel Van Der WerkenFlag for United States of America asked on
Microsoft DevelopmentWeb Applications
3 Comments1 Solution847 ViewsLast Modified:
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" %>

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>

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....");
            }
:
:

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:

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

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

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>

Let me know if there is anything else you think I can provide for info. Thanks.
ASKER CERTIFIED SOLUTION
Jerry Miller

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 3 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros