assaultkitty
asked on
C#5
Unforunately, I cannot find a code that I can compare my work with. I have a book but it does not have any hints to the solutions. So thanks everyone.
So far, I have done what everyone has said. I am getting a blank webpage. I have submitted the HTML page to the Default.aspx. I am not getting anymore scripting errors. Thanks. Now, Am i ready for the Default.aspx? I will begin working on it now.
<!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>
<title>Paycheck</title>
</head>
<body>
<script runat="server" >
void Text1_onclick(object sender, EventArgs e)
{
}
void Text1_onclick(object sender, EventArgs e)
{
}
void Submit1_onclick(object sender, EventArgs e) {
if (Text1.Value.Length < 1)
{
string error = "Please Enter a value in Hours Field ";
string script = "alert(\"" + error + "\");";
ClientScript.RegisterClien tScriptBlo ck(this.Ge tType(), "myScript", script , true);
}
else if(Text2.Value.Length < 1)
{
ststring error = "Please Enter a value in Pay Rate Field";
string script = "alert(\"" + error + "\");";
ClientScript.RegisterClien tScriptBlo ck(this.Ge tType(), "myScript", script , true);
}
else
{
double hours = Convert.ToDouble(Text1.Val ue);
double rate = Convert.ToDouble(Text2.Val ue);
MessageBox.Show(string.For mat("Your Gross Pay is $ {0}" ,hours - 40 * rate * 1.5));
}
</script>
<form action="Default.aspx" method="post">
<p>Enter Hours Worked:<input id="Text1" type="text" onServerClick="Text1_onCli ck" /></p>
<p>Enter Pay Rate:<input id="Text2" type="text" onServerClick="Text2_onCli ck" /></p>
<p><input id="Submit1" type="submit" value="submit" onServerClick="Submit1_onc lick" /></p>
</form>
</body>
</html>
So far, I have done what everyone has said. I am getting a blank webpage. I have submitted the HTML page to the Default.aspx. I am not getting anymore scripting errors. Thanks. Now, Am i ready for the Default.aspx? I will begin working on it now.
<!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>
<title>Paycheck</title>
</head>
<body>
<script runat="server" >
void Text1_onclick(object sender, EventArgs e)
{
}
void Text1_onclick(object sender, EventArgs e)
{
}
void Submit1_onclick(object sender, EventArgs e) {
if (Text1.Value.Length < 1)
{
string error = "Please Enter a value in Hours Field ";
string script = "alert(\"" + error + "\");";
ClientScript.RegisterClien
}
else if(Text2.Value.Length < 1)
{
ststring error = "Please Enter a value in Pay Rate Field";
string script = "alert(\"" + error + "\");";
ClientScript.RegisterClien
}
else
{
double hours = Convert.ToDouble(Text1.Val
double rate = Convert.ToDouble(Text2.Val
MessageBox.Show(string.For
}
</script>
<form action="Default.aspx" method="post">
<p>Enter Hours Worked:<input id="Text1" type="text" onServerClick="Text1_onCli
<p>Enter Pay Rate:<input id="Text2" type="text" onServerClick="Text2_onCli
<p><input id="Submit1" type="submit" value="submit" onServerClick="Submit1_onc
</form>
</body>
</html>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER