473,327 Members | 2,055 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

Help! How to create aspx file dynamically

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.

Jul 2 '07 #1
16 5821
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...
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.

Jul 2 '07 #2
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.

Jul 2 '07 #3
<fl*******@hotmail.comwrote in message
news:11*********************@i13g2000prf.googlegro ups.com...
Is there any way I could code the function inside the vb file or
something?
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

Jul 2 '07 #4
IMHO this is an academic, non real world design (I'm not sure how this is
"easier to manage" and "more organized" than saving questions in a database
when you can easily edit them etc...).

You still don't tell what us what you means by "I have problems with the
creating of the new aspx file and saving it". ASPX files are just text files
thought the web application will have to compile them (for example it could
be an encoding issue).

Also I assume you are talking about creating question pages. How do you plan
to store corresponding responses ? It could be usefull to know before
desining the whole solution (in a DB you could easily link each response
with the corresponding question and creates whatever reports you want, with
"dead text" burried in ASPX text files I'm not sure how you want to handle
those responses).

---
Patrice

<fl*******@hotmail.coma écrit dans le message de news:
11*********************@i13g2000prf.googlegroups.c om...
>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.

Jul 2 '07 #5
Yes. I know a database solution would be best. I tried reasoning him
over that matter for weeks and weeks. =X

I will take the idea you suggested into consideration. But if I save
it as text file and when I call it when I display it on aspx, will I
still be able to run checks on them?

Because its supposed to be quiz. The lecturer enters the questions and
then save them. When a student logs in and do the quiz, I still need
to handle the right or wrong answers and then calculate the scores.

More suggestions will be deeply appreciated. Thank you for replying.

Jul 2 '07 #6
<fl*******@hotmail.comwrote in message
news:11**********************@j4g2000prf.googlegro ups.com...
Yes. I know a database solution would be best. I tried reasoning him
over that matter for weeks and weeks. =X
Then I would seriously question his competence to teach this subject, as he
clearly knows very little about it... I suggest you show him this newsgroup
thread...

He is also deliberately forcing you to use totally the wrong solution - and
a solution which you already know to be wrong, and which you would never use
in the "real world"...

Therefore, if I were you, I'd have to seriously question what on earth I was
even taking this person's class, as I would doubt very much whether you will
learn anything useful...
I will take the idea you suggested into consideration. But if I save
it as text file and when I call it when I display it on aspx, will I
still be able to run checks on them?
If you save the data as an XML file, you can certainly treat it just like a
database. Again, it's not really the correct use of XML, but it would
certainly be much better than saving your data in an aspx page - this really
is *TOTALLY* the wrong thing to do...
Because its supposed to be quiz. The lecturer enters the questions and
then save them. When a student logs in and do the quiz, I still need
to handle the right or wrong answers and then calculate the scores.
I think that while your lecturer is incapable of understanding how stupid
what he is asking you to do is, you're pretty much wasting your time...

Does he even understand what a database is...?
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Jul 2 '07 #7
Actually, he doesn't have much knowledge on IT. He is not teaching me
anything related to IT. Thats why I am here to do this project. I
think I've got no other choice but to reason with him over this again.
Hehe. Thank you for all your help. I appreciate it. =)

Jul 2 '07 #8
<fl*******@hotmail.comwrote in message
news:11**********************@g37g2000prf.googlegr oups.com...
Actually, he doesn't have much knowledge on IT. He is not teaching me
anything related to IT. Thats why I am here to do this project. I
think I've got no other choice but to reason with him over this again.
Hehe. Thank you for all your help. I appreciate it. =)
Well, another possible angle might be to use an XML file, but call it
something like questions.aspx - the file extension doesn't actually
matter... ;-)
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Jul 2 '07 #9
I'm having the same problem i think. Have created some html pages dynamically
and on one page i would like a contact form; name, address, email etc.

This need to be done as an aspx page. Ive created the aspx page then saved
the dynamic website. On viewing, i see only the headings but no boxes or send
button.

I havent seen any as.net code for this, only part asp.net v2.0 code which
the site isp doesnt support.

Any ideas, thanks
Jul 2 '07 #10
"stevep" <st****@discussions.microsoft.comwrote in message
news:C9**********************************@microsof t.com...
I'm having the same problem i think. Have created some html pages
dynamically
and on one page i would like a contact form; name, address, email etc.

This need to be done as an aspx page. Ive created the aspx page then saved
the dynamic website. On viewing, i see only the headings but no boxes or
send
button.

I havent seen any as.net code for this, only part asp.net v2.0 code which
the site isp doesnt support.

Any ideas, thanks
Firstly, what are you actually doing?

Why have you created HTML pages dynamically? What is the purpose of this?

What do you mean by "saved the dynamic website"?

I'm really struggling to think of any scenario where it would be necessary
to create additional aspx pages dynamically...
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Jul 2 '07 #11
Im new to web design as you probably can tell. Ive started using expression
web and this is the way you seem to do it, probably completely wrong mind.

I thought that creating dynamic pages was that you have one main page and
each time you make changes it saves these changes to all the pages in your
site. For example i converted all the htm pages to asp as suggested on
another thread. I had to save each one individually. Would i have to apply
changes i did on one page to each page manually if i were to use asp?

it seems to me that forms can only be done in asp in which case i would need
all my pages as .asp & the form page as .aspx so the form standard is the
same throughout.

Jul 2 '07 #12
yup pc crashed, didnt think it came out first time...

Logged into the web hosting account and my account is only enabled for ASP
not ASP.NET or ASP.NET 2.0

Not knowing the difference between ASP & ASP.NET im guessing its having an
effect
Jul 2 '07 #13
"stevep" <st****@discussions.microsoft.comwrote in message
news:43**********************************@microsof t.com...
yup pc crashed, didnt think it came out first time...
Fair enough...
Logged into the web hosting account and my account is only enabled for ASP
not ASP.NET or ASP.NET 2.0
Ah...
Not knowing the difference between ASP & ASP.NET im guessing its having an
effect
It certainly is! Following on from my previous reply, you're unfortunately
*still* in the wrong newsgroup - the ASP one is:
microsoft.public.internetserver.asp.general

However, as you're using Expression, the Expression newsgroup is probably
your best starting point...
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Jul 2 '07 #14
A dynamic page is a page that "runs" server side to produce a resulting HTML
code. As the page runs server side it can do whatever you want such as
taking the current/datetime or using data from a DB to create the resulting
HTML code.

I'm not sure what you are talking about but it would be more likely a master
page or CSS stylesheet (basically a master page define the general layout
for a whole site while a CSS stylesheet defines still more details such as
colors etc...) but you can likely left this out of the picture for now...

IMO your beast bet is first to learn about ASP.NET for example at :
http://quickstarts.asp.net/QuickStartv20/aspnet/. Then come back to post
questions on specific points on which you have a problem.

Of course, the very first step would be to make sure what your hoster
supports. If your web site is hosted on a server that doesn't support
ASP.NET, it will be useless (you'll have to choose from dynamic page
technologies that are available on the server on which your web site is
hosted)...

"stevep" <st****@discussions.microsoft.coma écrit dans le message de news:
6F**********************************@microsoft.com...
Im new to web design as you probably can tell. Ive started using
expression
web and this is the way you seem to do it, probably completely wrong mind.

I thought that creating dynamic pages was that you have one main page and
each time you make changes it saves these changes to all the pages in your
site. For example i converted all the htm pages to asp as suggested on
another thread. I had to save each one individually. Would i have to apply
changes i did on one page to each page manually if i were to use asp?

it seems to me that forms can only be done in asp in which case i would
need
all my pages as .asp & the form page as .aspx so the form standard is the
same throughout.

Jul 2 '07 #15
While you can certainly use an "aspx template" and fill it in with data and
then save the file with a specificname.aspx, there is an inherent problem
with this approach that your "lecturer" needs to learn: when you save a file
into an ASP.NET application, because of folder and file monitoring, your
application is going to restart. All session and other data will be trashed.
A Database would be far preferable and more extensible.
-- Peter
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
BlogMetaFinder(BETA): http://www.blogmetafinder.com

"fl*******@hotmail.com" wrote:
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.

Jul 2 '07 #16
Alright. Thank you. I will let him know about this too. Hopefully, he
will stick to using database.

On Jul 2, 11:52 pm, Peter Bromberg [C# MVP]
<pbromb...@yahoo.yabbadabbadoo.comwrote:
While you can certainly use an "aspx template" and fill it in with data and
then save the file with a specificname.aspx, there is an inherent problem
with this approach that your "lecturer" needs to learn: when you save a file
into an ASP.NET application, because of folder and file monitoring, your
application is going to restart. All session and other data will be trashed.
A Database would be far preferable and more extensible.
-- Peter
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
BlogMetaFinder(BETA): http://www.blogmetafinder.com

"flip2f...@hotmail.com" wrote:
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.- Hide quoted text -

- Show quoted text -

Jul 3 '07 #17

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: python-help-bounces | last post by:
Your message for python-help@python.org, the Python programming language assistance line, has been received and is being delivered. This automated response is sent to those of you new to...
4
by: Sarir Khamsi | last post by:
Is there a way to get help the way you get it from the Python interpreter (eg, 'help(dir)' gives help on the 'dir' command) in the module cmd.Cmd? I know how to add commands and help text to...
6
by: d.warnermurray | last post by:
I am doing a project for school that involves creating help files for a html authoring tool. If you could help me with answers to some questions it would really help. 1. What tasks do you expect...
5
by: Craig Keightley | last post by:
Please help, i have attached my page which worksin IE but i cannnot get the drop down menu to fucntion in firefox. Any one have any ideas why? Many Thanks Craig ...
27
by: Bruce Dodds | last post by:
I recently started using Access 2003 for the first time. I wanted to pass on some comments about the Help system to Access MVPs who frequent this board. I'm doing this in the hope that some of...
3
by: stuart_white_ | last post by:
I've just upgraded from Python 2.3.3 to Python 2.4.2, and, although the new version of Python seems to be running correctly, I can't seem access the help from the interpreter. On Python 2.3.3...
9
by: JJ | last post by:
Do you all use HTML help workshop to create your help system. I am finding it quite clumsy to use. Mayeb because I am not used to using it. Do any of you use any other techniques to create help...
8
by: Mark | last post by:
I have loaded Visual Studio .net on my home computer and my laptop, but my home computer has an abbreviated help screen not 2% of the help on my laptop. All the settings look the same on both...
10
by: JonathanOrlev | last post by:
Hello everybody, I wrote this comment in another message of mine, but decided to post it again as a standalone message. I think that Microsoft's Office 2003 help system is horrible, probably...
1
by: trunxnirvana007 | last post by:
'UPGRADE_WARNING: Array has a new behavior. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="9B7D5ADD-D8FE-4819-A36C-6DEDAF088CC7"' 'UPGRADE_WARNING: Couldn't resolve...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.