반응형
Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- v-select
- error
- c#
- f035d
- sequelize
- CSS
- 프로세스 방지
- xlsx
- v-text-field height
- nodejs
- 동일 프로세스
- Vuetify
- sort
- onsenui
- Electron
- electron-nuxt
- NUXT
- Android
- bucket max-key
- naver storage
- kotlin
- naver storage bucket error
- JavaScript
- vuejs
- Vue
- onsen-ui
- 동일 프로그램
- MySQL
- vuetifyjs
- bucket cors
Archives
- Today
- Total
앙큼한 개발기록
C# .net에서 html.beginform 사용시 클래스 추가 방법 [Razor] 본문
C# .net에서 html.beginform 사용시 클래스 추가 방법
.net beginfrom returnurl class
기본형
1 2 3 4 5 | @using(Html.BeginForm()) { 각종 입력 태그 } |
아무것도 입력하지 않는 경우 해당 뷰 값을 가지고 있는 컨트롤러에 index로 향한다.
return url 값을 가지고 있으면 해당 prameter를 설정한 index 메소드로 향한다.
return url = 이전에 내가 갔었던 프로젝트 내의 페이지
beginfrom 에 액션과 컨트롤러만 설정도 가능하다.
1 2 3 4 5 | @using(Html.BeginForm("Index", "Controller")) { 각종 입력 태그 } | cs |
그리고 전부다 설정도 가능하다.
1 2 3 4 5 6 7 8 9 | @using(Html.BeginForm( "Action", // 액션 명 "Controller", // 컨트롤러 명 new { id = "route", charset = "utf8" }, // 루트경로 FormMethod.Post, // HTTP 메소드 (get, post) new { id="idName", enctype="multipart/form-data" @class = "className" } // 속성들(아이디 클래스 ) )) { 각종 입력 태그 } | cs |
ViewBag 에 루트를 넣었을 경우
1 2 3 4 5 6 7 8 9 10 11 | @using(Html.BeginForm( "Action", // 액션 명 "Controller", // 컨트롤러 명 new { returnUrl = ViewBag.returnUrl }, FormMethod.Post, // HTTP 메소드 (get, post) new { id="idName", enctype="multipart/form-data" @class = "className" } // 속성들(아이디 클래스 ) )) { 각종 입력 태그 } | cs |
그런데 마이크* 개** 들이 클래스만 설정하는건 안해 놓아서 클래스만은 설정이 불가능 하다.
returnUrl 값을 미 설정해 놓으면 알아서 그 값을 가지고 있어서 그냥 넘기면 해당 매소드로 가지는데 클래스를 넣지 못하는 경우에는
jquery or javascript로 form에 클래스를 직접 설정해 줘야 한다.
1 2 3 4 | $(document).ready(function () { $("form").addClass("className"); }); | cs |
끝.
Comments