61 Replies
need help
shit is due in 12 hours before i have to submit
once the submit button was clicked, it will run whatever function
HomeController.GetDetails()
iswell yeah but
i think it might my sql statement or
value input
what?
Explain what your problem is exactly
What part is not working
ok when i submit the form , data should be inserted in the db but its not
Does it throw an exception?
dont think it does?
Either Visual Studio would show a popup or the console would display sum
unless its connection string?? idk
Does it say Data Saved Successfully?
lemme test that again , tough how u see viewbag.result lol
Display ViewBag.Result in the cshtml somewhere
also slap me
heh
Anyhow, put a breakpoint on line 41
And check what it returns
hmmm i hit submit and
doesnt reacch
so does tat mean GetDetails() did not trigger?
sus
Put a break point at the very top of the function
Does it hit that?
lmao it didnt
dies
means it did even touch the getdetails
not
does your form contain a <button type="submit">?
input type =submit
should i put button?
what?
might be that lol i go test
didnt its gonna be 1am for me
but watever
save me gdi
Rename your method endpoint into
SaveDetails()
Then head over to your form and make it
The button on the bottom of the form should look something like this:
@Kurarinok??
ok?
method endpt?
SaveDetails ah?
so naming
Yep
That's an endpoint
whenever i test it will say ended with code
Where does it say it?
thats normal
With my above changes, pressing the submit button, does it enter the method now?
doesnt even
go into the database
if it did , i wouldve seen it in
Show me the top of your controller class
And show me your cshtml form
ye some stuff are not working
The stuff you have in your
<head>
doesnt belong there btw, it goes into the body
You can move the meta tag in there though
Show me the submit buttonOpen the Dev Tools in your browser
Go to "Network"
now click the submit button and see if you can find a red-highlighted entry in the network tab
run the project first?
yes
is that after pressing the button?
yeah
Change the form action to only "/"
after changing formaction to /
It doesnt hit the breakpoint, does it
doesnt
welp
unless this shit telling me to redo my whole form
:l
im too tired to type out all the crap
One thing that comes to mind, is to use parameter binding
Getting posted data from
HttpContext.Request
is some 2001 shit
Maybe, assuming you're using a decently-recent version of ASP, it can't see this action because it believes this action takes no parameters
Parametric polymorphism and all that