简体   繁体   中英

Published website works in Firefox/IE but not Chrome

So I am working with a website in C#/ASP.NET Visual Studio 2012 .Net4.5. The problem I am having is a simple button. The website is published using the Visual Studio Publish and It is configured for release. This creates the dlls and files in a directory which are then pushed to a development server. The Application pool points to this directory. Pushing the button should call C# code that is in the cs file (but now in a dll since it is pushed). This works fine in firefox and IE however in Chrome it merely refreshes the page and nothing happens. Which is weird. Some Example code

In the .aspx.cs file:

 protected void btnCreate_Click(object sender, EventArgs e)
    {
        // redirect to create page
        Response.Redirect("~/Schedule/Create.aspx");
    }

And in the .aspx file

    <asp:Button ID="btnCreate" runat="server" CssClass="btn btn-inverse" Text="Create Shift" OnClick="btnCreate_Click" />

I just don't understand why something so simple would not work in Chrome.

I should probably add that the page works as intended when debugging on local machine in google chrome. This is why I think it is something with how chrome reads dlls? However other backend .cs stuff is working. Just the Response.redirect that is not working.

According to this blog , Google Chrome caches 301 redirects. Try clearing your cache and attempting the redirect then, does that work? If so, then you're experiencing this issue.

Maybe have the button perform a redirect via javascript instead?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM