...

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



lbeckman
06-11-2007, 06: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,

and

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?

glenngv
06-12-2007, 05: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).

lbeckman
06-13-2007, 11:48 PM
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.

lbeckman
06-20-2007, 06: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.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum