last day (15 days later) » 

11:19 AM
0
A: Passed parameter is empty in controller (ASP.NET MVC)

Md Farid Uddin Kiron fakeModel.NewName is empty. What is missing or how to change it? You are missing the Model reference which causing the issue because fakeModel.NewName attribute bind from FakeModel which you haven't included with of your @model . You should add as following: @model MVCApps.Models.FakeModel @usi...

 
can you show me how looks like view?
 
@4est Added the view with details source
 
can you upload solution? as still I got null
 
Okay adding that as well
Updated the full code that I have tested your scenario with.
 
target framework is .net core 2.1
 
11:19 AM
Yes I know but I have updated because it it will remain same for other platforms as well becuase all core xxx version belongs to asp.net core. Thus, have updated tag so that the issue doesn't get redundant. If you think its not required please ommit that thanks.
 
I corrected as your answer, action from controller is called but fakeModel.NewName is empty :(
 
Okay you can set as asp-for="@Model.NewName"
Please check the updated answer and let me know if that works accordingly.
 
@Md can you chat me priv?
hi
 
still is not working, I don't know why :/ can I somehow upload app that then you can check on your site?
 
11:21 AM
Whats your issue?
 
value passed is empty
 
Let me have a look
How can I check?
 
thank, I will zip it and put to filetransfer to download
 
It will take longer, if you don't have any alternative do it
 
the solution contains just this element
 
11:24 AM
Checking
Which version of visual studio did you used?
 
vs 2019, v 16.11.21
 
I can see the code you have pasted on SO
I can not see the code you have pasted on SO
I can see Vote something
 
Views.Voter.Index.Index.cshtml
into stack I changed the name (to fake)
VoterController.AddVoter
 
Checking
I am getting lot of compilation error
 
I don't have it
 
11:35 AM
what I can predict its compltely your project issue , the solution I have provided is correct.
 
if this is some problem, can you upload here you solution as I did it ?
that I can download and run on my site?
 
Let me try
 
ok found issue into Controller
 
Here is the link
Please confirm you have download it
I will leave once you reply
Yes I have build that in 2.1
And asp.net core MVC means it belongs to all version, most importantly, your implementation will work accordingly regardless of any version.
No version dependency required to execute that code
Okay hope it will resolve your issue.
 
11:51 AM
parameter name into controller was wrong, after change it's working
thanks for help, I accepted the answer
good day!
 
12:02 PM
Glad to assist you on this.
 

last day (15 days later) »