在标题字符串中引入空格和换行符


如何

修改以下代码以将标题字符串值分成两行?中心对齐似乎也不起作用。我错过了什么吗?

@{ 
    Html.RenderAction(
        "GenericPopupPartial", 
        "Shared", 
        new { 
            containerName = "registerSuccess",  
            BodyHtml = Model.MessageSent, 
            Title = "Thank you for registering!       Our representatives will  review your request and email you with access to our product section shortly." 
            }
        );
}
<a class="fbox1" id="registerSuccess-link" href="#registerSuccess" style="display: none; text-align:center;"></a>

输出如下:

感谢您的注册!我们的代表将审核您的请求 并尽快通过电子邮件向您发送访问我们产品部分的权限。

尝试

  @Html.Raw(Html.Encode(Model.MultiLineText)  

并在行之间包含 字符

以下内容将用新行替换"中断"字符。也许试试。

@Html.Raw(Html.Encode(Model.MultiLineText).Replace("n", "<br />")){"GenericPopupPartial", 
    "Shared", 
    new { 
        containerName = "registerSuccess",  
        BodyHtml = Model.MessageSent, 
        Title = "Thank you for registering! <br /> Our representatives will  review your request and email you with access to our product section shortly." 
        }
    );
}

尝试n

Title = "Thank you for registering!nOur representatives will  review your request and email you with access to our product section shortly."

相关内容

  • 没有找到相关文章

最新更新