| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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
- html
- C# 프로그래밍
- 엔트리
- cc챔피언
- data-attributes
- 프론트엔드
- c# 학습
- 중학생코딩
- 코딩입문
- Linq
- MSSQL
- 중1코딩
- ASP.NET MVC
- c#
- Excel
- 블록코딩
- MS-SQL
- httpclient timeout
- swift 화면전환
- jquery
- upbit
- Android
- league of legends
- largelanguagemodels
- MYSQL
- 일본여행
- python
- 한글깨짐
- 아이코딩습관
- JavaScript
Archives
- Today
- Total
목록data-attributes (2)
DBA
ASP.NET MVC에서 드롭다운리스트 사용법
Dropdownlist1) 현재 선택된 value / text 즉시 읽기const $ddl = $('.householdRelation'); // DropDownListFor에 준 클래스const val = $ddl.val(); // 선택된 valueconst text = $ddl.find('option:selected').text(); // 선택된 표시 텍스트console.log(val, text); 2) 변경될 때마다 가져오기$('.householdRelation').on('change', function () { const val = $(this).val(); const text = $(this).find('option:selected').text..
[3] Development/MVC(ASP.NET with C#)
2025. 10. 21. 15:53
Razor에서 data-* 넣고 꺼내기
1) Razor에서 data-* 넣기Html.DropDownListFor의 htmlAttributes 익명객체에서 언더스코어(_) → 하이픈(-) 으로 변환됩니다.@Html.DropDownListFor( x => x.가구주와의관계코드01, new SelectList(ViewBag.가구주와의관계, "Value", "Text"), new { @class = "householdRelation", data_name = "householdRelation", // => data-name="householdRelation" data_qid = Model.질문ID // => data-qid="..." }) 또는 딕셔너리로도 가능 합니다...
[3] Development/MVC(ASP.NET with C#)
2025. 10. 21. 15:30