|
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;
using System.Text;
using YABlog.BLL;
public partial class UpdateEntry : System.Web.UI.Page
{
EntriesAction ent = new EntriesAction();
CategoriesAction cat = new CategoriesAction();
EntryBO entry = null;
protected void Page_Load(object sender, EventArgs e)
{
TextBox2.EnableHtmlMode = false;
if (Session["UserId"] == null)
{
Response.Redirect("Login.aspx");
}
if (!IsPostBack)
{
if (Request.QueryString["id"] == null)
{
Response.Redirect("default.aspx");
}
entry = ent.GetEntryDetails(Convert.ToInt32(Request.QueryString["id"]));
TextBox1.Text = entry.Subject;
cat.GetCategories(DropDownList1);
TextBox2.Text = entry.Body;
for (int i = 0; i < DropDownList1.Items.Count; ++i)
{
if (DropDownList1.Items[i].ToString() == cat.GetCategoryNameById(entry.CAT_ID))
{
DropDownList1.SelectedIndex = i;
}
}
}
}
protected void Button1_Click(object sender, EventArgs e)
{
Response.Redirect("ViewEntry.aspx?id=" + Request.QueryString["id"]);
}
protected void Button2_Click(object sender, EventArgs e)
{
if (TextBox1.Text != "")
{
ent.UpdateEntry(Convert.ToInt32(Request.QueryString["id"]), DropDownList1.SelectedValue, TextBox1.Text, TextBox2.Text);
Response.Redirect("ViewEntry.aspx?id=" + Request.QueryString["id"]);
}
}
}
|
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.
I Started my Programming career with C++. Later got a chance to develop Windows Form applications using C#. Currently using C#, ASP.NET & ASP.NET MVC to create Information Systems, e-commerce/e-governance Portals and Data driven websites.
My interests involves Programming, Website development and Learning/Teaching subjects related to Computer Science/Information Systems. IMO, C# is the best programming language and I love working with C# and other Microsoft Technologies.
- Microsoft Certified Technology Specialist (MCTS): Web Applications Development with Microsoft .NET Framework 4
- Microsoft Certified Technology Specialist (MCTS): Accessing Data with Microsoft .NET Framework 4
- Microsoft Certified Technology Specialist (MCTS): Windows Communication Foundation Development with Microsoft .NET Framework 4
If you like my articles, please visit my website for more: www.rahulrajatsingh.com[^]