장비군의 asp.net 적응기

in #asp5 years ago

안녕하십니까 장비군입니다. @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

Sort:  

Congratulations @xpjis20! You received a personal award!

Happy Birthday! - You are on the Steem blockchain for 3 years!

You can view your badges on your Steem Board and compare to others on the Steem Ranking

Vote for @Steemitboard as a witness to get one more award and increased upvotes!

Congratulations @xpjis20! You received a personal award!

Thank you for the witness votes you made to support your Steem community and for keeping the Steem blockchain decentralized

You can view your badges on your Steem Board and compare to others on the Steem Ranking

Do not miss the last post from @steemitboard:

Use your witness votes and get the Community Badge
Vote for @Steemitboard as a witness to get one more award and increased upvotes!

Coin Marketplace

STEEM 0.19
TRX 0.15
JST 0.029
BTC 63239.86
ETH 2621.03
USDT 1.00
SBD 2.77