I am working on a ASP.NET website that will dynamically change the size of a video. I know that this is not very clean code, but it doesn't need much optimization for its future use. What I'd like know is if there is a way to write XHTML compliant code in the Response.Write(). See below in the function videoPlay, I had to remove all quotation marks to compile without errors. Thanks for any help!
Mike
CODE
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
void videoPlay(object sender, EventArgs e)
{
string w = Convert.ToString(wth.Text);
string h = Convert.ToString(ht.Text);
int w_compare = Convert.ToInt32(wth.Text);
int h_compare = Convert.ToInt32(ht.Text);
if ((w_compare < 100) || (h_compare < 100))
{
Response.Write("<h1> Video Size of (" + w + "x" + h + ")px is too small</h1>");
}
else
{
Response.Write("<table border=0 cellpadding=3>");
Response.Write("<tr>");
Response.Write("<embed src=test.rpm width=" + w + " height=" + h + "nojava=true controls=ImageWindow console=one /> </tr>");
Response.Write("<tr><embed src=test.rpm width=" + w + " height=27 nojava=true controls=ControlPanel console=one /></tr>");
Response.Write("</table><br />");
}
}
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Testing video</title>
</head>
<body>
<form id="video" runat="server" >
<table border="0" cellpadding="3" >
<tr>
<td>Width</td>
<td>Height</td>
</tr>
<tr>
<td><asp:TextBox ID="wth" Columns="10" runat="server" Text="320" MaxLength="4" />px</td>
<td><asp:TextBox ID="ht" Columns="10" runat="server" Text="480" MaxLength="4" />px</td>
<td><asp:Button ID="Button1" Text="Submit" OnClick="videoPlay" runat="server" /></td>
</tr>
</table>
</form>
</body>
</html>