このプログラムを実行しようとしましたが、テキストエリアで属性のシンボルを抽出しませんでした。
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Data;
using System.Web.UI.HtmlControls;
public partial class Default2 : System.Web.UI.Page
{
SqlConnection con = new SqlConnection(@"Data Source=AITPLCP72\SQLEXPRESS;Initial Catalog=Template;Integrated Security=True");
DataSet ds = new DataSet();
protected void Page_Load(object sender, EventArgs e)
{
if (IsPostBack)
{
SqlDataAdapter adp = new SqlDataAdapter("select field,Symbols from temp2", con);
adp.Fill(ds);
}
}
protected void btnfirstname_onclick(object sender, EventArgs e)
{
Symbol("firstname");
}
protected void btnlastname_onclick(object sender, EventArgs e)
{
Symbol("lastname");
}
protected void btnage_onclick(object sender, EventArgs e)
{
Symbol("age");
}
protected void btndob_onclick(object sender, EventArgs e)
{
Symbol("dob");
}
protected void btnsubmit_Click1(object sender, EventArgs e)
{
string s = TextArea1.InnerHtml;
Response.Redirect("http://localhost:2482/Template1/Default3.aspx?text1=" + s);
}
public void Symbol(string s)
{
foreach (DataRow row in ds.Tables[0].Rows)
{
if (row[0].ToString() == s.ToString())
{
string st = TextArea1.Value;
st += row["Symbols"];
TextArea1.Value = st;
}
}
}
}