Hi,
I have a project written in asp.net which has a few web
pages. The project has been compiled into a dll and now I
am referencing that dll in another project. How can I get
one of the web pages in the dll to be displayed from web
pages in the second project?
Cheers,
RichThis is a rather unorthodox suggestion. It would be better if you have a
model-view-controller, if you want to access code in this manner. If you are
trying to access methods of the page, you are best to move them to other
classes. If you are sincerely trying to display the page, my first attempt
would be to inherit from the page in question in the other application. This
is more likely to be sucessful in the 2.0 Framework, as all elements compile
via partial classes. I am not sure you can easily get the tags across in 1.1
.
Working with the code behind in a compiled application is not a problem,
however.
It sounds like you have some business logic embedded in your ASP.NET
application(s). If so, re-architecture is in order.
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
***************************
Think Outside the Box!
***************************
"Rich" wrote:
> Hi,
> I have a project written in asp.net which has a few web
> pages. The project has been compiled into a dll and now I
> am referencing that dll in another project. How can I get
> one of the web pages in the dll to be displayed from web
> pages in the second project?
> Cheers,
> Rich
>
Hi Gregory,
thanks for the response.
I was just trying to see how easy it would be to redirect
a web app to a web page which is held as a class in a
referenced Dll.
Its easy to interact with other classes in the dll and
methods on the web page I want to render... but even
though I can create an instance of the web page class I
cant seem to find a way of getting it displayed.
A normal Response.redirect() will take a string parameter
of the web page to display.... in that web site. My
thought (which might be incorrect would be that if the
web page is a compiled calss in the dll it would be
possible) - how can I interact with it to render it as
normal?
Cheers,
Rich
>--Original Message--
>This is a rather unorthodox suggestion. It would be
better if you have a
>model-view-controller, if you want to access code in
this manner. If you are
>trying to access methods of the page, you are best to
move them to other
>classes. If you are sincerely trying to display the
page, my first attempt
>would be to inherit from the page in question in the
other application. This
>is more likely to be sucessful in the 2.0 Framework, as
all elements compile
>via partial classes. I am not sure you can easily get
the tags across in 1.1.
>Working with the code behind in a compiled application
is not a problem,
>however.
>It sounds like you have some business logic embedded in
your ASP.NET
>application(s). If so, re-architecture is in order.
>
>--
>Gregory A. Beamer
>MVP; MCP: +I, SE, SD, DBA
>***************************
>Think Outside the Box!
>***************************
>"Rich" wrote:
>
web
now I
get
web
>.
>
re:
> a web page which is held
> as a class in a referenced Dll
> if the web page is a compiled class in the dll...
The .aspx (web) pages are not compiled
into dll's which you can reference.
The only compilation which occurs with .aspx (web) pages
is JIT-compilation, and the resulting assemblies ( dll's )
are placed in your "Temporary ASP.NET Files" directory
under drive:\windowsdirectory\Microsoft.Net\vx.x.xxxx\
and you cannot reference them from an .aspx page.
I you have previously started (visited) the web page you
want to "reference", it will have already been JIT-compiled,
and will be available from memory, unless different data or
parameters are requested, in which case the page will be
JIT-recompiled again.
In ASP.NET 2.0 there's a nifty new feature which allows full
pre-compilation of all of an Application's files, eliminating that
way the delay in response due to on-the-fly compilation.
In ASP.NET 1.1, I experimented with a batch file which
called all the basic pagesin a website, so that the pages
would be jit-complied, and users didn't have to wait for
the initial compilation.
It worked quite well, and might do the job for you.
Juan T. Llibre
ASP.NET MVP
===========
<anonymous@.discussions.microsoft.com> wrote in message
news:14a601c5022d$895637c0$a501280a@.phx.gbl...
> Hi Gregory,
> thanks for the response.
> I was just trying to see how easy it would be to redirect
> a web app to a web page which is held as a class in a
> referenced Dll.
> Its easy to interact with other classes in the dll and
> methods on the web page I want to render... but even
> though I can create an instance of the web page class I
> cant seem to find a way of getting it displayed.
> A normal Response.redirect() will take a string parameter
> of the web page to display.... in that web site. My
> thought (which might be incorrect would be that if the
> web page is a compiled calss in the dll it would be
> possible) - how can I interact with it to render it as
> normal?
> Cheers,
> Rich
>
> better if you have a
> this manner. If you are
> move them to other
> page, my first attempt
> other application. This
> all elements compile
> the tags across in 1.1.
> is not a problem,
> your ASP.NET
> web
> now I
> get
> web
OK......interesting.
Currently using ASP.Net 1.1 - so it'll have to be
the 'batch file' technique you mentioned -
how did you implement that?
I would only need to call the one web page I was hoping
to get displayed.
Cheers,
Richard
>--Original Message--
>re:
>The .aspx (web) pages are not compiled
>into dll's which you can reference.
>The only compilation which occurs with .aspx (web) pages
>is JIT-compilation, and the resulting assemblies (
dll's )
>are placed in your "Temporary ASP.NET Files" directory
>under drive:\windowsdirectory\Microsoft.Net\vx.x.xxxx\
>and you cannot reference them from an .aspx page.
>I you have previously started (visited) the web page you
>want to "reference", it will have already been JIT-
compiled,
>and will be available from memory, unless different data
or
>parameters are requested, in which case the page will be
>JIT-recompiled again.
>In ASP.NET 2.0 there's a nifty new feature which allows
full
>pre-compilation of all of an Application's files,
eliminating that
>way the delay in response due to on-the-fly compilation.
>In ASP.NET 1.1, I experimented with a batch file which
>called all the basic pagesin a website, so that the pages
>would be jit-complied, and users didn't have to wait for
>the initial compilation.
>It worked quite well, and might do the job for you.
>
>Juan T. Llibre
>ASP.NET MVP
>===========
><anonymous@.discussions.microsoft.com> wrote in message
>news:14a601c5022d$895637c0$a501280a@.phx.gbl...
redirect
parameter
>
>.
>
It's as easy as :
startup.bat :
--
start Iexplore "http://yourserver.com/directory/your.aspx"
----
Place more lines like the first one for additional pages.
That works fine if there's not too many pages to open.
An IE window will be opened for each page.
Juan T. Llibre
ASP.NET MVP
===========
<anonymous@.discussions.microsoft.com> wrote in message
news:20eb01c50235$afba1fa0$a401280a@.phx.gbl...
> OK......interesting.
> Currently using ASP.Net 1.1 - so it'll have to be
> the 'batch file' technique you mentioned -
> how did you implement that?
> I would only need to call the one web page I was hoping
> to get displayed.
> Cheers,
> Richard
>
> dll's )
> compiled,
> or
> full
> eliminating that
> redirect
> parameter
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment