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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T08:07:14+00:00 2026-05-20T08:07:14+00:00

I am new to Stack Overflow and to ASP.NET MVC. I have been asked

  • 0

I am new to Stack Overflow and to ASP.NET MVC.

I have been asked to do a project where I want to use ASP.NET MVC, but I have some problems wrapping my head around it and I hope some of you could get me in the right direction.

The project is a kind of a search portal. On every page there is a dropdown box where you basicly select the dataset (it’s based on books) you want to search. In the dropdown is the name of the book you want to search.

Of course there is also a search field. These 2 objects are on every page and has the same function on all pages, and I can’t get these 2 objects to communicate.

I have these 2 in separate partialviews and want to generate an action for the search formfield something like this:

domain.com/{bookname}/search/{searchterm}: this is the thing created from the dropdown and the search box.

But can I do this in the searchfields partialview in some way, or do I have to grab these value in each controller?

I hope this makes any sense.

  • 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-05-20T08:07:15+00:00Added an answer on May 20, 2026 at 8:07 am

    Create a partial view with your dropdown and textbox, using the BeginForm helper:

    <% using(Html.BeginForm("Index", "Search")) %>
    <% { %>
        <%= Html.DropDownList("BookNames") %>
        <%= Html.TextBox("SearchTerm") %>
    <% } %>
    

    Then in your SearchController’s Index action, you should be able to grab the values from the form collection or using your dropdown’s and textbox’s id.

    public ActionResult Index(FormCollection frmCollection)
    {
      // ...
      // also you can redirect to another action/controller if you needed
      // return RedirectToAction("...", "...");
    }
    

    or

    public ActionResult Index(int bookNames, string searchTerm)
    {
      // ...
      // also you can redirect to another action/controller if you needed
      // return RedirectToAction("...", "...");
    }
    

    Hope this helps.

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

Sidebar

Related Questions

I am knee deep in starting a new ASP.NET MVC project. Several tutorials have
I'm new in ASP.NET MVC2. But I want to develop a simply Newsletter site.
I'm new to SOA (and to Stack Overflow too...) Some services and web applications
i want to display the pop ups in asp.net page like how the stack
I'm trying to get an ASP.NET MVC app working... I should have known it
I'm working on my first ASP.NET MVC 3 application with utilizes some JavaScript and
I'm working on an ASP.NET MVC 3 application and having some issues. I've got
I am fairly new at using the ASP.NET MVC framework and was hoping that
I have an ASP.NET WebForms application that I'm trying to switch to MVC for
I have deployed an ASP.NET MVC application following the article How to: Deploy an

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.