Guest User

Untitled

a guest
Feb 13th, 2018
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="MyWebFormPage.aspx.cs" Inherits="MatchingBirthdays.MyWebFormPage" %>
  2.  
  3. <%
  4.  
  5. DateTime GenererateRandomDate()
  6. {
  7. Random gen = new Random();
  8. int year = gen.Next(1979, 2018);
  9. int month = gen.Next(1, 13);
  10. int day = DateTime.DaysInMonth(year,month);
  11. int Day = gen.Next(1, day);
  12.  
  13. DateTime dt = new DateTime(year,month,Day);
  14. string matched = dt.ToString("dd/MM/yyyy");
  15. DateTime dtnew = Convert.ToDateTime(matched);
  16. DateMatched.Text = ("Date Matched: " + matched);
  17. return dt;
  18. }
  19.  
  20. %>
  21.  
  22. This is my HTML label:
  23.  
  24. <asp:Label ID="DateMatched" runat="server" Text="First"></asp:Label>
Add Comment
Please, Sign In to add comment