Solved

ASP .NET Telerik Button Click Event Not Firing

Posted on 2014-12-02
3
436 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 19

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 19

Author Closing Comment

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

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

      Install BugTracker on Windows 2008 server Step 1:  Install windows 2008 server 32 bit OS and configure IIS. Step 2:  Install SQL server ( SQL server 2005 or SQL server 2005 Express edition. The installer for 2008  version isn’t very f…
A Change in PHP Behavior with Session Write Short Circuit (http://php.net/manual/en/book.session.php#116217) (Winter 2014)** With the release of PHP 5.6 the session handler changed in a way that many think should be considered a bug.  See the note …
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to choose which pages of your form are visible to your users based on their inputs. The page rules feature provides you with an opportunity to create if:then statements for y…
Learn how to set-up custom confirmation messages to users who complete your Wufoo form. Include inputs from fields in your form, webpage redirects, and more with Wufoo’s confirmation options.

746 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now