救命!如何动态创建aspx文件 [英] Help! How to create aspx file dynamically

查看:113
本文介绍了救命!如何动态创建aspx文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好。我正在使用visual web developer express edition,我使用

vb.net作为编程语言。


我想创建一个新的aspx文件按钮单击。我将有一个新的aspx文件应遵循的

模板。我需要将当前页面上输入的

值传递给创建的新aspx文件。但是

更重要的是我在创建新的aspx

文件时遇到了问题并保存了它。当我运行

计划时,我需要完成所有这些工作。这可能吗?需要为一个学校项目做这个和我

对此我是新手。


我将不胜感激任何帮助。提前谢谢。

Hi. I am using visual web developer express edition and I am using
vb.net as the programming language.

I want to create a new aspx file on a button click. I will have a
template that the new aspx file should follow. I need to pass the
values entered on the current page to the new aspx file created. But
more importantly I have problems with the creating of the new aspx
file and saving it. I need all this to be done when i am running the
program. Is this possible? Need to do this for a school project and I
am new to this.

I would appreciate any help on this. Thank you in advance.

推荐答案

在没有告诉我们究竟是什么的情况下,你谈到的问题是什么?


另外这是因为这是一个不寻常的要求,你可能想解释一下你想要做什么。


基本上你是试图创建一个应用程序啊自动生成一个网站

网站(可能基于数据库结构或其他东西?)或者你是

试图做一些可能的事情更好地实现另一种方式(ASPX

页面可以从数据库中获取一些参数并在

飞行中考虑到这一点。)


-

Patrice

< fl ******* @hotmail.comaécritdansle message de news:
11 ************** ********@j4g2000prf.googlegroups.c om ...
What is the problem you talked about without telling us what is is exactly ?

Also this as this is an unusual requirement you may want to explain what you
are trying to do.

Basically you are trying to create an application aht auto-generate a web
site (based possibly on a DB structure or something ?) Or else you are
trying to do something that could be better achieved another way (an ASPX
page could take some parameters from a DB and take this into account on the
fly).

--
Patrice
<fl*******@hotmail.coma écrit dans le message de news:
11**********************@j4g2000prf.googlegroups.c om...

嗨。我正在使用visual web developer express edition,我使用

vb.net作为编程语言。


我想创建一个新的aspx文件按钮单击。我将有一个新的aspx文件应遵循的

模板。我需要将当前页面上输入的

值传递给创建的新aspx文件。但是

更重要的是我在创建新的aspx

文件时遇到了问题并保存了它。当我运行

计划时,我需要完成所有这些工作。这可能吗?需要为一个学校项目做这个和我

对此我是新手。


我将不胜感激任何帮助。提前谢谢。
Hi. I am using visual web developer express edition and I am using
vb.net as the programming language.

I want to create a new aspx file on a button click. I will have a
template that the new aspx file should follow. I need to pass the
values entered on the current page to the new aspx file created. But
more importantly I have problems with the creating of the new aspx
file and saving it. I need all this to be done when i am running the
program. Is this possible? Need to do this for a school project and I
am new to this.

I would appreciate any help on this. Thank you in advance.



我正在创建一个电子学习系统,我不想保存

用户在数据库中输入的问题。相反,我想将它们保存为aspx文件。 (这不是我的选择,它是我的

讲师想要的。理由是它更易于管理,而且更有价值。$
$

>
有一个我已创建的页面,我想将其用作新文件的

模板。


在用户输入问题并单击提交按钮后,它将自动复制模板,将其保存为另一个名称并使用新设置替换默认值。
问题。


我有什么方法可以在vb文件中编写函数或

的东西吗?


谢谢。

I am creating an e-learning system in which I don''t want to save the
questions that the user enters in a database. Instead, I want to save
them as an aspx file. (This is not my choice though, its what my
lecturer wants. Reason being that its easier to manage and its more
organized.)

There''s a page that I''ve created and I want to use that as the
template for the new file.

After the user enters the questions and click on the submit button, it
will automatically copies the template, saves it as another name and
replace the default values with the new set of questions.

Is there any way I could code the function inside the vb file or
something?

Thank you.


< fl ******* @ hotmail.comwrote in message

news:11 *********************@i13g2000prf.googlegro ups.com ...
<fl*******@hotmail.comwrote in message
news:11*********************@i13g2000prf.googlegro ups.com...

有没有我可以编写vb文件中的函数或

的东西吗?
Is there any way I could code the function inside the vb file or
something?



你可以做任何你喜欢的时间,资源和服务器

权限...... :-)


但Patrice是对的 - 这是对数据库解决方案的渴望。


然而,当你谈论你的讲师时,我会'我假设这是一些

项目,你正在进行教育,所以我猜你会有

来做你所问的问题如果你想要通过... :-)


也许一个合理的问题是问你的讲师是否绝对

*有*到是一个aspx文件,或者你是否可以将数据保存为另一个

文件格式,例如XML甚至只是纯文本。然后你可以将

相关文件加载到aspx页面中,以便在需要时显示它...


无论如何,说服.NET Framework创建一个文本文件(因为它是所有

一个aspx)是一项微不足道的任务,只要运行ASP.NET的进程有
具有写权限在相关文件夹上:

http://msdn2.microsoft.com/en-us/library/ms404278.aspx

-

Mark Rae

ASP.NET MVP
http://www.markrae.net

You could pretty much do anything you like given time, resources, and server
permissions... :-)

Patrice is right, though - this is crying out for a database solution.

However, when you talk about your "lecturer", I''m assuming this is some
project you''re working on as part of your education, so I guess you''ll have
to do what you''re asked to do if you want to pass... :-)

Maybe a reasonable question would be to ask your lecturer if it absolutely
*has* to be an aspx file, or whether you could save the data into another
file format e.g. XML or even just plain text. Then you could load the
relevant file into an aspx page to display it as and when required...

Anyway, persuading the .NET Framework to create a text file (as that''s all
an aspx is) is a trivial task, so long as the process that ASP.NET is
running under has write permissions on the folder in question:

http://msdn2.microsoft.com/en-us/library/ms404278.aspx
--
Mark Rae
ASP.NET MVP
http://www.markrae.net


这篇关于救命!如何动态创建aspx文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆