protected void btnSubmit_Click(object sender, EventArgs e) { if (txtAbout.Text.Length != 0) { string AboutText = txtAbout.Text; SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString); con.Open(); SqlCommand cmd1 = new SqlCommand("INSERT into AboutUsData Values ('" + AboutText + "')", con); cmd1.ExecuteNonQuery(); con.Close();
protected void Page_Load(object sender, EventArgs e) { SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString); con.Open(); SqlCommand com = new SqlCommand("SELECT * from AboutUsData", con); SqlDataAdapter da = new SqlDataAdapter(com); DataSet ds = new DataSet(); da.Fill(ds, "AboutUsData"); TextBox1.Text = ds.Tables["AboutUsData"].Rows[0]["About"].ToString(); con.Close(); }
string strAbout = ds.Tables["AboutUsData"].Rows[0]["About"].ToString(); strAbout = "<p>" + strAbout + </p> //Take a label lblAbout.Text = Server.HtmlDecode(strAbout );
<p id="paragraph" runat="server"></p>
this.paragraph.InnerText = "This is a test of dynamicly adding paragraph text";
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)