2011년 12월 10일 토요일

[MVC3] GET 파라미터 받기


HttpUtility.HtmlEncode 를 이용하여 파라미터를 받을 수 있다.
public string Browse(string genre)

{

string message = HttpUtility.HtmlEncode(“Store.Browse, Genre = “ + genre);

return message;

}

2011년 12월 6일 화요일

[HTML5] 선 긋기

<!DOCTYPE HTML>
<html>
<head>

<script>
window.onload = function(){
// get the canvas DOM element by its ID
var canvas = document.getElementById("myCanvas");
// declare a 2-d context using the getContext() method of the
// canvas object
var context = canvas.getContext("2d");
// set the line width to 10 pixels
context.lineWidth = 20;
// set the line color to blue
context.strokeStyle = "#000000";
// position the drawing cursor
context.moveTo(100, canvas.height - 50);
// draw the line
context.lineTo(canvas.width - 50, 50);
// make the line visible with the stroke color
context.stroke();
}
</script>


</head>
<body>
<canvas id="myCanvas" width="600" height="250" style="border:1px
solid black;">
</canvas>
</body>
</html>

2011년 12월 5일 월요일

ViewBag

controller에서 view로 데이터를 전송하느 방법중 하나는 ViewBag 오브젝트를 이용하는 것이다. 컨트롤러 베이스 클래스의 멤버인 ViewBag을 이용해 전달하는 법



 public ViewResult Index() {
           ViewBag.Message = "Test Message";
            return View();
 }

@{
    Layout = null;
}
<!DOCTYPE html>
<html>
<head>
    <title>Index</title>
</head>
<body>
    <div>
        @ViewBag.Message,Hello, world (from the view)
        @Html.ActionLink("RSVP Now", "RsvpForm")
    </div>
</body>
</html>

2011년 12월 1일 목요일

svn commit

svn은 폴더나 파일을 수정 또는 삭제 생성했을 경우 add를 하지 않으면 svn은 그 파일에 대한 에러 또는 무시하여 commit 을 시도한다.
그러므로 변경이 있을경우 add나 delete를 하는게 좋지만 사람의 특성상 쉽지 않다 그럴경우

svn add -force [folder path]
ex) svn add --forcxe app/* -> app 하위폴더는 다  add 된다.

안된파일만 할경우는
svn status | grep -v "^.[ \t]*\..*" | grep "^?" | awk '{print $2}' | xargs svn add

무시속성을 줄경우
svn --username username propset svn:ignore [folder path]

그리고
svn update 업데이트를 하고
svn -m commit 명령어를 실행한다.

팔로어