0
Imは私はTextBox1テキストボックスが私のコードで間違っている可能性が何名前 'Textbox1'は現在のコンテキストに存在しませんか?
<asp:TextBox ID="TextBox1" runat="server" Height="168px" TextMode="MultiLine"
Width="303px"></asp:TextBox>
を既存のですか?この
<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
string connect = ConfigurationManager.ConnectionStrings["TDBSConnectionString"].ConnectionString;
string query = "SELECT news, news_date FROM [IBSI].[dbo].[ibsi.news]";
if (query != null)
{
using (SqlConnection conn = new SqlConnection(connect))
{
using (SqlCommand cmd = new SqlCommand(query, conn))
{
conn.Open();
SqlDataReader rdr = cmd.ExecuteReader();
if (rdr.HasRows)
{
while (rdr.Read())
{
Textbox1.Text=rdr["news"].ToString() ;
}
}
}
}
}
else
{
Response.Write("<p>No customer selected</p>");
}
Response.End();
}
</script>
をしようとするとき、名「のTextBox1」は現在のコンテキスト内に存在しないこのエラーを受け取りますか?
ああ、あなたの権利を今解析エラーこのエラーXMLを受信イム:します。http:// localhost:50320 /ウェブサイト/ IBSIどの要素が 場所を発見していません.aspx 行番号1、列1: – Bert
このエラーが発生する理由はたくさんありますが、ここからいくつかの提案に従うことができます:http://stackoverflow.com/questions/303066/what-could-be-causing-an -xml-parsing-error-no-element-found –
'Response.End();を呼び出さないでください – SLaks