gpt4 book ai didi

c# - 在 ashx 上的 c# web 应用程序中是否有任何 vb msgbox 替代方案?

转载 作者:太空宇宙 更新时间:2023-11-03 13:33:18 26 4
gpt4 key购买 nike

当我开始使用 c# 时,我发现 c#(网络应用程序)不支持 msgbox 或类似的东西。在 vb web 应用程序中我可以使用 msgbox,它在部署时不起作用,但可以帮助我进行调试。

当我在网上搜索时,有一些解决方案,例如:

string message = "Hello! Mudassar.";
System.Text.StringBuilder sb = new System.Text.StringBuilder();
sb.Append("<script type = 'text/javascript'>");
sb.Append("window.onload=function(){");
sb.Append("alert('");
sb.Append(message);
sb.Append("')};");
sb.Append("</script>");
ClientScript.RegisterClientScriptBlock(this.GetType(), "alert", sb.ToString());

但它在 ashx 处理程序中不起作用。
c# 中是否有任何 vb msgbox 替代方案:

1- 至少在部署之前工作。
2- 也在 ashx 处理程序中工作。

最佳答案

如果您想进行调试,可以使用 ASP .Net 中提供的跟踪和调试功能,请阅读以下文章了解详细信息 http://msdn.microsoft.com/en-us/library/bb386420.ASPX

关于c# - 在 ashx 上的 c# web 应用程序中是否有任何 vb msgbox 替代方案?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19673493/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com