Avatar of taz8020
taz8020Flag for United Kingdom of Great Britain and Northern Ireland

asked on 

ASP.net redirect button cuases error on some ie browsers

Hi Behind my search button I have the code below. It all worked well on trial, but now it has gone live finding that the below code cuases the error the page to show in some ie browsers. Firefox and chrome seem fine. If I turn off custom errors the page just hangs and does nothing if I turn on custom errors you get my error page.
May be its the time it takes to redirect I just dont know. Please help asap as site is now live.

If Me.TextBoxQuickSearch.Text.Length > 0 Then
            Dim SearchString As String = Me.TextBoxQuickSearch.Text
            If Right(SearchString, 1) = "s" Then
                SearchString = SearchString.Remove(SearchString.Length - 1)
            End If
            Response.Redirect("~/SearchResults.aspx?Search=" & SearchString)
            Me.TextBoxQuickSearch.Text = "No Text"
        End If 

Open in new window

ASP Mark Up
<%@ Control Language="vb" AutoEventWireup="false" CodeBehind="QuickSearch.ascx.vb" Inherits="QuickSearch" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>
<asp:Panel ID="SearchPanel" runat="server" DefaultButton="SearchButton">
        <div style="z-index: 0">
    <table style="width:100px;">
                <asp:TextBox ID="TextBoxQuickSearch" runat="server" BackColor="#FFCCFF"></asp:TextBox>
                <ajaxToolkit:TextBoxWatermarkExtender ID="TextBoxWatermarkExtender1" runat="server" 
                    TargetControlID="TextBoxQuickSearch" WatermarkCssClass="SearchWaterMark" 
                    WatermarkText="Search For A Product...">

<ajaxToolkit:ToolkitScriptManager ID="ScriptManager2" runat="server">
            <td align="left">
                <asp:ImageButton ID="SearchButton" runat="server" 
                    ImageUrl="~/Images/SiteImages/Search.png" style="height: 22px" />

Open in new window

This is a duplicate question as never had an answer on https://www.experts-exchange.com/questions/28078208/ASP-net-Problem-with-form-button-on-some-ie-browsers.html
ASP.NET.NET ProgrammingVisual Basic.NETWeb Languages and StandardsWeb Development

Avatar of undefined
Last Comment
Avatar of Yiogi

Is there any chance you are having an infinite loop in your redirections? i.e. your searchresults.aspx page is again redirecting to itself? The best way to solve your problem would be to debug your code but if this production and doesn't happen on test that won't be possible for you. Try to change your redirection call to:

Response.Redirect("~/SearchResults.aspx?Search=" & Server.HTMLEncode(SearchString), false)

The false tells it not to end the execution on the current page. This will allow it to finish any pending tasks. The HTMLEncode encodes your search string to a form that can be inserted in the URL. Without it you might find problems with some characters.
Avatar of taz8020
Flag of United Kingdom of Great Britain and Northern Ireland image


If I take the button out of the update pannel it works fine. Is it something wrong with ie or may be ajaxcontroltoolkit is installed wrong. It all works on chrome and firefox and only on a few computers with IE.

It now happens on 5 buttons on the site. They are all in update pannels and it calculates stuff and shows an icon saying updating etc.

It is driving me mad, maybe its the time it takes to calculate and times out, its about 3 seconds on some buttons.

I have downloaded the new toolkit as can see lots have had the same problem but all there answers did not work. They seem to say you need the lastest version as was a known bug and make sure you use the ajaxToolkit:ToolkitScriptManager  not the asp:ScriptManager.

Some say to add
       <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
but this did not work dont even know how you know the Version and PublicKeyToken

others say enableEventValidation="false" bust still does not work
Avatar of Ark
Flag of Russian Federation image

Blurred text
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
.NET Programming
.NET Programming

The .NET Framework is not specific to any one programming language; rather, it includes a library of functions that allows developers to rapidly build applications. Several supported languages include C#, VB.NET, C++ or ASP.NET.

Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews


IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo