在资源文件中动态替换字符串

问题描述 投票:0回答:1

在我的cshtml页面中,我有一个像这样的启动对话框

bootbox.dialog({
                  title: "Addresstitle " + ADDRESS + " save",
                  message: "you will be send to " + fromaddress + "for verification dear" + customer,
                  buttons: {
                   success: {
                                label: "Next,
                                className: "btn btn-success",
                                callback: function(){
                                      //some logic
                                }
                            }
                        }
                    });

我将在资源文件中创建2个资源字符串,一个用于标题,另一个用于消息

Addresstitle {0} save
you will be send to {0} for {1} verification dear {2}

如何动态设置资源文件中的文本?

c# bootbox resource-files
1个回答
0
投票

我不确定您的项目结构,但这是如何解决此问题的高级思路:

© www.soinside.com 2019 - 2024. All rights reserved.