View Full Version : New to ASP, need help with SSI

06-11-2007, 07:28 PM
Hey, I'm using ASP with C#, and need to have a page's source updated upon clicking a link to change an SSI directive.

At the moment I've got:

<asp:LinkButton ID="LinkButton1" runat="server" OnClick="LinkButton1_Click">LinkButton</asp:LinkButton>

<asp:Literal ID="Literal1" runat="server"></asp:Literal>

in with my html,


protected void LinkButton1_Click(object sender, EventArgs e)
Literal1.Text = "<!--#include virtual=\".\\contentNew\\testpage.aspx\"-->";

in my associated C# code.

Now this kind of works. When clicking on the Link, the source is updated to containt the <!--#include virtual=".\contentNew\testpage.aspx"-->
However, this is exactly what ends up in the source, it's not processed like SSI usually is and replaced with the actual testpage.aspx. Is there any way I can get testpage.aspx to be included in the source instead of the include statement itself, or should I be going with a different approach entirely?

06-12-2007, 06:47 PM
I think what you need is this (http://www.c-sharpcorner.com/UploadFile/Lillyput/MasterPagesInAspDotNet210312006050526AM/MasterPagesInAspDotNet2.aspx?ArticleID=9125d720-1a98-4cdb-bc25-cb670dc4f808).

06-14-2007, 12:48 AM
Thanks, gave it a try but can't figure out how to get it to serve my needs at the moment. It seems that a master page can only collect content from a single content page (which makes for a really long, hard to edit file), and if I put additional content blocks in the content page for later referencing in the master page, Visual Web Developer complains that they aren't referenced in the master page and won't compile anything. For that matter, I'm not even sure if I can change the content blocks that the master page references on the fly from the code.

Hope some of that makes sense.

06-20-2007, 07:11 PM
Alright, managed to get everything going with the masterpages, once I'd better researched how they worked and such. Thanks for the tip.