view multiple HTML blocks
I am a PHP coder currently learning ASP.NET.
My problem that i can't seem to figure out it's solution in ASP.NET is this:
In my PHP code to display list of articles and article details i do this
if($Web->GET("action")=="details"&&$Web->GET("id")!="")
{
//show article details
$Temp->clearParams();
$Temp->setFilename("details.tpl");
$Temp->addParamSet($Row);
$Content = $Temp->Compile();
}
else
{
//Show list of articles
while($DB->hasMoreRows())
{
$Row = $DB->getNextRow();
$Temp->clearParams();
$Temp->setFilename("single.tpl");
$Temp->addParamSet($Row);
$Content = $Temp->Compile();
}
}
$Temp->clearParams();
$Temp->setFilename("master.tpl");
$Temp->addParamSet($Row);
print $Temp->Compile();
Where DB,Temp,Web are my Database, Template Engine, Web class respectively.
I noticed that when using Master pages in ASP.NET you can write the the common HTML code in the master page and place a ContentPlaceHolder in the position you would like the content to be dynamic. Now in default.aspx you can add a block of HTML code to view 1 and only 1 page. How can i make it view more than 1 block programatically.
For example, if i wanted to write an articles system. I need to create a page called articles.aspx to view the list of articles with a link on each article called "details" which redirects to articlesDetails.aspx?id=123. I dont really want to make it redirect to an another page "articlesDetails.aspx" because in some applications you tend to make many many options and views for a single subsystem like "articlesSendtofriend.aspx" and "articlesrate.aspx". so i want to do this all in one code page called "articles.aspx" and display HTML content depending on the ?action=abc" GET paramter.
Anyone has any idea on how to implement this or is it too advanced?
Regards,
Rakan

