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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T13:25:46+00:00 2026-06-17T13:25:46+00:00

How can we add functionality in the Master page in MVC. I am using

  • 0

How can we add functionality in the Master page in MVC.
I am using razor view engine and have some views which are using ‘site.cshtml’ as master page.
Now I want all the views to have some search box and button to search, so i have put a search box and button in master page (site.cshtml). now i want to add functionality on buttoon click.
Where should I have to write the code?
Please help.

  • 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-17T13:25:47+00:00Added an answer on June 17, 2026 at 1:25 pm

    You should add form to your master page, define search method in one of your controller and if needed search view to show results. Form can be defined like in following example:

    @using (@Html.BeginForm("Search", "Home", FormMethod.Post))
    {
    
        <label for="searchTerm">Search</label>
        @Html.TextBox("searchTerm")
        <input type="submit" value="Search"/>
    }
    

    Where Search is an action in Home controller and searchTerm is search string passed as parameter

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

Sidebar

Related Questions

I use a master page for my site and for some reason, I can
In Objective-C you can create a Category which allows you to add extra functionality
I am looking to add functionality to my website where users can add an
I am trying to add email functionality to my app. I can get the
I would like to add excel spreadsheet functionality to the WPF toolkit datagrid, can
We can add an image to an photo album using UIImage *img = [UIImage
I wrote library which can add and update objects in salesforce. I use beatbox
Am thinking about a project which might use similar functionality to how Quick Add
I have created custom master page with custom elements included according to this link:
I have a git repository for a web site, where the master branch represents

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.