0

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

@{ 
    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>

输出如下:

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

4

2 回答 2

1

尝试\n

Title = "Thank you for registering!\nOur representatives will  review your request and email you with access to our product section shortly."
于 2013-01-31T14:54:16.407 回答
1

尝试

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

并在行之间包含 \n 字符

以下将用新行替换“break”字符。也许尝试一下。

@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." 
        }
    );
}
于 2013-01-31T14:58:15.183 回答