Hello DP members I need some help with a SSI ( Server side Include) when the URL matches on a dynamic page - i need it to produce the SSI to the browser to link to a .inc file to dynamically change the title it needs to work off a /images.aspx?id=1 so image 1 would include it but 2 would not i have the later working - i just need the asp script to produce the SSI code , HELP please
SSI's are fairly crude technologies to be using for .Net. What is the include? If you want to simply show a Div or not depending on if it is ID=1 or ID=2 then make the div an <asp: panel /> and use the load event to effect its Visibility property. protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (request.querystring("ID") == 1) { DisplayPanel.Visible = true; } else { DisplayPanel.Visible = false; } } } Code (markup):
The ssi is - Meta data pertaining to the content of the page - the site wasn't designed for SEO and now i have to make it, i figured SSI is the best for the way we need to edit it,
If it is meta data for all pages then use a MasterPage instead containing it and do the Load sub against the masterpage rather than its child. As its in the header just put in an <asp:Literal /> and set its Text attribute after testing the querystring
it's spefic only to that page, after a query to the database, and yes i could include it into the header, but i don;t have the original files, so i'm kinda flying blind here,
simply follow the code: de: protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (request.querystring("ID") == 1) { DisplayPanel.Visible = true; } else { DisplayPanel.Visible = false; } } }