Click here to Skip to main content
15,888,461 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: Visual Studio 2015 web service : change port Pin
Nathan Minier1-Feb-16 1:29
professionalNathan Minier1-Feb-16 1:29 
GeneralRe: Visual Studio 2015 web service : change port Pin
Pierrick Orban1-Feb-16 3:01
Pierrick Orban1-Feb-16 3:01 
GeneralRe: Visual Studio 2015 web service : change port Pin
Nathan Minier1-Feb-16 3:06
professionalNathan Minier1-Feb-16 3:06 
GeneralRe: Visual Studio 2015 web service : change port Pin
Pierrick Orban1-Feb-16 3:38
Pierrick Orban1-Feb-16 3:38 
QuestionMVC Razor View and JQuery, how to use @Url.Action Pin
jkirkerx28-Jan-16 10:13
professionaljkirkerx28-Jan-16 10:13 
AnswerRe: MVC Razor View and JQuery, how to use @Url.Action Pin
F-ES Sitecore28-Jan-16 21:55
professionalF-ES Sitecore28-Jan-16 21:55 
GeneralRe: MVC Razor View and JQuery, how to use @Url.Action Pin
jkirkerx29-Jan-16 3:42
professionaljkirkerx29-Jan-16 3:42 
GeneralRe: MVC Razor View and JQuery, how to use @Url.Action Pin
F-ES Sitecore29-Jan-16 3:57
professionalF-ES Sitecore29-Jan-16 3:57 
jkirkerx wrote:
Yes it is

And you didn't think that was worth mentioning? Smile | :)

js files are flat text files that are served straight up to the browser, no different from jpg or gif files, they are not "processed" by .net so you can't use razor markup in them or server-side processing. What you'll need to do is define a variable in your razor view like

<script>
var action = '@Url.Action("Action", "Controller")';
</script>


Then in your js file just us the "action" variable;

url: action,

GeneralRe: MVC Razor View and JQuery, how to use @Url.Action Pin
jkirkerx29-Jan-16 4:14
professionaljkirkerx29-Jan-16 4:14 
Questionautomatic textbox date display Pin
Member 1228733728-Jan-16 8:18
Member 1228733728-Jan-16 8:18 
AnswerRe: automatic textbox date display Pin
F-ES Sitecore28-Jan-16 21:53
professionalF-ES Sitecore28-Jan-16 21:53 
QuestionSqlconnection Pin
Member 1228733728-Jan-16 4:08
Member 1228733728-Jan-16 4:08 
AnswerRe: Sqlconnection Pin
Richard Deeming28-Jan-16 4:26
mveRichard Deeming28-Jan-16 4:26 
GeneralRe: Sqlconnection Pin
Member 1228733728-Jan-16 5:48
Member 1228733728-Jan-16 5:48 
GeneralRe: Sqlconnection Pin
Richard Deeming28-Jan-16 6:10
mveRichard Deeming28-Jan-16 6:10 
GeneralRe: Sqlconnection Pin
Member 1228733728-Jan-16 6:46
Member 1228733728-Jan-16 6:46 
GeneralRe: Sqlconnection Pin
Richard Deeming28-Jan-16 6:50
mveRichard Deeming28-Jan-16 6:50 
GeneralRe: Sqlconnection Pin
Member 1228733728-Jan-16 7:30
Member 1228733728-Jan-16 7:30 
Questionhow to generate dll from a project Pin
Member 1219595528-Jan-16 0:54
Member 1219595528-Jan-16 0:54 
AnswerRe: how to generate dll from a project Pin
Richard MacCutchan28-Jan-16 1:17
mveRichard MacCutchan28-Jan-16 1:17 
AnswerRe: how to generate dll from a project Pin
ZurdoDev28-Jan-16 4:35
professionalZurdoDev28-Jan-16 4:35 
QuestionHTTPWebRequest sending right in POST method but manually inserting null Pin
Sachin k Rajput 27-Jan-16 22:46
Sachin k Rajput 27-Jan-16 22:46 
AnswerRe: HTTPWebRequest sending right in POST method but manually inserting null Pin
F-ES Sitecore27-Jan-16 23:50
professionalF-ES Sitecore27-Jan-16 23:50 
Questionhow website will run after losing C# files Pin
Member 1211574627-Jan-16 5:03
Member 1211574627-Jan-16 5:03 
AnswerRe: how website will run after losing C# files Pin
Richard MacCutchan27-Jan-16 5:18
mveRichard MacCutchan27-Jan-16 5:18 

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.