How to Generate Random Links in ASP-C#

Shubham
Posted by Shubham under ASP.NET category on | Points: 40 | Views : 1560
<%@ Page Language="C#" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">

<html>
<body>

<%
Random r = new Random();

double dd = r.NextDouble() ;
if (dd > 0.7)
Response.Write("<a href='#>Software Engineer</a>");
else if (dd > .5)
Response.Write("<a href='#'>Software Testing </a>");
else
Response.Write("<a href='#>Shubham Kumar</a>");

%>
<p>
Example of random link generator.
</p>

</body>
</html>

Comments or Responses

Login to post response