Hi,
I am designing a Web server and I need to show the button Status( pressed/released ) on the client browser. I have used the following code for dynamically showing the HTML page. But now I want to put the HTML code into a reference. Can anyone suggest me how to pass the variables (ubs, sbs, dbs ) to the reference and use it as it was in the previous program…
static string ButtonPage()
{
// Determine the states of the three cobra buttons
string ubs; if (upButton.Read() == false) ubs = "Pressed"; else ubs = "Released";
string sbs; if (selectButton.Read() == false) sbs = "Pressed"; else sbs = "Released";
string dbs; if (downButton.Read() == false) dbs = "Pressed"; else dbs = "Released";
// Build the web page
string s = "<html>\n"; // First the page type
s += "<head><title>Fez Cobra Test Page</title></head>\n"; // now the page header
s += "<body>\n"; // start the body
s += "<p>Up Button State = <i>" + ubs + "</i></p>"; // Up button, state in italics
s += "<p>Select Button State = <i>" + sbs + "</i></p>"; // Select button, state in italics
s += "<p>Down Button State = <i>" + dbs + "</i></p>"; // Down button, state in italics
s += "</body>"; // close the body section
s += "</html>"; // close the page type
return s;
}
Thanx & Regards,