Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8165751
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T19:38:06+00:00 2026-06-06T19:38:06+00:00

I have a an object view with data and a button on that view.

  • 0

I have a an object view with data and a button on that view. The user can review the object info and click the button to go to a new view form whee he can enter info to create an item. My challenge is this, how would I attach the ID of the object on the previous view to associate it with and attach to the information they create and submit?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T19:38:07+00:00Added an answer on June 6, 2026 at 7:38 pm
    @Html.ActionLink("Add","AddNotes","Object",new {@id=5},null)
    

    This will create an a tag with querystring ?id=5. (You may replace the hardcoded 5 with the dynamic value in your view)

    Have a property to keep this value for your ViewModel/Model for the create form.

    public class CreateNoteViewModel
    {
      public int ParentId { set;get;}
      public string Note { set;get;}
      //Other properties also
    }
    

    Read this in your GET action method which creates the second view and set the value of that property of the ViewModel/Model.

    public ActionResult AddNotes(int id)
    {
      var model=new CreateNoteViewModel();
      model.ParentId=id;
      return View(model);
    }
    

    And in your strongly typed view, Keep this value inside a hidden variable.

    @model CreateNoteViewModel
    @using(Html.BeginForm())
    {
     @Html.TextBoxFor(Model.Note)
     @Html.HiddenFor(Model.ParentId)
     <input type="submit" />
    }
    

    Now in your HttpPost action , you can get the Object Id from your POSTED model’s ParentId property

    [HttpPost]
    public ActionResult AddNotes(CreateNoteViewModel model)
    {
     if(ModelState.IsValid()
     {
       //check for model.ParentId here
       // Save and redirect
     }
     return View(model); 
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a user control on a form that can spawn several non-modal child
I have a form created with Knockout.js. When the user presses the submit button,
I have a view that I pass a viewmodel object to that contains an
I have this class: class View(object): def main_page(self, extra_placeholders = None): file = '/media/Shared/sites/www/subdomains/pypular/static/layout.tmpl'
I have a parent-child view model object structure set up and need to update
In my application, we have a view model object from which we're retrieving its
I have the following requirement. I submit a Model object to a view as
I have a View (created using Backbone.View.extend) and a JSON object, I actually get
Assume some domain and view objects (that have no common base class) public class
Say I have a class ObjectA (a view controller for example), that does this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.