✅ URL in my ASP.Net core applicatie won't change
i'm trying to submit a form but it won't pass the id
72 Replies
this is how the form looks like:
so when you click on the image the form need to submiy
submit
The image field doesn't have a name
And it has an
src
and alt
for some reason
As if it was an image elementi just followed w3
when i try this:
i get this url
i want:
this for example
First of all,
img
is not a form field
Second, you can't send files through GET
Third, you need the form to be multipart/form-dataokey
how am i be able to send a form when i need to click on an image?
Elaborate
uhh
What do you mean "send a form when I need to click on an image"?
Do you want the send form button to be an image?
Do you want to send an image file?
no no
Do you want the user to pick one of multiple images and send that?
yes yes
when a user clicks on an image i want teamID=5 for example in my url
so it needs to be a submit i thought
i just tried
doesn't work
Elaborate
what does that mean?
what exactly is the issue
does no form appear
do you not see the image
does a request not fire when you click on it
there are a lot of moving parts in this problem
ok so i will explain it again
"Doesn't work" is like telling a doctor "me hurt"
break it down
We need details
ok so
i have different images. Every image is a TEAM:
when a user clicks on an image he needs to be able to see all the riders in that team
so for example
you see when the url changes the riders appears
that is good
now
i want when a user clicks on a specific image, he needs to see different riders
but i don't know how to do it when i click on an image to pass the id
that is my problem
my controller is perfect
Seems like you don't even need a form, then
its just somewhere in my form the problem
hmm
Just
when i do that i get
it wo't take my id
won't
Meaning?
yeah so
my asp-route-id does not take that i think
i get no suggestion
Ah, duh, you also need
asp-action
My badyeah i know that
i already added taht
it looks like this but still doesn't work
What parameters does that action take?
teamID
Ah, you want
asp-route-teamID
thenahh
still not working
do you want me to pass something in there?
Well it's empty
Yes, the... ID?
yeah but also when i put teamID in there it doenst'w ork
Meaning?
Does it crash?
Does it make you microwave explode?
LOL
if i use this:
than i get
LOL
Well, yes
That's what you passed there
Pass
5
and you'll get 5
but i get no suggestions
Pass
@Model.Stuff
and you'll get whatever's in the .Stuff
property of the modelahh wait a sec
i'm so freaking good
it works
There we go, nice
thx broo
<:thumbsUP_rrc:743706263636148255>
you are a live saver
life