By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
460,028 Members | 1,258 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 460,028 IT Pros & Developers. It's quick & easy.

Page Processing

P: n/a

I have a problem at the moment where an external program writes aspx files
to a server and then allows people to brows to those pages. Each aspx page
is similiar and is written in a single file - the file contains both <%= %>
attributes and <SCRIPT runat=server> code. Each file has a unique name.

After a short time this gets out-off control and the memory of the server
goes through the roof - the performance is also not too good becuase of the
compiling of each page.

If I was to create a code-behind file would this fix my speed and memory
problems? - e.g - The external program only writes unique markup pages and
has an @ directive to referance the same class. The class gets compiled once
- what happens to the markup - does it go and still create another class
based on the code-behind class. Also - if I was to it this this way could I
still use the <%= %> tags to referance the results of functions in the
code-behind class?? Doing it this way would I still end up with the same
problems???

Thanks for your help

--
matthew
Nov 19 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
=?Utf-8?B?bWF0dmRs?= <ma****@discussions.microsoft.com> wrote in
news:F9**********************************@microsof t.com:
I have a problem at the moment where an external program writes aspx
files to a server and then allows people to brows to those pages.
Each aspx page is similiar and is written in a single file - the file
contains both <%= %> attributes and <SCRIPT runat=server> code. Each
file has a unique name.


If you want to write dynamic code... you should take a look at using
CodeDom (just do a google search on dynamic .NET code).

Otherwise, what you're doing will be slow, since .NET has to compile the
code on each run.

Is there a way you can do this without writing dynamic code? It seems very
inefficent... : )

--
Lucas Tam (RE********@rogers.com)
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/
Nov 19 '05 #2

P: n/a
Hello Matthew

I don't know if my solution will help you or not, but instead of creating
many individual aspx files on the server, I would consider using either an
HttpModule or HttpHandler to access these pages. In this way, these actual
pages do not exist.

I would have a "template" page(s) which render themselves like the
individual aspx pages do, except that it pulls data dynamically from
somewhere. This basically replaces the external program that creates aspx
pages.

The httpModule evaluates the URL to determine how to build the page, and
calls server.transfer to the template page.
For example, say the user goes to:
http://mydomain.com/productlisting/product1.aspx
The HttpModule could convert that to
http://mydomain.com/productdisplay.a...oduct=product1

The user will never see the second URL in their browser.

Above, productdisplay.aspx is the template page, and given enough variables
is able to create the same output that the individual .aspx pages had.

In this way, you are not creating hundreds/thousands of files on your
webserver, and everything is still compiled.

HTH

Steve

"matvdl" <ma****@discussions.microsoft.com> wrote in message
news:F9**********************************@microsof t.com...

I have a problem at the moment where an external program writes aspx files
to a server and then allows people to brows to those pages. Each aspx
page
is similiar and is written in a single file - the file contains both <%=
%>
attributes and <SCRIPT runat=server> code. Each file has a unique name.

After a short time this gets out-off control and the memory of the server
goes through the roof - the performance is also not too good becuase of
the
compiling of each page.

If I was to create a code-behind file would this fix my speed and memory
problems? - e.g - The external program only writes unique markup pages and
has an @ directive to referance the same class. The class gets compiled
once
- what happens to the markup - does it go and still create another class
based on the code-behind class. Also - if I was to it this this way could
I
still use the <%= %> tags to referance the results of functions in the
code-behind class?? Doing it this way would I still end up with the same
problems???

Thanks for your help

--
matthew

Nov 19 '05 #3

P: n/a
every aspx page needs to be compiled. a precompiled codebehind file will
save some time (less code).

-- bruce (sqlwork.com)

"matvdl" <ma****@discussions.microsoft.com> wrote in message
news:F9**********************************@microsof t.com...

I have a problem at the moment where an external program writes aspx files
to a server and then allows people to brows to those pages. Each aspx
page
is similiar and is written in a single file - the file contains both <%=
%>
attributes and <SCRIPT runat=server> code. Each file has a unique name.

After a short time this gets out-off control and the memory of the server
goes through the roof - the performance is also not too good becuase of
the
compiling of each page.

If I was to create a code-behind file would this fix my speed and memory
problems? - e.g - The external program only writes unique markup pages and
has an @ directive to referance the same class. The class gets compiled
once
- what happens to the markup - does it go and still create another class
based on the code-behind class. Also - if I was to it this this way could
I
still use the <%= %> tags to referance the results of functions in the
code-behind class?? Doing it this way would I still end up with the same
problems???

Thanks for your help

--
matthew

Nov 19 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.