使用Mvc3剃须刀应用程序进行搜索 [英] Search using Mvc3 razor application

查看:79
本文介绍了使用Mvc3剃须刀应用程序进行搜索的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在视图中放置一个文本框.我将视图创建为局部视图.
我的部分观点是

I need to place a textbox in my view. i created my view as partial view.
my partial view is

@model MvcApplication1.Models.PropertyMain
@Html.TextBox("txtSearch")
<input type="button" value="Submit" />


在运行表单时,它会显示一个文本框和一个按钮,
我需要根据在该文本框中输入的值来显示结果.我想在哪里写代码?有人可以帮我吗?


and while am running the form it displays one textbox and a button ,
I need to display result according to the value entered in that textbox. where i want to write the code? Can anyone help me?

推荐答案

使用剃刀时,您需要使用javascript或jQuery.

您需要通过JSON从控制器获取数据,然后使用jQuery将其解析到所需的位置.

试试吧,让我知道是否有问题.

-萨加尔·索兰基(Sagar Solanki)
As you are using razor, you need to use javascript OR jQuery for the same.

you need to get data through JSON from controller and parse it to desired location using jQuery.

Try it, let me know if issue.

-Sagar Solanki


这篇关于使用Mvc3剃须刀应用程序进行搜索的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆