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 8007525
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T17:51:30+00:00 2026-06-04T17:51:30+00:00

I have a Home ViewModel class which contains others class: public class HomeVM {

  • 0

I have a Home ViewModel class which contains others class:

public class HomeVM
{
    public ProductSearchRequest ProductSearchRequest { get; set; }
    //Other class
    //Other class
    //Other class
}

My home/Index view has @model HomeVM, and there I have a search text input:

@using (Html.BeginForm("Search", "Product"))
{
    @Html.TextBoxFor(m => m.ProductSearchRequest.SearchText)
    <input type="submit" value="Search" />
}

But in my Product/Search I need to receive only ProductSearchRequest because there is other pages that uses other ViewModel but contains ProductSearchRequest.

I’m trying this:

public ActionResult Search(ProductSearchRequest request)
{
    var response = new ProductSearchResponse
    {
        SearchText = request.SearchText,
        Products = GetProductsByName(request.SearchText)
    };

    return View(response);
}

but it doesn’t work.. request.SearchText is always null..

How can I do this?

  • 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-04T17:51:31+00:00Added an answer on June 4, 2026 at 5:51 pm

    This is just a stab in the dark, but your action, try calling the parameter ‘ProductSearchRequest’

    Or how about putting your whole form in a view for that action I.e. ‘Search’ that takes the ‘ProductSearchRequest’ as model?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a main page which uses a ViewModel I have created: public class
I have a complex view model which contains a collection of other objects which
I have model public class QuestionViewModel { public string Text { get; set; }
I have the following classes: public class ComplexType { public long? Code { get;
I have a view that I pass a viewmodel object to that contains an
//Model public class SelectModel { public string CategoryId { get; set; } public List<SelectListItem>
I have folder home/admin. In this folder there is index.php. When i access to
I have an application built using JSF1.2. I have a home page which has
i have a jquery Dialog in a partial view: @model JQueryDialogPoc.Models.FeedBack @using (Ajax.BeginForm(GiveFeedback, Home,
I have two actions inside my controller (shoppingCartController) public ActionResult Index() { //some stuff

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.