Author: VoiceOfExperience | Posted on: 9/2/2009 11:56:24 AM | Views : 283

Using the code-behind model, I have a simple page described in Default.aspx and C# code to supply the data in App_Code/Default_aspx.cs. The references to the controls in .cs get errors CS0103 (name does not exist), not surprising, because there is nothing in the .cs file to declare or refer to these variables in the .aspx file.
My question is, how does one create such a reference, so the code in the .cs file knows about the controls defined in the .aspx file? I am building the project using VS2005.
Here are the portions of code that I think are relevant:
File : Default.aspx
<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="App_code/Default.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
Go to the complete details ...