Click here to Skip to main content
15,911,789 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: Problem with my web site. Pin
Paddy Boyd4-May-06 3:48
Paddy Boyd4-May-06 3:48 
AnswerRe: Problem with my web site. Pin
RichardGrimmer4-May-06 5:57
RichardGrimmer4-May-06 5:57 
AnswerRe: Problem with my web site. Pin
Dipan Patel From Gandhinagar6-May-06 2:53
Dipan Patel From Gandhinagar6-May-06 2:53 
QuestionGetting around virtual directories? Pin
scott987uk4-May-06 3:11
scott987uk4-May-06 3:11 
AnswerRe: Getting around virtual directories? Pin
Paddy Boyd4-May-06 3:49
Paddy Boyd4-May-06 3:49 
GeneralRe: Getting around virtual directories? Pin
scott987uk4-May-06 3:53
scott987uk4-May-06 3:53 
AnswerRe: Getting around virtual directories? Pin
Paddy Boyd4-May-06 3:55
Paddy Boyd4-May-06 3:55 
QuestionJavaScript in MasterPages [asp.net 2.0] Pin
student_rhr4-May-06 2:57
student_rhr4-May-06 2:57 
As long as MasterPage and WebForm are in the same directory the JavaScript file works but when the directories are different I get javascript error cuz the file was not found.

I tried to google this problem and found that if you put the script block within the < HEAD >, ASP.NET 2.0 runtime will resolve the URL but for some odd reason that is not the case here.

Here is how I am doing it:

the file is inside a folder called JavaScript which is right under root folder.

I tried this first:
<head>
<script src="/Javascript/x.js" type="text/javascript"></script>
</head>


Then I tried this:
<head>
<script src="x.js" type="text/javascript"></script>
</head>


Then I tried this, but I got an ugly error:
The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).
<head>
<script src=<%= ResolveClientUrl("x.js") %> type="text/javascript"></script>
</head>


Can someone tell me how to take care of this problemConfused | :confused: . Thanks in advance.


-- modified at 8:58 Thursday 4th May, 2006
AnswerRe: JavaScript in MasterPages [asp.net 2.0] Pin
R.Prabha Devi4-May-06 3:08
R.Prabha Devi4-May-06 3:08 
GeneralRe: JavaScript in MasterPages [asp.net 2.0] Pin
student_rhr4-May-06 6:23
student_rhr4-May-06 6:23 
AnswerRe: JavaScript in MasterPages [asp.net 2.0] Pin
R.Prabha Devi4-May-06 3:24
R.Prabha Devi4-May-06 3:24 
AnswerRe: JavaScript in MasterPages [asp.net 2.0] Pin
Guffa4-May-06 8:04
Guffa4-May-06 8:04 
QuestionDataList OnCommand stopped working Pin
Ista4-May-06 2:53
Ista4-May-06 2:53 
AnswerRe: DataList OnCommand stopped working Pin
Ista4-May-06 3:09
Ista4-May-06 3:09 
Questionloading NavigationUrl to a specific div in C# Pin
aliserdarilter4-May-06 2:41
aliserdarilter4-May-06 2:41 
AnswerRe: loading NavigationUrl to a specific div in C# Pin
Paddy Boyd4-May-06 4:08
Paddy Boyd4-May-06 4:08 
GeneralRe: loading NavigationUrl to a specific div in C# Pin
aliserdarilter5-May-06 1:25
aliserdarilter5-May-06 1:25 
QuestionHow to Disable Validation Events? Pin
innocent734-May-06 2:07
innocent734-May-06 2:07 
AnswerRe: How to Disable Validation Events? Pin
Tirthadip4-May-06 3:29
Tirthadip4-May-06 3:29 
GeneralRe: How to Disable Validation Events? Pin
innocent734-May-06 4:25
innocent734-May-06 4:25 
AnswerRe: How to Disable Validation Events? Pin
Dipan Patel From Gandhinagar6-May-06 2:59
Dipan Patel From Gandhinagar6-May-06 2:59 
QuestionAfter moving ASPX page to a live server this happens. Pin
evlxtc4-May-06 2:02
evlxtc4-May-06 2:02 
QuestionHow to retain radio button check (Urgent) Pin
indiaone4-May-06 1:59
indiaone4-May-06 1:59 
AnswerRe: How to retain radio button check (Urgent) Pin
R.Prabha Devi4-May-06 2:39
R.Prabha Devi4-May-06 2:39 
QuestionPopulate input control on external web page? Pin
mattdavies4-May-06 1:19
mattdavies4-May-06 1:19 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.