Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8954667
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T14:21:36+00:00 2026-06-15T14:21:36+00:00

Hello I aspx page with next call for my ashx <script type=text/javascript src=/Handlers/MyRedirect.ashx> </script>

  • 0

Hello I aspx page with next call for my ashx

<script type="text/javascript" src="/Handlers/MyRedirect.ashx">
</script>

Inside of MyRedirect I do some hard logic and try to redirect to other page of my side
it looks like:

public class MyRedirect : HttpTaskAsyncHandler, IReadOnlySessionState
    {     
        public override async Task ProcessRequestAsync(HttpContext context)
        {            
          //some logic here with out any output
          //context.Response.ContentType = "application/x-javascript";
          context.Response.Redirect("/adminDashboard.aspx", false);
        }
}

but in Chrome I getting error
Resource interpreted as Script but transferred with MIME type text/html:
What I do wrong ? How to fix it thank ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T14:21:38+00:00Added an answer on June 15, 2026 at 2:21 pm

    The page you are redirecting to must return javascript and set appropriate response content-type header. In the example you have shown you seem to be redirecting to some /adminDashboard.aspx WebForm which I guess returns HTML and not javascript. Or if it does return javascript it doesn’t set the proper Content-Type header to text/javascript.

    That’s why Chrome complains: you are pointing the src attribute of your <script> tag to a server side handler which doesn’t set the expected and correct content type.

    So if you have to perform this redirect make sure that at the end of the day the page you have redirected to returns valid javascript and that it sets the Content-Type header to text/javascript. You could very easily see this in the Network tab when analyzing the different HTTP requests that are being sent from the browser.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Default.aspx <script type=text/javascript> $(function() { $(#add_questions).click(function() { var question = $(#wmd-output).val(); var option1 =
I have the following code in my aspx page: <asp:Button runat=server ID=myButton Text=hello />
I've got the following PageMethod in my Default.aspx page: [WebMethod] public static string Hello()
Hello mates i have a page View All Applicants.aspx with gridview and a link
Hello Friends I am using a list box control in aspx page i have
Doesas anyone know how to create an aspx page with a Flash object inside?
I'm trying to edit an aspx page...mainly javascript, and I randomly see changes that
Hello i have a aspx page and have this code on it: <asp:Button ID=ButtonOk
Hello everyone iam trying to open a aspx page in a dialog box window
Hello there i have written some code in jquery to add new input type

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.