Kentico: I want redirect link url rewrite asp.net kentico

Khanh Kevin asked on March 30, 2018 09:46

Dear All, I hope people help me, I'm programming website with link url http://demo.com/register.aspx?TenKH=502&KH=The%207%20Habits%20of%20Highly%20Effective%20People

I want redirect link url rewrite asp.net kentico http://demo.com/register.aspx?TenKH=502&KH=the-7-habits-of-highly-effective-people

Main code Kentico Aspnet: <a href="/register.aspx?TenKH=<%#Eval("ChuongTrinh").ToString()%>&KH=<%#Eval("TenKH").ToString()%>"><%#CMSUtils.GetResString("DKTD")%>

Recent Answers


Peter Mogilnitski answered on March 30, 2018 13:46

0 votesVote for this answer Mark as a Correct answer

Eric Dugre answered on March 30, 2018 20:47

Khanh,

If I understand correctly, you want to replace the "%20" in your URL with "-" correct? Within a transformation, you could use the String.Replace() method:

<%#Eval<string>("TenKH").Replace("%20","-")%>
0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.