Click to See Complete Forum and Search --> : include() in ASP.NET


Ka-lolek
June 13th, 2008, 03:00 PM
hello,
I would like to know how to write some script like this one:

<?php
if(!isset($_GET['plik'])):
include("artykuly/oMnie.html");
else:
if(file_exists("artykuly/".$_GET['plik'].".html")):
include("artykuly/".$_GET['plik'].".html");
else:
echo "Przepraszamy ale nie można wy_wietlić tej strony!";
endif;
endif;
?>

in asp.net..
(in this example I link like <a href="index.php?plik=SomeName">

Greetings
Ka-lolek

hspc
June 14th, 2008, 04:48 AM
When you use ASP.NET, do it the .NET way.
Includes is not the common or the best way to implement this. You can use user controls to contain reusable components of the page and show/Hide them. Or even load them dynamically in the runtime.
Check this simple article (http://www.15seconds.com/issue/020319.htm) for more information.

Ka-lolek
June 16th, 2008, 09:03 AM
but could You tell me whether if I use master pages, when user clicks some link, all content is reloaded or only content which is different on every site?
(using include I could do it faster because only text was reloaded and all graphics stayed there)
Greetings

hspc
June 16th, 2008, 03:26 PM
(using include I could do it faster because only text was reloaded and all graphics stayed there)
Stayed where? On the client? Caching has no relation with includes or master pages on the server. This is another issue.
Or did I miss what you mean ?