protected void m_submit_Click(object sender, EventArgs e) { //Create a new story String parent = Request.QueryString["parent"]; //Find the logged-on author String author = Membership.GetUser().ToString(); ArticleCreator.CreateArticle(author, m_title.Text, m_contents.Text, parent); //And send the user back to see parent Response.Redirect("Default.aspx?article=" + parent); }
public void SubmitArticle(String username, String password, String title, String contents, String parent) { //Put a new article in the database //First validate the user if (!Membership.ValidateUser(username, password)) { //The user doesn't validate throw new Exception("The provided username and password were incorrect."); } //Now actually create the article ArticleCreator.CreateArticle(username, title, contents, parent); }