コード例 #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        // get the existing customisations
        sc = (sessioncustomisations)Session["sessioncustomisation"];
        if (sc == null)
        {
            Response.Redirect("~/default.aspx", true);
        }
        if (sc.getsessioncustomisation("", "Nickname") == null)
        {
            Response.Redirect("~/default.aspx", true);
        }
        if (sc.getsessioncustomisation("", "First Name") == null)
        {
            Response.Redirect("~/default.aspx", true);
        }
        if (sc.getsessioncustomisation("", "Surname") == null)
        {
            Response.Redirect("~/default.aspx", true);
        }

        // get the layout, if there is no layout specified then redirect back to the home page
        spl = (sessionpagelayout)Session["sessionpagelayout"];
        if (spl != null)
        {
            pl = ceddio.loadpagelayout(spl.pagelayoutfilename);
        }
        if (pl == null)
        {
            Response.Redirect("~/default.aspx", true);
        }

        // get the article index to choose from the query string
        try
        {
            farticleindex = Convert.ToInt16(Request.QueryString["article"]);
        }
        catch
        {
            farticleindex = 0;
        }

        // get the total number of articles
        farticlestotal = pl.articles.Count;

        // get the prompt for the current article
        farticleprompt = pl.articles[articleindex].prompt;

        farticlename = pl.articles[articleindex].name;

        if (Page.IsPostBack == true)
        {
            return;
        }

        DataBind();

        ceddutils.databindrepeater("spArticlesGetAll", rarticles, "htsp");
    }
コード例 #2
0
 public string getheadline(string headline)
 {
     // replace #nickname#, #firstname# and #surname# in the string
     // have done replacement session stuff yet
     return(headline.Replace("#nickname#", sc.getsessioncustomisation("", "Nickname").value).Replace("#firstname#", sc.getsessioncustomisation("", "First Name").value).Replace("#Surname#", sc.getsessioncustomisation("", "Surname").value).ToUpper());
 }