Solved

ASP .NET Telerik Button Click Event Not Firing

Posted on 2014-12-02
3
462 Views
Last Modified: 2014-12-07
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.
0
Comment
Question by:Daniel Van Der Werken
  • 2
3 Comments
 
LVL 18

Accepted Solution

by:
Jerry Miller earned 500 total points
ID: 40477189
Have you put a breakpoint on the protected void Page_Load event to see if it generating a full postback on the button click? If so, it will ignore the  if (!IsPostBack) section of your code.

You can try setting the autopostback=False on the button. It may be completely refreshing the page instead of capturing the button click event.
0
 
LVL 20

Author Comment

by:Daniel Van Der Werken
ID: 40485471
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.
0
 
LVL 20

Author Closing Comment

by:Daniel Van Der Werken
ID: 40485472
Good suggestions, so I'll give you credit.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How to convert Access database to a web app? 3 754
What are new names for Microsoft test frameworks once called Moles and Pex? 2 60
pdf file 7 85
C# LINQ ForEach() question 6 28
Introduction HyperText Transfer Protocol (http://www.ietf.org/rfc/rfc2616.txt) or "HTTP" is the underpinning of internet communication.  As a teacher of web development I have heard many questions, mostly from my younger students who have come to t…
Foreword (May 2015) This web page has appeared at Google.  It's definitely worth considering! https://www.google.com/about/careers/students/guide-to-technical-development.html How to Know You are Making a Difference at EE In August, 2013, one …
Wufoo.com provides powerful tools for surveying targeted groups, and utilizing data from completed surveys to find trends, discover areas of demand or customer expectation, and make business decisions on products or services.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question