websss
asked on
mvc razor - update html img src from c#
I'm new to mvc and razor
i have an image showing on first load with no issues (camera1.jpg)
its written in the c# backend and set on the screen with no problem at all (on initial load)
then, when the c# tries to set a different image (camera3.jpg), it doesn't change from image1 to image2
however when i debug its showing the new image (camera3.jpg) in the variable, but the one on screen is always showing the original (camera1.jpg)
here is the code,and it show the variable with the new image, but it does not update the img
what am i doing wrong?
i have an image showing on first load with no issues (camera1.jpg)
its written in the c# backend and set on the screen with no problem at all (on initial load)
then, when the c# tries to set a different image (camera3.jpg), it doesn't change from image1 to image2
however when i debug its showing the new image (camera3.jpg) in the variable, but the one on screen is always showing the original (camera1.jpg)
here is the code,and it show the variable with the new image, but it does not update the img
what am i doing wrong?
This question needs an answer!
Become an EE member today
7 DAY FREE TRIALMembers can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
You need to wrap @Url.... with double quotes.
Open in new window
Giannis