Questions tagged as 'razor'

1
answer

When I press enter in the input type file, it opens a blank page

This is my code, pressing enter opens a blank page <div class="form-group"> <div class="col-sm-12"> <div id="fileselection" style="margin-bottom:30px"> @using (Html.BeginForm("A...
asked by 11.12.2015 / 13:31
1
answer

Catch click event a tag when it has not yet loaded in $ (document) .ready MVC - RAZOR [closed]

I dynamically create in my View via razor data that is populated in a table. In my last td I have the following elements: <td class="row-actions fixed-col"><a name="excFaturamento"><i class="fa fa-times"/></a></td...
asked by 10.12.2015 / 18:34
1
answer

Update a viewbag (c # razor) with a javascript variable

Maybe what I want to do may be impossible, due to server and browser side issues, but I'd like to do the following: <script> function pegarId(id) { $('@ViewBag.Id').value = $(this).attr("id"); } </script>...
asked by 30.09.2015 / 07:04
1
answer

pass actionlink parameters to jquery function

How do I pass parameters from an ActionLink from a grid to a jquery function? This is ActionLink: gridPortfolio.Column( format: @<text> @Html.ActionLink("Delete", "DeleteData", new {id = item.CD_PORTFOLIO, par = "PO"}, new { @onClick...
asked by 23.06.2015 / 15:47
1
answer

How to use Url.Action in a Helper Razor?

In an ASP.NET MVC5 project, I created a Helper inside the App_Code folder, however, when I use the Url.Action() function on my Helper the following compile error occurs:    CS0103: The name 'Url' does not exist in...
asked by 03.09.2015 / 16:17
1
answer

How to validate if there is any file to upload?

I have a form to upload files: @using (Html.BeginForm("importCSV", "Administrador", FormMethod.Post, new { @id = "upldFrm", @enctype = "multipart/form-data" })) { <div class="form-inline">...
asked by 15.06.2015 / 13:49
1
answer

Is it possible to use Razor inside a Javascript file?

I have a .js file and would like to use the syntax of Razor inside it. Home I tried to use @ but it did not work. Home Is there any possibility? Can someone help me? I've researched a lot, but I can not find anything ...   ...
asked by 23.04.2015 / 22:56
2
answers

How to pass a variable in a JavaScript function by onclick razor?

I have a series of fields that I need to send from tag Razor to a JavaScript function @Html.ActionLink("Enviar", "ActionName", null, new { onclick = String.Format("envia_pessoa({0}, '{1}', '{2}', '{3}', '{4}', '{5}', '{6}'...
asked by 07.06.2015 / 01:26
2
answers

The requested .Net Framework Data Provider could not be found. Sql Server + Entity

I'm having trouble connecting to my local bank. This is my View , where I try to connect the bank using Razor: @{ ViewBag.Title = "Index"; Layout = "~/Views/Shared/_LayoutOuvinte.cshtml"; var db = Database.Open("Entities"); v...
asked by 16.03.2015 / 22:38
0
answers

Line Break for CheckBox

I'm trying to make in my Razor HTML form screen a scheme to play the "Material Pickup" checkbox for the line below, but I'm not getting it, when selecting the "Water Quantity" option, two new ones appear below which are "Public" and "Private", i...
asked by 20.12.2018 / 21:22