Advertisement
Guest User

Untitled

a guest
Feb 20th, 2019
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.89 KB | None | 0 0
  1. <asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
  2.  
  3. </asp:Content>
  4. <asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
  5. <form id="form1" runat="server">
  6. Username: <asp:TextBox ID="txtUserName" runat="server" /></br>
  7. OTP: <asp:TextBox ID="txtOTP" runat="server" /></br>
  8. <asp:TextBox ID="OtpHiddenField" runat="server" /></br>
  9. <asp:Button ID="btnValidate" runat="server" onclick="btnValidate_Click" Text="Validate" /></br>
  10. </form>
  11. </asp:Content>
  12.  
  13. <asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder2" Runat="Server">
  14. <h2>Fake OTP Simulation</h2>
  15. Enter "John"
  16. </br>
  17. Enter OTP
  18. <script type='text/javascript'>
  19. var pass = String(getRandomInt(0, 9)) + String(getRandomInt(0, 9)) + String(getRandomInt(0, 9)) + String(getRandomInt(0, 9));
  20. document.write(pass);
  21. document.getElementById('<%= OtpHiddenField.ClientID %>').value = pass;
  22. </script>
  23.  
  24. <asp:Content ID="Content2" ContentPlaceHolderID="HeadContent" Runat="Server">
  25. <form id="form1" runat="server">
  26. Username: <asp:TextBox ID="txtUserName" runat="server" /><br/>
  27. OTP: <asp:TextBox ID="txtOTP" runat="server" /><br/>
  28. <asp:Button ID="btnValidate" runat="server" onclick="btnValidate_Click" Text="Validate" /><br/>
  29. <asp:HiddenField ID="OtpHiddenField" runat="server" />
  30. </form>
  31. </asp:Content>
  32.  
  33. <asp:Content ID="Content3" ContentPlaceHolderID="MainContent" Runat="Server">
  34. <h2>Fake OTP Simulation</h2>
  35. Enter "John"
  36. <br/>
  37. Enter OTP
  38. <script type='text/javascript'>
  39. function getRandomInt(min, max) {
  40. return Math.floor(Math.random() * (max - min + 1)) + min;
  41. }
  42. var pass = String(getRandomInt(0, 9)) + String(getRandomInt(0, 9)) + String(getRandomInt(0, 9)) + String(getRandomInt(0, 9));
  43. document.write(pass);
  44. document.getElementById('<%= OtpHiddenField.ClientID %>').value = pass;
  45. </script>
  46. </asp:Content>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement