Questions tagged [urlhelper]
113 questions
0
votes
1 answer
error UrlHelper and mono
In my views (velocity template mode) I call $Url.Link helper, in Visual Studio with cassini it work but when I deploy my webapp on mono/nginx/ubuntu url are well not formed, I get only the controler's action path.
it's seems it come from Url.For…

Christophe Debove
- 6,088
- 20
- 73
- 124
0
votes
1 answer
Generate real Server URL (not localhost)
Hi,
Im using the following to generate full URL :
urlHelper.Action("Detail", "Ad", null, "http") + "?id=" + adId.ToString();
This will however return a localhost URL even when the webpage is placed on a public server (www.mywebpage.com)?
Im using…

Banshee
- 15,376
- 38
- 128
- 219
0
votes
1 answer
How can i move this code outside of my asp.net-mvc project
I have the following code inside my asp.net-mvc project:
private string GenerateEmail(RequestContext requestContext)
{
var u = new UrlHelper(requestContext);
string url = u.AbsoluteAction("Detail", "Application", new { id = app.Id });
}
I…

leora
- 188,729
- 360
- 878
- 1,366
0
votes
3 answers
Use a variable that store image path in Razor Url.Content
I used a function to construct an image path dynamically like this:
function () {
var name = $(this).attr('id') + '_o';
var newsrc = '../../Content/HomePage/' + name + '.png';
And I want to assign the newsrc using Razor…

shennyL
- 2,764
- 11
- 41
- 65
0
votes
1 answer
SAPUI5: Open JSON in new browser window fails
I would like to download JSON from my app to disk. For this purpose I am retrieving the JSON as encoded string from the backend and using this approach:
const uri = `data:text/json,${sJSONContent}`;
sap.m.URLHelper.redirect(uri, true);
This opens a…

AntonSack
- 1,021
- 2
- 25
- 47
0
votes
1 answer
Rails 3 - URL Helpers With Scoped Resource
I have a scoped resource in my routes file:
scope :module => "physical" do
resources :mymodels
end
Using '> rake routes' I get the standard routes, including:
mymodel GET /mymodels/:id(.:format) {:action=>"show",…

Bryan Marble
- 3,467
- 5
- 26
- 29
0
votes
0 answers
How do I populate IUrlHelper from a Background Quartz Task for Email Confirmation?
How do I populate IUrlHelper from a Background Quartz Task for Email Confirmation?
I am using Radzen Studio to create a custom website. It has automatically generated code for an Account Management Controller (AccountController.cs).
I would prefer…

Richard
- 1
0
votes
0 answers
mvc urlHelper mock for test
I set up UrlHelper like this
mockRepository = new MockRepository(MockBehavior.Default);
_context = mockRepository.Create();
_requestBase = mockRepository.Create();
_responseBase =…

kosnkov
- 5,609
- 13
- 66
- 107
0
votes
1 answer
How to write nested functions in UrlHelper?
I'm writting a UrlHelper and now I need to write a nested function because for example I have page Articles which is accessed for everyone and I have separate Articles in Admin panel.
First have link: /Articles and next /Admin/Articles.
So I want to…

nosbor
- 2,826
- 3
- 39
- 63
0
votes
0 answers
ASP.NET Core MVC : UrlHelper.Action fail to resolve when mixing nullable route value and query string parameters
I have a ASP.NET Core MVC application with a simple route. It is the default controller/action pattern with an optional integer parameter. It is configured as:
endpoints.MapControllerRoute("default",…

Dunge
- 532
- 3
- 19
0
votes
1 answer
Call to a member function build() on boolean error in CakePHP 3
I am using the below code in my Controller file to generate full site URL
$this->Url->build(['controller' => 'home', 'action' => 'index'], true);.
But I am getting a "Call to a member function build() on boolean" error. The reason why I am not using…

web_developer
- 71
- 1
- 9
0
votes
0 answers
Un-setting route parameters in razorpages pages
I have a page Index that has two optional parameters: FolderId and OrganisationId.
If I use @page "{OrganisationId:int?}/{FolderId:int?}" at the start of the razorpages page to make nicer URLs then it becomes impossible to remove a parameter from…

Richard Barraclough
- 2,625
- 3
- 36
- 54
0
votes
1 answer
Using url_for (form_for) for new instances of non-activerecord models
I need such a construction:
form_for Project.new
where Project is a model, that's not inherited from AR/AM/Mongoid (inherited from Spira).
Is there some monkey-patch to make Spira models answer to url_for Project.new with correct…

Alexander Ulitin
- 1,150
- 1
- 10
- 23
0
votes
1 answer
Using Rails Url Helper
I have a search form in the header of my site, such as this:
=semantic_form_for :search, :url=>{:controller=>:listings,:action=>:search} do
...
This works fine except when the controller for the current page is scoped or namespaced -- not sure…

picardo
- 24,530
- 33
- 104
- 151
0
votes
2 answers
in asp.net-mvc controller, what is the best way to generate a URL
right now i take the
RequestContext
and pass this into a UrlHelper like this:
UrlHelper u = new UrlHelper(context);
string hrSyncUrl = u.Action("Update", "Person");
but the issue is that this seems to return:
/Person/Update
instead…

leora
- 188,729
- 360
- 878
- 1,366