Site works with Firefox, not with IE ( Response.Redirect )

  • Thread starter Thread starter KBuser
  • Start date Start date
K

KBuser

I recently developed an internal website with various queries against
our SQL server. I added buttons with Response.Redirect. These buttons
do not work with Internet Explorer, however when using Firefox the page
works flawless. Does anyone know why this is happening or how to fix it?
 
Cool stuff! Works with FireFox and not with IE....
Do you have any sample code?

Regards,
Lars-Inge Tønnessen
 
Lars-Inge Tønnessen (VJ# MVP) said:
Cool stuff! Works with FireFox and not with IE....
Do you have any sample code?

Regards,
Lars-Inge Tønnessen

protected void btnDVD2_Click(object sender, EventArgs e)
{

Response.Redirect("dvd.aspx?dvd=" + txtSearch.Text);

}

txtSearch is a text box.
the page this is on has a frame redirect...

<BASE href="/" target="Results">
</BASE>
 
KBuser said:
I recently developed an internal website with various queries against
our SQL server. I added buttons with Response.Redirect. These buttons
do not work with Internet Explorer, however when using Firefox the page
works flawless. Does anyone know why this is happening or how to fix it?

Well, it's hard to say given only the information that the "buttons do
not work". In what way do they not work? Do you get a browser request
at all? What happens? Can you give some sample code? Do you know
whether the issue is at the browser end or the server end?
 
This code + base is working on my computer using IE 6.
What IE version etc...Any plugins in IE etc...?

protected void Button1_Click(object sender, EventArgs e)
{
this.Response.Redirect("dvd.aspx?dvd=" + this.TextBox1.Text);
}

Regards,
Lars-Inge Tønnessen
 
Jon said:
Well, it's hard to say given only the information that the "buttons do
not work". In what way do they not work? Do you get a browser request
at all? What happens? Can you give some sample code? Do you know
whether the issue is at the browser end or the server end?


It's client side that it fails, as the page works fine with one browser
and not another, as I've stated twice. Nothing happens, the page just
sits there (in Internet Explorer).

I'm not sure how I can be more clear here. I had a page so people could
query our database. I had a button and a text box. The queries and
searches worked fine on both browsers. I added a few buttons and create
the script behind them to pass the text box values to the proper page
with the correct query string.... The page works fine in Firefox,
however IE stopped working. So it must be something with
Reponse.Redirect and IE, no?

<%@ Page Language="C#" %>

<script runat="server">

protected void btnDVD2_Click(object sender, EventArgs e)
{

Response.Redirect("dvd.aspx?dvd=" + txtSearch.Text);

}

protected void btnComp_Click(object sender, EventArgs e)
{
Response.Redirect("company.aspx?co=" + txtSearch.Text);
}

protected void btnBrand_Click(object sender, EventArgs e)
{
Response.Redirect("brand.aspx?brand=" + txtSearch.Text);
}


protected void btnRate_Click(object sender, EventArgs e)
{
Response.Redirect("rate.aspx?mag=" + txtSearch.Text);
}

protected void btnMag_Click(object sender, EventArgs e)
{
Response.Redirect("magazine.aspx?mag=" + txtSearch.Text);
}
</script>

<html>
<head runat="server">
<title>Search Menu</title>
<BASE href="" target="Results">
</BASE>
</head>
<body bgcolor="inactiveborder">
<form id="form1" runat="server">
<div style="text-align: center">
<asp:TextBox ID="txtSearch"
runat="server"></asp:TextBox>&nbsp;<br />
<asp:Button ID="btnComp" runat="server" OnClick="btnComp_Click"
Text="Company" />
<asp:Button ID="btnBrand" runat="server" Text="Brand"
OnClick="btnBrand_Click" />
<asp:Button ID="btnDVD2" runat="server" OnClick="btnDVD2_Click"
Text="DVD" />
<asp:Button ID="btnRate" runat="server" Text="Rate"
OnClick="btnRate_Click" />
<asp:Button ID="btnMag" runat="server" Text="Magazine"
OnClick="btnMag_Click" /><br />
<span style="font-family: Courier New"><span style="font-size:
24pt"><span style="color: #00cc00">
<span style="color: #0033ff">Search</span>Mag</span><span
style="color: #0033ff"><span><span>Stats<span
style="font-size:
7pt">v.04</span></span></span></span></span></span></div>
</form>
</body>
</html>
 
Jon said:
Well, it's hard to say given only the information that the "buttons do
not work". In what way do they not work? Do you get a browser request
at all? What happens? Can you give some sample code? Do you know
whether the issue is at the browser end or the server end?

t's client side that it fails, as the page works fine with one browser
and not another, as I've stated. Nothing happens, the page just
sits there (in Internet Explorer).

I'm not sure how I can be more clear here. I had a page so people could
query our database. I had a button and a text box. The queries and
searches worked fine on both browsers. I added a few buttons and create
the script behind them to pass the text box values to the proper page
with the correct query string.... The page works fine in Firefox,
however IE stopped working. So it must be something with
Reponse.Redirect and IE, no?

<%@ Page Language="C#" %>

<script runat="server">

protected void btnDVD2_Click(object sender, EventArgs e)
{

Response.Redirect("dvd.aspx?dvd=" + txtSearch.Text);

}

protected void btnComp_Click(object sender, EventArgs e)
{
Response.Redirect("company.aspx?co=" + txtSearch.Text);
}

protected void btnBrand_Click(object sender, EventArgs e)
{
Response.Redirect("brand.aspx?brand=" + txtSearch.Text);
}

protected void btnRate_Click(object sender, EventArgs e)
{
Response.Redirect("rate.aspx?mag=" + txtSearch.Text);
}

protected void btnMag_Click(object sender, EventArgs e)
{
Response.Redirect("magazine.aspx?mag=" + txtSearch.Text);
}
</script>

<html>
<head runat="server">
<title>Search Menu</title>
<BASE href="" target="Results">
</BASE>
</head>
<body bgcolor="inactiveborder">
<form id="form1" runat="server">
<div style="text-align: center">
<asp:TextBox ID="txtSearch"
runat="server"></asp:TextBox>&nbsp;<br />
<asp:Button ID="btnComp" runat="server" OnClick="btnComp_Click"
Text="Company" />
<asp:Button ID="btnBrand" runat="server" Text="Brand"
OnClick="btnBrand_Click" />
<asp:Button ID="btnDVD2" runat="server" OnClick="btnDVD2_Click"
Text="DVD" />
<asp:Button ID="btnRate" runat="server" Text="Rate"
OnClick="btnRate_Click" />
<asp:Button ID="btnMag" runat="server" Text="Magazine"
OnClick="btnMag_Click" /><br />
<span style="font-family: Courier New"><span style="font-size:
24pt"><span style="color: #00cc00">
<span style="color: #0033ff">Search</span>Mag</span><span
style="color: #0033ff"><span><span>Stats<span
style="font-size:
7pt">v.04</span></span></span></span></span></span></div>
</form>
</body>
</html>
 
Lars-Inge Tønnessen (VJ# MVP) said:
This code + base is working on my computer using IE 6.
What IE version etc...Any plugins in IE etc...?

protected void Button1_Click(object sender, EventArgs e)
{
this.Response.Redirect("dvd.aspx?dvd=" + this.TextBox1.Text);
}

Regards,
Lars-Inge Tønnessen

IE version 6.0.2900.2180 with XP service pack 2

I accessed the site from another computer using firefox and it worked
fine. Then accessed from the same computer with IE and it doesn't work.
Thank you for trying that on your computer.
 
KBuser said:
It's client side that it fails, as the page works fine with one browser
and not another, as I've stated twice.

That doesn't mean it's a client side problem though. There are any
number of things which could be server side problems but cause one
browser to fail and one to work.
Nothing happens, the page just sits there (in Internet Explorer).

Ah, finally, some information about what happens. You hadn't said what
had happened at all - only that it didn't work.
I'm not sure how I can be more clear here.

Well, the example should help. Having said which, it's not as short as
it could be - when giving examples it's worth making them as short as
possible. It would also help if you'd say which page you've given us
here, so we know whether the button is trying to redirect to the same
page or a different page.

I'll have a look at what you've given us when I've got some time
tonight.
 
Jon said:
That doesn't mean it's a client side problem though. There are any
number of things which could be server side problems but cause one
browser to fail and one to work.


Ah, finally, some information about what happens. You hadn't said what
had happened at all - only that it didn't work.


Well, the example should help. Having said which, it's not as short as
it could be - when giving examples it's worth making them as short as
possible. It would also help if you'd say which page you've given us
here, so we know whether the button is trying to redirect to the same
page or a different page.

I'll have a look at what you've given us when I've got some time
tonight.

Thank you Jon. The page I showed was the menu (top row) of the
frameset. The redirect (Response) is directed at the 2nd frame. Both of
these aspx pages are on default.htm.
This is the code behind default.
<html>
<head>
<title>Search</title>
</head>

<FRAMESET COLS="100%">
<FRAMESET ROWS="16%,84%" border="0">
<FRAME SRC="menu.aspx" name="Menu" scrolling="no" noresize>
<FRAME SRC="results.aspx" name="Results">
</FRAMESET>

</FRAMESET>
</html>

Results.aspx is a place holder with "no code".

I appreciate all the help.
 
KBuser said:
Thank you Jon. The page I showed was the menu (top row) of the
frameset.

Okay - so the first thing to do is try to reproduce the problem outside
frames. Create the shortest page you can that still demonstrates the
problem. Get rid of things one at a time until the problem goes away -
or start from scratch. Once you've got that minimal example, the cause
of the problem may well be apparent - and if it's not, it will be
*much* easier for others to help you.

This is a great strategy for problem-solving in general, not just
asp.net problems.
 
I have the same problem:
I have big asp.net , c# project with many buttons and image buttonsthat
suddenly stop firing, when you click on button form -nothings happen.
It is a project more than 6 months old and all the time so far all
buttons worked just fine, but now...not

What strange that in Firefox they are still work fine, but not in IE.

When I create another project buttnons work without problems so itseems
my project is somehow screwed up.

I tried move project to another computer - same thing.

I tried to reinstall framework (aspnet_regiis.exe), it didn't help

Anybody knows solution ???

Thanks
 
Fixed! It was one problematic javascript on my page that prevent page
to be rendered in IE properly.When I remove that javascript everything
went smoothly.

Anybody with same problem: pay attention on javascript on your pages

Regards;
 
It seems to be this piece of code that is causing the issue for me.
<BASE href="" target="Results">
</BASE>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top