Starting fresh with a brand new Empty website application
I'm looking to apply a unique style to the aspx Page using a file that contains custom CSS attribute values. I'm not sure which approach would be better.
I'm still in the testing phase, and I have a file that contains these values:
width;100px width;130px background-color;#aac93f
These values are dynamically generated by another application.
I want to read this data into the application. The only two methods that come to mind are:
`File.ReadAllLines` or `File.ReadAllText`.
Then, through the code-behind, I would set the HTML elements' style properties based on processed data:
htmltag.Style.Add("width", setting1)....etc
OR
Another option could be to load the stylesheet from dynamic/programmatic data:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<!-- and include C# server code like below -->
<%=someVariableOrCsMethodReturnedValue%>
</head>
This way, a formatted style can be applied with the loaded values.
Is this the recommended method for loading custom CSS values?