logo
Welcome to our new AbleCommerce forums. As a guest, you may view the information here. To post to this forum, you must have a registered account with us, either as a new user evaluating AbleCommerce or an existing user of the application. For all questions related to the older version of Gold and earlier, please go to AbleCommerce Gold forum. Please use your AbleCommerce username and password to Login. New Registrations are disabled.

Notification

Icon
Error

Options
Go to last post Go to first unread
ray22901031  
#1 Posted : Saturday, June 26, 2021 7:48:08 AM(UTC)
ray22901031

Rank: Advanced Member

Groups: Authorized User, Developers
Joined: 2/17/2019(UTC)
Posts: 827

Thanks: 3 times
Was thanked: 13 time(s) in 13 post(s)
Trying to get my feet wet with some basic razor code in a veiw, please see the code segment below which is working.

@if (Model.OrderLocked)
{
var sOrderText = " - This order is LOCKED!";
ViewBag.Title = "View Order";
ViewBag.PageCaption = "View Order #" + Model.OrderNumber + sOrderText;
}
else
{
ViewBag.Title = "View Order";
ViewBag.PageCaption = "View Order #" + Model.OrderNumber ;
}

I would like to format the var sOrderText to display in bold. Having lots of problems. Probably has something to do with @Html.Raw, but I missing something. Pulling out my hair all night.

Thanks

Wanna join the discussion?! Login to your AbleCommerce Forums forum account. New Registrations are disabled.

ray22901031  
#2 Posted : Sunday, June 27, 2021 3:42:31 PM(UTC)
ray22901031

Rank: Advanced Member

Groups: Authorized User, Developers
Joined: 2/17/2019(UTC)
Posts: 827

Thanks: 3 times
Was thanked: 13 time(s) in 13 post(s)
Got it!

ViewBag.PageCaption = Html.Raw("View Order #" + Model.OrderNumber + "<b>" + sOrderText + "</b>") ;

Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.