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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T21:51:53+00:00 2026-06-01T21:51:53+00:00

I am trying to make search function with actionLink. the actionLink will give parameter

  • 0

I am trying to make search function with actionLink.

the actionLink will give parameter to controller such as

@Html.ActionLink("Intel Core i5", "Search", "Store", new { @searchString = "i5" }, null)

I pass this value and it is working in controller. However, when I trying to compare decimal datatype, not string datatype. Currently, processor is varchar, and dissplaySize is decimal.

I don’t know how to handle displaySize with searchString.

My controller is this.

//Controller here
 public ActionResult Search(string searchString)
    {

        var product = from a in _db.Product.Include(a => a.Category)
                      select a;
        if (!String.IsNullOrEmpty(searchString))
        {
            //processor is working because searchString is string, however, 
            //displaySize is not working because of decimal value, and 
            // I don't know how to write Where condition in here.
            product = product.Where(a => a.processor.ToUpper().Contains(searchString.ToUpper())
                               ||
                   //a.displaySize.ToString().Contains(searchString.ToUpper()));
            //I repalce to below code, but it has error 
            //'Entity does not recognize the method ''System.String ToString()' method.
                   Convert.ToDecimal(a.displaySize).ToString().Contains(searchString)

        }
        return View(product.ToList());
    }
  • 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-01T21:51:55+00:00Added an answer on June 1, 2026 at 9:51 pm

    definitely a.displaySize.ToString().Contains(searchString.ToUpper())); wouldnt serve the puprpose. try comparing the integer part of the decimal value with the search string that will give more accurate results. like this Convert.ToInt32(a.displaySize).ToString().Contains(searchString)

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

Sidebar

Related Questions

I'm trying to make a search form without an entity. Controller: public function SearchFormAction()
I am trying to make a search function using the combination of DOM, PHP
I'm trying to make a search feature that will search multiple columns to find
I've been trying to make a simple search inside a static HTML page using
I'm encountering a big problem when i'm trying to make a recursive search function
I'm trying to make a simple search box. How can I trigger a function
I'm trying to make a Chrome extension that will search different cache databases for
I'm trying to make a javascript function to change the value of a parameter
I am trying to make a search function to work with algebra problems. I
I am trying to make a search view in Django. It is a search

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.