Hiyo
I want to perform a programmatic server-side include, and I think that the
best way would be to use Server.Execute(path, optional textwriter).
Certainly ommitting the textwriter means that I can write to the output of
my page.
...however...
The content I wanted to append to the page is aspx code stored in a database
(surely this isn't the best way - suggestions welcome please!), and so I
figure it would be faster to write the code from the database into the aspx
output like this:
<html><body>test starts<br
string dbaspx = Database.ReadSomeField();
// dbaspx == "<aspx:-- some aspx code --/>"
Server.Execute(dbaspx);
<br>test stops</body></html
Kinda an odd scenario; your thoughts welcome :) Thanks in advance,
BenBen hi,
if you keep the data in DB its probebly static so maybe its betteer to
store the data in application cache.
Natty Gur, CTO
Dao2Com Ltd.
34th Elkalay st. Raanana
Israel , 43000
Phone Numbers:
Office: +972-(0)9-7740261
Fax: +972-(0)9-7740261
Mobile: +972-(0)58-888377
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Where is Server.Execute in .NET?
"Natty Gur" <natty@.dao2com.com> wrote in message
news:O00n72KbDHA.2672@.tk2msftngp13.phx.gbl...
> Ben hi,
> if you keep the data in DB its probebly static so maybe its betteer to
> store the data in application cache.
> Natty Gur, CTO
> Dao2Com Ltd.
> 34th Elkalay st. Raanana
> Israel , 43000
> Phone Numbers:
> Office: +972-(0)9-7740261
> Fax: +972-(0)9-7740261
> Mobile: +972-(0)58-888377
>
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!
It's a method of the HttpServerUtility class. Similar to Server.Transfer,
except that after executing the target page, control returns to the calling
page. It was more in vogue with classic ASP, since classic ASP is
procedural. You could use it to do a "dynamic include" - include content
from another ASP page conditionally. ASP.Net has better mechanisms for such
things, so it isn't used very often.
--
HTH,
Kevin Spencer
Microsoft MVP
..Net Developer
http://www.takempis.com
The more I learn, the less I know.
"MS News (MS ILM)" <sql_agentmans@.hotmail.com> wrote in message
news:%23DlzaXMbDHA.3768@.tk2msftngp13.phx.gbl...
> Where is Server.Execute in .NET?
>
> "Natty Gur" <natty@.dao2com.com> wrote in message
> news:O00n72KbDHA.2672@.tk2msftngp13.phx.gbl...
> > Ben hi,
> > if you keep the data in DB its probebly static so maybe its betteer to
> > store the data in application cache.
> > Natty Gur, CTO
> > Dao2Com Ltd.
> > 34th Elkalay st. Raanana
> > Israel , 43000
> > Phone Numbers:
> > Office: +972-(0)9-7740261
> > Fax: +972-(0)9-7740261
> > Mobile: +972-(0)58-888377
> > *** Sent via Developersdex http://www.developersdex.com ***
> > Don't just participate in USENET...get rewarded for it!
Saturday, March 24, 2012
Server.Execute
Labels:
asp,
execute,
hiyoi,
include,
net,
path,
perform,
programmatic,
server,
server-side,
serverexecute,
thebest
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment