だから私は aspx ファイルに条件があります:
<% if (yes)
{%>
{
<div>
<h1>hell yes!!</h1>
<p>Welcome</p>
</div>
<%}%>/
そして、これがページ読み込み時の私のコードです
protected void Page_Load(object sender, EventArgs e)
{
if (accnt != null)
{
using (SqlConnection conn = new SqlConnection(connectionstring))
{
conn.Open();
string strSql = "select statement"
:
:
try
{
if (intExists > 0)
{
bool yes= check(accnt);
}
}
catch
{
}
}
}
エラーが発生します:
CS0103: The name 'yes' does not exist in the current context
何がいけないんだろう…と考えていました。