Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

209
Views
Passing JS variable to other controller in C# and put variable to input

I dont know how to pass JS variable from HomeController Index.cshtml to EditController Create.cshtml (scaffolded) mayby someone can help me.

My simple code in Index.cshtml

@Html.ActionLink("Pass variable to create", "Create", "Edit", new {}, null)
<script>
    var JS_Name = 'Jessica';
    var JS_DateOfBirth = '25-09-2020'
</script>

I just want to Jessica was in the name field and 25-09-2020 in DateOfBirth field.

I try with new{} but with no succes. In further project i will have a lot of variables to pass.

Can someone give me the clue how to do it correctly?

scafolded create

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!