【发布时间】:2022-01-23 12:20:26
【问题描述】:
我正在开发 ASP.NET AJAX Web 应用程序。
作为要求的一部分,我需要向最终用户显示带有上传文件位置的消息。一切都很好,但警告消息永远不会在路径中显示“/”符号。
对于路径:\\shrestasoft\intranet\CorrectionReports\ReportsWithAccount\CorrectionReportWithAccount-Dec-22-2021-12-31-36-PM.xlsx
以下是我的警报对话框的显示方式:
\shrestasoftintranetCorrectionReportsReportsWithAccountCorrectionReportWithAccount-Dec-22-2021-12-31-36-PM.xlsx
我写了以下代码:
public static void ShowAlertWithFileLocation(object sender, string message)
{
message = "alert('" + message + "');";
ScriptManager.RegisterClientScriptBlock((sender as Control), typeof(ScriptManager), "alert", message, true);
}
我尝试使用HtmlUtility.HtmlEncode() 方法,但这对我不起作用。有人可以建议我如何使用路径获取适当的文件名吗?
【问题讨论】:
标签: javascript asp.net asp.net-ajax