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

  • Home
  • SEARCH
  • 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 9142379
In Process

The Archive Base Latest Questions

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

I am creating a page with a search property. The user will enter a

  • 0

I am creating a page with a search property. The user will enter a number in the search field and hit the submit button. I need to be able to call a controller method in order to run the search code.

For now I am just trying to hit a partial page to just get some functionality in there. Below is the code I have so far. As of now nothing happens when I click the button. I hear Ajax was something to use so I have been playing with that a little. I am still learning the framework so bear with me.

<div class="span6 roundedCorners">
    <div class="row-fluid Title">
        <div class="span6">
            Search Area
        </div>
    </div>
    <div class="row-fluid individual">
        <div class="row-fluid">
            <div class="span4"><span class="pull-right fieldDescription">Number</span></div>
            <div class="span8"><input /></div>
        </div>
        <div class="row">
            <div class="span12" id="adminSubmitButton">
                @using (Ajax.BeginForm(new AjaxOptions { UpdateTargetId = "_adminDetails" }))
                {
                    <button type="submit" class="btn btn-inverse">Submit</button>
                }
            </div>
        </div>
    </div>

  • 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-17T09:46:14+00:00Added an answer on June 17, 2026 at 9:46 am

    Your form is empty, it only has a submit button. You will need to move your search button inside the form. Something like this:

    Model

    public class SearchModel
    {
        [Required]
        public string Query { get; set; }
    }
    

    View

    @model SearchModel
    
    ...
    @using (Ajax.BeginForm(new AjaxOptions { UpdateTargetId = "_adminDetails" }))
    {
       @Html.EditorFor(m => m.Query)
       @Html.ValidationMessageFor(m => m.Query)
       <button type="submit" class="btn btn-inverse">Submit</button>
    }
    
    <div id="_adminDetails"></di>
    

    Note: Make sure you have an element with id _adminDetails

    Your controller will have to take the model and perform the search. Example:

    Controller

     [HttpPost]
     public ActionResult Index(SearchModel model)
     {
        //do something with your model (perform search)
        return View(results);
     }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm creating a page search function and I need to compare the contents of
I am creating a search page where we can find the product by entering
I am creating a page where people can post articles. When the user posts
I am creating one asp page. In that page i defined one property like
I'm creating a web page that search users in the database. When I'm typing
I'm creating a page that's a search result... When you're viewing one of the
When you are creating a Search for your Website, you Want the user experience
I'm creating a search page, the page has a form that is being submitted
I'm creating a page with two web parts: one with a search UI and
I'm creating a Google-like application in Visualforce where the user enters a search term,

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.