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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T00:35:22+00:00 2026-05-24T00:35:22+00:00

I recently started an MVC project to query and to report the company’s users,

  • 0

I recently started an MVC project to query and to report the company’s users, everything seemed to be fine, except when I made a finduser form, I got all stuck!

you see I want the operator to be able to find the appropriate user by entering either hos pin,serial or calling number but the action links I make for the search operation all fail because they are made at the form_load time and so the empty string of text boxes get injected to them.

So my requests are:

  1. How to make this filters work.
  2. Now a little Ajax textbox suggester on user pin or serial would be great, please gimme a hint or two.

<table>
<tr>
<td>
PIN:</td>
<td>
<asp:TextBox ID="txt_pin" runat="server"></asp:TextBox>
</td>
</tr>
<tr>
<td>
Serial Number:</td>
<td>
<asp:TextBox ID="txt_sn" runat="server"></asp:TextBox>
</td>
</tr>
<tr>
<td>
CallingNumber:</td>
<td>
<asp:TextBox ID="txt_callingNo" runat="server"></asp:TextBox>
</td>
</tr>
<tr>
<td>
CalledThisNumberToday:</td>
<td>
<asp:TextBox ID="txt_calledNo" runat="server"></asp:TextBox>
</td>
</tr>
<tr>
<td>
&nbsp;</td>
<td>
&nbsp;</td>
</tr>
<tr>
<td>
</td>
<td>
&nbsp;</td>
</tr>
</table>
<%:Html.ActionLink("Search for user", "Details", new { pin = txt_pin.Text })%>

  • 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-24T00:35:22+00:00Added an answer on May 24, 2026 at 12:35 am

    <asp:TextBox>? In an ASP.NET MVC application? I am afraid you got it all wrong.

    I would recommend you going through the getting started tutorials here in order to learn the basic concepts of ASP.NET MVC: http://asp.net/mvc

    In ASP.NET MVC you use models and in the views you use helpers in order to generate input fields.

    So in your case you could design a view model:

    public class SearchViewModel
    {
        public string Pin { get; set; }
        public string SerialNumber { get; set; }
        public string CallingNumber { get; set; }
        public string CalledThisNumberToday { get; set; }
    }
    

    then you could design a controller action which will pass this view model to the view for rendering the search form:

    public ActionResult Index() 
    {
        var model = new SearchViewModel();
        return View(model);
    }
    

    and finally in your strongly typed view you would use HTML helpers:

    <%@ Page 
        Language="C#" MasterPageFile="~/Views/Shared/Site.Master"
        Inherits="System.Web.Mvc.ViewPage<AppName.Models.SearchViewModel>" %>
    
    <asp:Content ID="MainContent" ContentPlaceHolderID="MainContent" runat="server">
    
        <%= Html.ValidationSummary() %>
    
        <% using (Html.BeginForm()) { %>
    
            <div>
                <%= Html.LabelFor(x => x.Pin) %>
                <%= Html.EditorFor(x => x.Pin) %>
            </div>
    
            <div>
                <%= Html.LabelFor(x => x.SerialNumber) %>
                <%= Html.EditorFor(x => x.SerialNumber) %>
            </div>
    
            <div>
                <%= Html.LabelFor(x => x.CallingNumber) %>
                <%= Html.EditorFor(x => x.CallingNumber) %>
            </div>
    
            <div>
                <%= Html.LabelFor(x => x.CalledThisNumberToday) %>
                <%= Html.EditorFor(x => x.CalledThisNumberToday) %>
            </div>
    
            <p><input type="submit" value="Search for user" /></p>
        <% } %>
    
    </asp:Content>
    

    and the final step would be to implement the controller action that will perform the search and to which this form will be subimtted:

    [HttpPost]
    public ActionResult Index(SearchViewModel model)
    {
        if (!ModelState.IsValid) 
        {
            // the model was not valid => redisplay the form
            // so that the user can fix his errors
            return View(model);
        } 
    
        // TODO: perform the search
        ...
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Recently i've picked up my EF 4.1 / MVC 3 project again and started
I have recently started a personal project that uses ASP.NET MVC (RC1 at the
I've started to use Spring recently. And I'm making spring mvc project. So my
I recently started working with MVC or MVC2 to be more exact. I found
I recently started reading about ASP.net MVC and after getting excited about the concept,
I recently started looking into building web applications using .NET MVC and I stumbled
I have only recently started working with the MVC approach, so I suppose this
I just recently started to experiment with .NET MVC 4. The thing is I
I've just recently started to build a web site using ASP.NET - MVC 4,
I've started with ASP.NET MVC recently, reading blogs, tutorials, trying some routes, etc. Now,

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.