gpt4 book ai didi

c# - 如何在 asp.net (C#) 中创建动态页面?

转载 作者:太空狗 更新时间:2023-10-30 01:09:41 26 4
gpt4 key购买 nike

我在我的网站应用程序中添加了一个页面“First.aspx”。在 First.aspx 页面中,我有一个名为 btnbutton 的按钮。 “btnbutton”的“onclick”事件应该打开一个新的动态页面。 我怎样才能做到这一点。? 请记住,创建的新动态页面不存在于应用程序中。这个页面应该在运行时创建并且也是动态的。 请帮帮我!

最佳答案

如果您询问在运行时 生成ASP.NET 页面,那是不可能的。原因如下:

You need to compile the code of the ASP.NET page before run it. And that is impossible after your web application has started.

但是,如果您询问页面之间的导航,则可以使用 Response.Redirect:

Response.Redirect("http://www.stackoverflow.com/");

关于c# - 如何在 asp.net (C#) 中创建动态页面?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6198463/

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