jangbeegun avatar

장비군의 asp.net 적응기

xpjis20

Published: 19 Apr 2019 › Updated: 19 Apr 2019장비군의 asp.net 적응기

장비군의 asp.net 적응기

안녕하십니까 장비군입니다. xpjis20@xpjis20

간만에 또 코딩하다가 얻은 깨다~~~름을 적고 갑니다.
asp.net jquery 코드입니다.

첫번째 깨다~~~름.
간략한 내용은 html을 만들어서 특정 html 블록을 찾아서 그 안에 html을 쑤셔 넣는 겁니다.


  1. var TagName = $("#AddProduct_Tag").val();
    AddProduct_Tag Tag의 value값을 가져와서!

  2. var htmlTag = "<div id="" + TagName + "" name="Product_TagName"><span class="prdt_tag">" + TagName + "<span onclick="ProductTagDelete('" + TagName + "');" class="btn btn_close">×";
    $('#<%= Product_Tag.ClientID %>').find('legend').html(TagDataHtml);
    이러이러한 Html 코드를 만들어낸 다음!

  3. $('#<%= Product_Tag.ClientID %>').find('legend').html(TagDataHtml);
    이렇게 원하는 곳에 찾아서 투입시킵니다!
    왠지 append는 크롬에서만 되는군요..... 췟....


두번째 깨다~~~름.

json으로 파싱할때 즉 JSON.parse(xxxx) 할때...
string strJson = "{ "IsSuccess" : ""+ true+ "" , "filepath" : "" + "\\" + fileSavePath +"" }";
요런 형태로 넘길때....(왜 MVC 라이브러리를 안쓰는 것인가.)


fileSavePath += FileName;
fileSavePath = fileSavePath.Replace("\","\\"); <--이렇게 해줘야 함.
string fileSavePath = "FileUpload\ProductThumnailImg\";


저것을 안하면 JSON.parse가 에러가 남... 최종적인 형식은

페이지 jquery 쪽에서 데이터를 디버깅 했을때 JSON 형식이
"{ "IsSuccess" : "True" , "filepath" : "\\FileUpload\\ProductThumnailImg\\190419_04145014_20190206_164512.jpg" }"


요런 식으로 나와야 parsing이 됩니다.
까다로운 자식..... 알아서 parsing해주지......
쓰읍~ 거 물흐르듯이~ 좀....

그럼 이만..... 또 일하러....
ㅂㅂ2

Leave 장비군의 asp.net 적응기 to:

Written by

깊게는 못파서 넓게 팠습니다

Read more #asp posts


Best Posts From jangbeegun

We have not curated any of xpjis20's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.

More Posts From jangbeegun