Programme one:
Putting all the CSS styles and JavaScript functions into the
Scenario Two:
The CSS file for this content page is specified by code in the Pageload event of the content page.
The code is as follows
static public class Controlhelper
{
static public void Addstylesheet (Page page, string csspath)
{
Htmllink link = new Htmllink ();
Link. Href = Csspath;
Link. attributes["rel"] = "stylesheet";
Link. attributes["type"] = "text/css";
Page. HEADER.CONTROLS.ADD (link);
}
}
On a specific page, we can add a CSS reference with the following code:
protected void Page_Load (object sender, EventArgs e)
{
Controlhelper.addstylesheet (this. Page, "Css/projectpage.css");
}
The benefit of this solution is that you can dynamically change the desired CSS file while the program is running, but how do you do it with JavaScript functions? Is it necessary to add the CSS and JavaScript that should be added to the HTML code through the CS code?
Programme III:
Add a ContentPlaceHolder control to the , and then write CSS and JavaScript code in the content page for the corresponding content control.
CSS uses the master page's content page to invoke CSS and JavaScript