Rupesh N

Rupesh N

  • NA
  • 380
  • 45.7k

how to insert tags into json format in sql server using webapi

Mar 1 2021 5:14 AM
Hi,
 
I am developing a small web application.
but, i struck in two place in our application. 
 1. insert JSON format.
 2. insert title with replace space to "-" 
 
 1. problem:
actually, I write a form. and one tags textbox there. enter below format. 
ex. tags : r, u,p,e,s,h 
 
it's converted into JSON string by using angular. 
ex: ["r","u","p","e","s","h"] 
 
But, it is not inserted in json formate. only inserted into normal format(r,u,p,e,s,h).
 
2. problem: 
  actually, i have two textboxs. both are title based. but, first text box is user enter the title. and second textbox will convert automatically replace space to hyphen (-). basically, i want convert in webapi controller file. but, not converted.
i am using this syntax: 
post.postTitle.Split(new string[] { "-", " " }, StringSplitOptions.RemoveEmptyEntries). 
 
but, not converted. 
 

Answers (3)