Click here to Skip to main content
15,884,177 members
Articles / Web Development / ASP.NET

Matematico Web Game in ASP.NET using RegEx

Rate me:
Please Sign up or sign in to vote.
4.27/5 (5 votes)
2 Jul 2008CPOL3 min read 34K   456   15  
A logical Web game
  • matematico_src.zip
    • App_Data
    • Cards
      • 2C.gif
      • 2D.gif
      • 2H.gif
      • 2S.gif
      • 3C.gif
      • 3D.gif
      • 3H.gif
      • 3S.gif
      • 4C.gif
      • 4D.gif
      • 4H.gif
      • 4S.gif
      • 5C.gif
      • 5D.gif
      • 5H.gif
      • 5S.gif
      • 6C.gif
      • 6D.gif
      • 6H.gif
      • 6S.gif
      • 7C.gif
      • 7D.gif
      • 7H.gif
      • 7S.gif
      • 8C.gif
      • 8D.gif
      • 8H.gif
      • 8S.gif
      • 9C.gif
      • 9D.gif
      • 9H.gif
      • 9S.gif
      • AC.gif
      • AD.gif
      • AH.gif
      • AS.gif
      • JC.gif
      • JD.gif
      • JH.gif
      • JS.gif
      • KC.gif
      • KD.gif
      • KH.gif
      • KS.gif
      • QC.gif
      • QD.gif
      • QH.gif
      • QS.gif
      • TC.gif
      • TD.gif
      • TH.gif
      • TS.gif
    • Default.aspx
    • Default.aspx.cs
    • OneOf25.ascx
    • OneOf25.ascx.cs
    • StyleSheet.css
    • Web.Config
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class OneOf25 : System.Web.UI.UserControl
    {
    
    public  string Card
        {
        get { return (ViewState["Card"] == null)? "" : (string)ViewState["Card"]; }
        set { ViewState["Card"] = value; }
        }

    public delegate void OnClickEventHandler(object sender, EventArgs e);
    public event OnClickEventHandler OnClick;

    
    protected void Page_PreRender(object sender, EventArgs e)
        {
        CardButton.Visible = (Card.Equals(""));
        CardImage.Visible = !(Card.Equals(""));
        if (CardImage.Visible) {
            CardImage.ImageUrl = "~/Cards/" + Card + ".gif";
            }
        }


    protected void CardButton_Click(object sender, EventArgs e)
        {
        if (OnClick != null) OnClick(this, e);
        }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Czech Republic Czech Republic
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions