fr3dr1k8009
fr3dr1k8009

Reputation: 251

URL Definition in jQuery Data Template

I have the following HTML in a jQuery Data Template:

<a class="comment" style = "text-decoration:underline" href="ItemTitle/${Application.ApplicationId}/${Application.ApplicationName}/${DomainObjectId}/${DomainObjectPropertyNameFormatted}">${DomainObjectPropertyValue}</a>

As is above the template gets rendered on the ItemTitle view and produces a URL that appends all the URL elements to it. If I add a "/" before "ItemTitle" it goes to the root IIS website. I cannot use a html helper like Html.ActionLink because the template is only rendered after the page has loaded.

How can I get it to navigate to the correct URL?

Upvotes: 0

Views: 140

Answers (1)

Gilly
Gilly

Reputation: 9692

Just create a variable with the dev url in it.

For example:

$FullURL = 'http://[some ip]/[path]';

And include it in your a href's like: href="<%=FullURL%>/ItemTitle/${Application.ApplicationId}.. etc".

When you change from development to production, simple change the $FullURL variable.

Upvotes: 1

Related Questions