Skip to main content

All Questions

Tagged with
1 vote
1 answer
33 views

How to conditionally render style attribute in Razor template without causing NullReferenceException?

I am working on a templating project using C# and Razor Engine (Razor Templating Engine). The objective is to create React code using my own JSON definition. My AppDefinition.json looks like this when ...
Harsha W's user avatar
  • 3,316
0 votes
0 answers
30 views

ASP.NET MVC datepicker doesn't show calendar

I'm trying to add datepicker, however when I try to use @html.TextboxFor, the calendar is not popping up. As for EditorFor to input="date" options, they show mm/dd/yyyy format when I need dd/...
DeP.'s user avatar
  • 1
0 votes
0 answers
33 views

How to autopopulate fields from razor view page

I have already created a view that displays data in a razor page (5 columns) studentFirstName, StudentLastName, StudentId, CourseId, Grade It also displays a button (instead of default Edit link) ...
user2835586's user avatar
0 votes
0 answers
35 views

Issue with RadioButtonFor in Index.cshtml - ASP.NET MVC 5

In my Index.cshtml in ASP.NET MVC 5, I have the following code and it works fine. <div>@Html.DisplayNameFor(model => model.IsEnrolled) Enrolled </div> But, if I replace the same code ...
khurj's user avatar
  • 17
1 vote
0 answers
38 views

Converting UTC time in model to Local time in view

I have a C# model that includes a list of items, and each item has a DateTime property containing a time that is represented as UTC. I need to render those times to the UI, which is a cshtml page, and ...
LordWilmore's user avatar
  • 2,902
0 votes
2 answers
86 views

How to update a table and refresh the partial view

I am using ASP.NET MVC and have a HomeController, model, and view. I am trying to create a search filter, where the user can type in some characters, click submit, and filter a table (in a partial ...
Calvin's user avatar
  • 17
0 votes
2 answers
56 views

Form in foreach in Razor view: Validation is shown to all the elements

Consider the following Razor code foreach(Person p in Model.Persons){ <form> @Html.TextBoxFor(m => p.Name) @Html.ValidationMessageFor(m => p.Name) @Html....
Alessandro's user avatar
0 votes
3 answers
94 views

How to pass value from controller to view and display it in a text field or label

I am a bit stuck trying to figure out on how to show the value of a field model.SumValue which I am calculating in the controller class in a input field or a label. Controller class - public ...
Dazzler's user avatar
  • 382
1 vote
0 answers
117 views

Navigation to file on parameter with Custom Helpers for cshtml

I have a custom helper @Url.Content("./customfolder/typescript.ts", ContentExtension.ToJs) that alters the file and directory. But I lose the functionality to navigate to the original file. ...
Bas's user avatar
  • 36
0 votes
0 answers
39 views

Cannot see any changes i made in the cshtml file on browser

I'm a newbie in programming (17 y.o), and I am currently struggling with ASP.NET. When I create a .cshtml file and try to test it in the browser, I see the default interface that Microsoft provides. ...
Kanan Akhundov's user avatar
1 vote
2 answers
67 views

InvalidOperationException: The view 'AddValue' was not found. Partial View not found when submitting form data

I'm trying to insert data into two table from a single View Page. I've used two different view model to do that. So I have to make a partial view for inserting data in second table. Now full page is ...
Abdullah Al Mahmud Khan's user avatar
0 votes
0 answers
47 views

Using <select></select> to Show Name + Surname and value = "id"

I tried to show all users with role "Trainer" and choose one of them. But post an id. select returns null. <div class="form-group"> <label asp-for="...
speedevil123's user avatar
-1 votes
1 answer
40 views

@await RenderSectionAsync giving "Cannot await 'method group' "

I am creating a razor application consisting of two simple user inputs and two navigation tabs with 'save' and 'cancel' button for the user inputs. I have pasted below part of the _Layout.cshtml code ...
Akhil Josef's user avatar
0 votes
0 answers
35 views

Multiple key value pairs for select and onchange

Currently I have a select with a list set in the model and an onchange to display the information according to that value. An update has been requested to have another section of the Model added. I ...
Stacy Hunt's user avatar
0 votes
0 answers
22 views

How to rename file at SFTP, using PostAsJsonAsync in C# & ASP.NET MVC

I am using C# & ASP.NET MVC, which I am not so good at. I have function already built in the system to upload files through SFTP. It is called UploadFileAsync and takes one parameter. Here is the ...
asmgx's user avatar
  • 7,850

15 30 50 per page
1
2 3 4 5
1130