Solved

c#6

Posted on 2012-03-17
6
222 Views
Last Modified: 2012-03-18
Not getting a response from the server side.  I cannot get the results to show.  I have made the changes suggested by the experts but no display on the server side.  I made the changes to the submit button a little concerned about that one.  Maybe too many arguments.  Please check that issue, the blank server side display, and any errors - please?

<!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.RegisterClientScriptBlock(this.GetType(), "myScript", script , true);

              }
            else if(Text2.Value.Length < 1)
             {
                string error = "Please Enter a value in Pay Rate Field";
                string script = "alert(\"" + error + "\");";
                ClientScript.RegisterClientScriptBlock(this.GetType(), "myScript", script , true);

              }
            else
             {
                string error = Convert.ToDouble(Text1.Value);
                string error = Convert.ToDouble(Text2.Value);
                string script = "alert(\"" + "\");";
                ClientScript.RegisterClientScriptBlock(this.GetType(), "myScript", script, true,
                "Your Gross Pay is $ {0}" ,hours - 40 * rate * 1.5);
             }
             }
       </script>
    <form action="Default.aspx" method="post" runat="server">
    <p>Enter Hours Worked:<input id="Text1" type="text" onServerClick="Text1_onClick" runat="server" /></p>
    <p>Enter Pay Rate:<input id="Text2" type="text" onServerClick="Text2_onClick" runat="server" /></p>
    <p><input id="Submit1" type="submit" value="submit" onServerClick="Submit1_onclick" runat="server" /></p>
    </form>
</body>
</html>
0
Comment
Question by:assaultkitty
  • 4
  • 2
6 Comments
 
LVL 18

Accepted Solution

by:
Rajar Ahmed earned 500 total points
ID: 37734040
try this..
<!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 Text2_onClick(object sender, EventArgs e)
        {

        }
        
        void Submit1_onclick(object sender, EventArgs e) {
            string error, script = "";
             double dOutput = 0;
            
             if (Text1.Value.Length < 1 )
             {
                 error = "Please Enter a value in Hours Field ";
                 script = "alert(\"" + error + "\");";
                ClientScript.RegisterClientScriptBlock(this.GetType(), "myScript", script , true);

              }
             else if (!Double.TryParse(Text1.Value, out dOutput))
             {
                 error = "Please Enter Valid Numbers in Hours Field ";
                 script = "alert(\"" + error + "\");";
                 ClientScript.RegisterClientScriptBlock(this.GetType(), "myScript", script, true);
             }
            else if(Text2.Value.Length < 1)
             {
                 error = "Please Enter a value in Pay Rate Field";
                script = "alert(\"" + error + "\");";
                ClientScript.RegisterClientScriptBlock(this.GetType(), "myScript", script , true);

             }

             else if (!Double.TryParse(Text2.Value, out dOutput))
             {
                 error = "Please Enter Valid Numbers in rate Field ";
                 script = "alert(\"" + error + "\");";
                 ClientScript.RegisterClientScriptBlock(this.GetType(), "myScript", script, true);
             }    
             
            else
             {
                 double  hours = Convert.ToDouble(Text1.Value);
                 double rate = Convert.ToDouble(Text2.Value);                
                 script = "alert(\"" + String.Format("Your Gross Pay is $ {0}" ,hours - 40 * rate * 1.5) + "\");";
                ClientScript.RegisterClientScriptBlock(this.GetType(), "myScript", script, true);
              }
             }
       </script>
    <form id="Form1" runat="server">
    <p>Enter Hours Worked:<input id="Text1" type="text" onServerClick="Text1_onClick" runat="server" /></p>
    <p>Enter Pay Rate:<input id="Text2" type="text" onServerClick="Text2_onClick" runat="server" /></p>
    <p><input id="Submit1" type="submit" value="submit" onServerClick="Submit1_onclick" runat="server" /></p>
    </form>
</body>
</html>

Open in new window

0
 

Author Comment

by:assaultkitty
ID: 37734061
I am sorry.  It is not even going to the server side now.  It is on the same page.  Can u help me?
0
 
LVL 18

Expert Comment

by:Rajar Ahmed
ID: 37734073
In c#9 only i understood  what you are looking for . Pls chk.
0
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 

Author Comment

by:assaultkitty
ID: 37734094
thank you.
0
 

Author Comment

by:assaultkitty
ID: 37734095
I did not work.  Sorry.
0
 

Author Closing Comment

by:assaultkitty
ID: 37735232
Thank you.  I think there is something wrong with my IDE.
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Select2 jquery help 9 41
asp syntax 3 22
How to measure sizes and angles in scanned images ? 3 26
Achieve json result 2 28
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now