All pastes #165298 Raw Edit

Mine

public text v1 · immutable
·published 2006-09-09 18:37 UTC
rendered paste body
public partial class Webpage : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            String articleText = getArticle(Request.QueryString.Get("articleid"));
        }
        catch (Exception ex)
        {
            String articleText = ex.Message;
        }
        finally
        {
            pageContent.Text = articleText;
        }
    }

    private String getArticle(int id)
    {
        // SQL stuff
        // returns article as string

        if (article != null)
        {
            return article;
        }
        else
        {
            throw new Exception("Article not found");
        }
    }
}