0

Refer to my this question: Page not redirecting properly, URL rewriting (Asp.NET)

Which is resolved except one thing.

Though I have put the code to eliminate post back for .jpg and other file extension, JQuery at the web page is not working.

<script type="text/javascript" src="JS/jquery.js"></script> 

I have written it like the above. I have tried to change the path like

<script type="text/javascript" src="~/JS/jquery.js"></script>

but no luck.

Any suggestion

2 Answers 2

4

Try this.

<script type="text/javascript" src= "<%=ResolveUrl("~/JS/jquery.js")%>" ></script>
Sign up to request clarification or add additional context in comments.

1 Comment

Now it is working fine. and also my issue with Stackoverflow javascript error is also resolved.
1

you first check if the string contains /web/

if (app.Request.RawUrl.ToLower().Contains("/web/"))

and your .js file doesn't contain /web/

so either put the js file in the web folder, or check for the string to contain /js/ as well...

 if (app.Request.RawUrl.ToLower().Contains("/web/") ||  if (app.Request.RawUrl.ToLower().Contains("/js/")))

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.