323 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
0
votes
1
answer
20
views
Repository and information to pass to the view
I am implementing Repository.
I had a controller that used 'ViewData' to pass the user ID to my view.
Old ArticlesController.cs:
public IActionResult AjoutArticle()
{
ViewData["...
0
votes
1
answer
45
views
I can not get FoodSelectedId in my Form in ASP.Net
This is my method for add food to my chef in my form: I want to add some food that was created before
[HttpGet]
[Route("CreateNewChefFood")]
public async Task<...
0
votes
1
answer
92
views
How to Post New Record to Table and Pass that ID to another page to Create a Related Record
I am trying to Add a New Client on the Add Client (Create) page of my razor app. After the user fills out that page and clicks "Add Client" to commit the data to the Client.db, I want my app ...
0
votes
1
answer
106
views
Handling multiple items of data on the same view page
I have 3 pages on a app I am writing. It is historical, view Rabies Vaccine info only.
Owner Info - has a view list of pets owned
Pet Detail Info - has a view list of vaccines received by that ...
0
votes
2
answers
318
views
How do pass value of a list using ViewBag in a partial view?
I have a view showing all posts in the database. And I need to create a partial view that contains the top 5 highest viewed posts.
Here is my PostController controller:
public class PostController : ...
0
votes
1
answer
296
views
I am unable to see the Full Data(Analysis -> View data) in Tableau
My data contains around 10000 records.
I have published my workbook in the browser. I am able to see the summary and full data in Tableau (2022年1月1日) version.
But I am unable to see the content in Full ...
0
votes
1
answer
146
views
asp.net webapp - is viewdata safe for local request variable?
What is my need -I have a .net7.0 asp.net-webapp (razor). There are some parts of my cshtml that i want to customise based on per request which will be determined by c# corresponding PageModel class ...
0
votes
1
answer
536
views
How do I render js code in .cshtml file based on C# value
Hi gus I have a question again. Is it posible to render js code baised on C# value in razor page ? And how do I do that ? For example:
@{
double numberA = (double)ViewData["someVal"];
}
&...
0
votes
0
answers
23
views
I want to read an array from the controller and use it in an Html script
I'd love some help here :)
I'm trying to read the array I have in the controller into a variable in the script and use it.. Can someone help me please?
I'm actually trying to make an array of the ...
1
vote
1
answer
85
views
Show different View Data in view with different class in ASP.NET Core
This is my controller:
public async Task<IActionResult>ActiveEmailAccount(EmailActiveAccountViewModel active)
{
if (ModelState.IsValid)
{
var result = await ...
0
votes
1
answer
118
views
Putting data from two tables into one ViewData
I'm trying to put data from two tables (AcademicDegrees, Lecturers) connected by one to many relations into one ViewData to generate options to field (with label and id as value). It should be ...
0
votes
2
answers
270
views
Want to display a value of a loop outside of the loop as a heading in Razor pages
I want to display @s.CARDNAME that is used in the for each loop inside the else statement outside the loop as a heading:
<div><h4 style="text-align:center; margin-bottom:20px;"&...
1
vote
1
answer
2k
views
Why do we have ViewBag and ViewData, if they are doing the same thing in ASP.NET Core MVC
Why do we have ViewBag and ViewData if they are doing the same thing in ASP.NET Core MVC? Is there anything which ViewBag can do and ViewData can't - or vice versa?
Any specific scenario when should I ...
2
votes
1
answer
1k
views
How to pass a ViewBag/ViewData from a PartialView to the parent view in ASP.NET Core?
I need to get the value of my ViewData["CurrnetPageId"] which is inside an action method returning a partial view, in its parent view.
My parent action method called ShowSingleProduct looks ...
0
votes
1
answer
1k
views
The Name 'ViewData' does not exist in the current context in a razor page
This is not a duplicate of The name 'ViewData' does not exist in the current context since that question asks about ASP.NET MVC, which is different from .NET Core!!!
I added the following C# ...