2014-02-17 73 views
2

我想通過代碼在標籤後面顯示消息。我的代碼如下所示。在asp.net中添加標籤之間的超鏈接

lblmsg.Text = "Success: You have added " + pujaname + " <a href="ShoppingCart.aspx"> to your shopping cart </a> "; 

這裏「pujanme」是從一個正確即將數據庫中提取,其次我要inlcude「購物車」的文字是超鏈接到其他網頁,但我歌廳error.I會很高興,如果有人引導我。 三江源

回答

1

你可以試試這個。它爲我工作。

lblmsg.Text = "Success: You have added " + pujaname +" <a href=\"ShoppingCart.aspx\"> to your shopping cart </a> "; 
+0

@ Illaya.Thanyou我解決了我的問題,如你所說。 – user3247426

+0

@ user3247426很酷 – Illaya

1

你逃避你的鏈接雙引號(通過添加在他們面前一個反斜槓):

lblmsg.Text = "Success: You have added " + pujaname + 
      + " <a href=\"ShoppingCart.aspx\"> to your shopping cart </a> "; 
1

我們必須用\先於網址內"

lblmsg.Text = "Success: You have added " + pujaname + " <a href=\"ShoppingCart.aspx\"> to your shopping cart </a> ";