티스토리 뷰
View
<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>
<!DOCTYPE html>
<html>
<head runat="server">
<meta name="viewport" content="width=device-width" />
<script src="<%: Url.Content("~/Scripts/jquery-1.7.1.min.js") %>" type="text/javascript"></script>
<script src="<%: Url.Content("~/Scripts/jquery.unobtrusive-ajax.min.js") %>" type="text/javascript"></script>
<title>FormAjax</title>
</head>
<body>
<div>
<h2>What time is it?</h2>
<% using (Ajax.BeginForm("GetTimeFormAjax", new AjaxOptions { UpdateTargetId = "myResults" }))
{ %>
<p>
Show me the time in: <%: Html.DropDownList("zone", new[] { new SelectListItem { Text ="UTC", Value="utc" }, new SelectListItem { Text = "KST", Value = "kst" } }) %>
<input type="submit" value="Go" />
</p>
<% } %>
<div id="myResults" style="border: 2px dotted red; padding: .5em;"> My result </div>
<p>This page was generated at <%: DateTime.Now.ToString("tt h:MM:ss") %></p>
</div>
</body>
</html>
Controller
public string GetTimeFormAjax(string zone)
{
DateTime time = DateTime.UtcNow.AddHours(offsets[zone]);
return string.Format("<div>The time in {0} is {1:h:MM:ss tt}</div>", zone.ToUpper(), time);
}
private Dictionary<string, int> offsets = new Dictionary<string, int>() {
{"utc", 0}, {"kst", 9}
};
- Total
- Today
- Yesterday
- nl2br
- java web-mvc
- java-개발 환경 설정하기
- 람다식(lambda expression)
- 제품 등록
- error-java
- jsp 오픈 소스
- 표현 언어(expression language)
- java.sql
- jstl(java standard tag library)-core
- 메이븐(maven)
- 스프링 시큐리티(spring security)-http basic 인증
- docker
- jstl(java standard tag library)
- java 키워드 정리
- In App Purchase
- system.io
- await
- .submit()
- 문자 자르기
- System.Diagnostics
- 스프링 프레임워크(spring framewordk)
- 스프링 프레임워크(spring framework)
- 특정 문자를 기준으로 자르기
- 스프링 시큐리티(spring security)
- React
- 인텔리제이(intellij)
- REST API
- 진수 변환
- MainActor
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |