Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Advanced search

Advanced search

Scheduled Pinned Locked Moved ASP.NET
javascripthtmldatabasedesigntools
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    smile9x
    wrote on last edited by
    #1

    i have code

    [AllowAnonymous]
    public ActionResult IndexDT(int? page, string sortOrder, string currentFilter, string searchString)
    {
    ViewBag.CurrentSort = sortOrder;
    ViewBag.NameSortParm = String.IsNullOrEmpty(sortOrder) ? "TenSanPham desc" : "";
    ViewBag.CostSortParm = sortOrder == "Gia" ? "Gia desc" : "Gia";
    if (Request.HttpMethod == "GET")
    {
    searchString = currentFilter;
    }
    else
    {
    page = 1;
    }
    ViewBag.CurrentFilter = searchString;
    int pageSize = 2;
    int pageNumber = (page ?? 1);
    return View(spBLL.ListDT(searchString, sortOrder).ToPagedList(pageNumber, pageSize));
    }

    @model PagedList.IPagedList<ComputerBLL.SanPham>
    @{
    ViewBag.Title = "IndexDT";
    }
    <script src="../../Scripts/jquery-1.7.1.js" type="text/javascript"></script>
    <script src="../../Scripts/jquery-ui-1.8.20.js" type="text/javascript"></script>
    <script src="../../Scripts/jquery.unobtrusive-ajax.js" type="text/javascript"></script>
    <script type="text/javascript">
    $(document).ready(function () {
    $("#timKiemNangCao").click(function () {
    $("#search").after('');
    });
    });

    function TimNangCao() {
        var sanpham = new Object();
        sanpham.TenSanPham = $("#name").val();
        $.ajax({
            type: "POST",
            url: '../../SanPham/TimKiemNangCao',
            data: JSON.stringify(sanpham),
            contentType: 'application/json; charset=utf-8',
            success: function (data) {
                $(document).html(data);
            },
            error: function (xhr) {
                alert(xhr.toString());
            }
        });
    }
    

    </script>
    <h2>Index</h2>

    <p>
    @Html.ActionLink("Create New", "CreateDT")
    </p>

    @using (Html.BeginForm())
    {
    <p id="search">
    Find by name: @Html.TextBox("SearchString", ViewBag.CurrentFilter as string)  
    <input type="submit" value="Search" />
    <a style="color:Blue; cursor:pointer" id="timKiemNangCao">Tìm kiếm nâng cao</a>
    </p>
    <table style="text-align:left">
    <tr><td><span>Tên sản phẩm</span></td><td><

    Z 1 Reply Last reply
    0
    • S smile9x

      i have code

      [AllowAnonymous]
      public ActionResult IndexDT(int? page, string sortOrder, string currentFilter, string searchString)
      {
      ViewBag.CurrentSort = sortOrder;
      ViewBag.NameSortParm = String.IsNullOrEmpty(sortOrder) ? "TenSanPham desc" : "";
      ViewBag.CostSortParm = sortOrder == "Gia" ? "Gia desc" : "Gia";
      if (Request.HttpMethod == "GET")
      {
      searchString = currentFilter;
      }
      else
      {
      page = 1;
      }
      ViewBag.CurrentFilter = searchString;
      int pageSize = 2;
      int pageNumber = (page ?? 1);
      return View(spBLL.ListDT(searchString, sortOrder).ToPagedList(pageNumber, pageSize));
      }

      @model PagedList.IPagedList<ComputerBLL.SanPham>
      @{
      ViewBag.Title = "IndexDT";
      }
      <script src="../../Scripts/jquery-1.7.1.js" type="text/javascript"></script>
      <script src="../../Scripts/jquery-ui-1.8.20.js" type="text/javascript"></script>
      <script src="../../Scripts/jquery.unobtrusive-ajax.js" type="text/javascript"></script>
      <script type="text/javascript">
      $(document).ready(function () {
      $("#timKiemNangCao").click(function () {
      $("#search").after('');
      });
      });

      function TimNangCao() {
          var sanpham = new Object();
          sanpham.TenSanPham = $("#name").val();
          $.ajax({
              type: "POST",
              url: '../../SanPham/TimKiemNangCao',
              data: JSON.stringify(sanpham),
              contentType: 'application/json; charset=utf-8',
              success: function (data) {
                  $(document).html(data);
              },
              error: function (xhr) {
                  alert(xhr.toString());
              }
          });
      }
      

      </script>
      <h2>Index</h2>

      <p>
      @Html.ActionLink("Create New", "CreateDT")
      </p>

      @using (Html.BeginForm())
      {
      <p id="search">
      Find by name: @Html.TextBox("SearchString", ViewBag.CurrentFilter as string)  
      <input type="submit" value="Search" />
      <a style="color:Blue; cursor:pointer" id="timKiemNangCao">Tìm kiếm nâng cao</a>
      </p>
      <table style="text-align:left">
      <tr><td><span>Tên sản phẩm</span></td><td><

      Z Offline
      Z Offline
      ZurdoDev
      wrote on last edited by
      #2

      I am not going to read through all of your code to try and make sense of it. Please narrow down to what specific lines of code are relevant and also explain why you are having a hard time.

      There are only 10 types of people in the world, those who understand binary and those who don't.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups