Page Title Language MasterPageFile Views Shared Site Master Inherits S

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
Search
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<script src="../../Scripts/MicrosoftAjax.js" type="text/javascript"></script>
<script src="../../Scripts/MicrosoftMvcAjax.js" type="text/javascript"></script>
<script type="text/javascript" language="javascript">
function CheckInputValue() {
var searchString = document.getElementById("TextWithParams").value;
if (searchString == null || searchString == "") {
return false;
}
else {
return true;
}
}
</script>
<h2>Search</h2>
<div>
<% using (Html.BeginForm("SearchByTextWithParams", "Task", FormMethod.Get))
{%>
<%-- <% using (Ajax.BeginForm("SearchByTextWithParams", "Task", new AjaxOptions { UpdateTargetId = "main", HttpMethod = "get" }))
{ %>--%>
<label for="Name"> Search 2: </label>
<%= Html.TextBox("TextWithParams")%>
<%--, ViewData["Text"], new {text="", id="txtSearch" })%>--%>
<input type="submit" id="btnSearch" value="Search 2" onclick="return CheckInputValue()" /><br />
<%} %>
</div>
<table>
<tr>
<td>
Action
</td>
<td>
Title
</td>
<td>
Created Date
</td>
</tr>
<%if (ViewData["SearchResults"]!= null) { %>
<% foreach (MvcBug.Models.Task t in (IEnumerable<MvcBug.Models.Task>)ViewData["SearchResults"])
{%>
<tr>
<td> <%= Html.ActionLink("Open","Task",new { id = t.TaskId }) %>
</td>
<td>
<%= t.Title %>
</td>
<td>
<%= t.CreatedOn.ToLongDateString() %>
</td>
</tr>
<% } %>
<% } %>
</table>
</asp:Content>