hi guys i have a variable declare in js form and has a value , the only problem is I want that variable to be used in image tag source in the asp mvc view. how can I pass that variable to asp?
hi guys i have a variable declare in js form and has a value , the only problem is I want that variable to be used in image tag source in the asp mvc view. how can I pass that variable to asp?
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend4days leftRegister
Muhammad Imran AnsariRank #326 · 7.6K reputationPosted Feb 13, 2022, 1:50 PM EST
Another way is take a hidden variable that hold the value from the javascript
and accessing it on your MVC view. It should work.
Javascript:
document.getElementById('myImageName').value = "image.jpg";
OR you can achive with the following code:
Sachin SinghRank #66 · 26.2K reputationPosted Feb 13, 2022, 1:35 PM EST
Ramon Ortega41 reputationPosted Feb 14, 2022, 9:46 AM EST