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

Microsoft Personal Web Site Starter Kit – Random Image Web User Control

Rate me:
Please Sign up or sign in to vote.
2.33/5 (3 votes)
29 Mar 20064 min read 53K   412   33  
How to create a web user control to show a random photo on the home page of Microsoft Personal Web Site Starter Kit
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 Admin_UserControls_RandomPhoto : System.Web.UI.UserControl
{
    #region Properties

    public string DataSourceID
    {
        get
        {
            return _DataSourceID;
        }

        set
        {
            _DataSourceID = value;
            this.FormView.DataSourceID = _DataSourceID;
        }
    } private string _DataSourceID = string.Empty;

    public string Title
    {
        get
        {
            return _Title;
        }

        set
        {
            _Title = value;
        }
    } private string _Title = "Photo of the Day";

    public string Text
    {
        get
        {
            return _Text;
        }

        set
        {
            _Text = value;
        }
    } private string _Text = "This is the photo of the day";

    #endregion

    protected void Page_Load(object sender, EventArgs 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 has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Web Developer
Canada Canada
Angel Anichin is experienced .Net developer living in Canada.

Expertise: ASP.NET, C#, MS Content Management Server, MS SQL Server, Oracle, HTML, JavaScript, CSS

Hobbies: Digital Photography, Skiing

Comments and Discussions