Questions tagged [url-action]

36 questions
8
votes
2 answers

How to use Url.Action in iframe src

How to use the Url.Action method in the iframe src attribute. Like But its not working properly. Its saying that the requested…
user1268740
  • 113
  • 1
  • 2
  • 6
6
votes
1 answer

Url.Action How to add parameter value from the model

In controller I have the action "GetPhoto": public FileResult GetPhoto(int id) { ... } Also, I have Razor code where I'am trying to dynamically add ID parameter from the model: @model ISPIS.Models.KodFazeBiljke ...
Branislav
  • 315
  • 1
  • 3
  • 13
3
votes
1 answer

Why do Url.Action and Request.Url.Host return "localhost"?

I have a form on a page that posts to an external application and I need to send a URL in that post. However, for SOME users the URL is https://localhost/Home/MyAction rather than https://mysubdomain.domain.com/Home/Action. I haven't been able to…
Bob Wintemberg
  • 3,212
  • 6
  • 34
  • 44
3
votes
2 answers

Display byte[] array image from database in Details page template using ASP.NET MVC

When I try to display a byte[] array image inside a Details page template using: public FileContentResult RenderPhoto(byte[] photo) { // var array = (byte[])Session["photo"]; // return File(array, "image/jpeg"); return File(photo,…
Leniel Maccaferri
  • 100,159
  • 46
  • 371
  • 480
3
votes
1 answer

Passing url parameters from Url.Action variables in javascript

I would like to start my question by mentioning that I have read the questions Passing dynamic javascript values using Url.action() and How to pass parameters from @Url.Action to controller For having cleaner code and for having javascript functions…
Anastasios Selmani
  • 3,579
  • 3
  • 32
  • 48
2
votes
1 answer

How can I generate url from non-controller static class in asp.net mvc 2 project?

I have created Html helper class in asp.net mvc2 project: public static class CaptionExtensions { public static string Captions(this HtmlHelper helper, Captions captions) { var sb = new StringBuilder(); …
Cemsha
  • 183
  • 3
  • 14
2
votes
1 answer

submit form outside Html.BeginForm MVC

I want to be able to submit a form outside the Html.BeginForm, this is what i have and is working inside the form..
JaperTIA
  • 129
  • 1
  • 2
  • 13
2
votes
1 answer

Using URL.Action inside a LINQ select method

I want to create a view model that holds list items, and each item will hold the edit and delete action URL so I have the following code: public ActionResult Index() { AdministrationViewModel model = new…
Mortalus
  • 10,574
  • 11
  • 67
  • 117
1
vote
1 answer

How to send parameters to JavaScript function from inside of a ClientTemplate of a Kendo.Grid?

My view has a Kendo Grid with a ClientTemplate defined for a column in the following way: .ClientTemplate("
gene
  • 2,098
  • 7
  • 40
  • 98
1
vote
1 answer

How to add parameters to url.action()?

I am trying to add some parameters like rel and hreflang to my language selection links, but it seems that there is a limited number of parameters. Is there any other solution to do that ? I know it's feasible with actionLink, but url.action seems…
user11791297
1
vote
1 answer

Url in ASP.NET MVC layout

I have the following problem. I created a layout and two views that use it. Each view uses different controller. Part of the layout is navigation with site name. What I want to do is to make site name link to always point to Home/Index action. It…
pawel.podsiadly
  • 171
  • 2
  • 13
1
vote
1 answer

MVC Url.Action behaves different in different pages

I have seen an interesting behavior for asp .net "Url.Action". A link like @baslik seems in client browser as denemebaslik, then user clicks this link and goes to target page.…
serefbilge
  • 1,654
  • 4
  • 29
  • 55
1
vote
0 answers

URL Hashchange in Play Application fails on webapp

I have a play framework application which I add to homescreen on my iPhone. It works and looks like a charm except one thing: If i change the URL location.hash via an anchor tag (localhost:9000/connect/# to localhost:9000/connect/#/hashchange), Play…
David Fariña
  • 1,536
  • 1
  • 18
  • 28
1
vote
2 answers

How to access the string output of a JavaScript function in an MVC 4 razor html url action?

I want to be able to pass the string output of my javascript function as a parameter to my MVC 4 Razor Url Action which itself is passed as a custom attribute to the input element. Here is the razor in my view file: @Html.TextBoxFor(model =>…
Pejman
  • 3,784
  • 4
  • 24
  • 33
0
votes
0 answers

Why is my Javascript validation working on pc browsers, but not on phone browsers?

I have a form that I'm validating. I, obviously, want the validation to work both on pc and mobile browsers. If I fill the form from a computer browser, I have no problem. When I fill the form on a phone the validation text does not update. I've…
Fetus
  • 1
  • 4
1
2 3