Reputation: 4511
Apparently I am doing something wrong when I am trying to connect the ID1 between the two files below and I am running out of ideas right now.
How do I fix the error: The name 'ID1' does not exist in the current context
In "PrintExtraInfo.aspx"
<asp:Table ID="Table1" runat="server">
<asp:TableRow>
<asp:TableCell CssClass="ContactRightTD">
<span class="minititle">ID1</span>
<div class="divider3">
</div>
<asp:Label ID="ID1" runat="server"></asp:Label><br />
<div class="divider3">
</div>
</asp:TableCell>
</asp:TableRow>
</asp:Table>
In "PrintExtraInfo.aspx.cs":
if (Request.QueryString.HasKeys())
{
email = Request.QueryString["m"].ToString();
if (!String.IsNullOrEmpty(email))
{
DataSet ds = MySQL.RunQuery("SELECT * FROM auctioncartechspec");
DataRow row;
if ((row = ds.Tables[0].Rows[0]) != null)
{
ID1.Text = row["ID"].ToString();
}
}
}
Upvotes: 0
Views: 861
Reputation: 4511
Actually this implementation worked once I restarted my computer for the third time, sorry for the inconvenience.
Upvotes: 1