Код: Выделить всё
"CS0103: The name 'TextBox' does not exist in the current context".
Код: Выделить всё
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Net;
using System.Net.Mail;
using System.Drawing;
using System.Configuration;
using System.Data.SqlClient;
using System.Data;
using System.Text;
using System.IO;
public partial class _Default : System.Web.UI.Page
{
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString);
protected void Page_Load(object sender, EventArgs e)
{
con.Open();
}
protected void Register_Click(object sender, EventArgs e)
{
SqlCommand cmd = new SqlCommand("insert into storedatabase values('"+TextBox2.Text+"')")
}
}
Код: Выделить всё
Я искал почти везде в Google, вот основные вещи, которые мне нужны. попробовал:
- с помощью потенциальных исправлений для преобразования TextBox2 в переменную
- проверил, есть ли в TextBox2 «runat="server" "
- проверил правописание
Любая помощь приветствуется. Спасибо!
Подробнее здесь: https://stackoverflow.com/questions/792 ... ng-a-few-t