ASPX page can not access Code Behind

In my page I try and access a property defined in the code behind.  The Property is called RDDB and it's defined in the code behind, yet can not be found in the aspx page.

Any idea why not?

newbieweb

 Can not access Code Behind
 Code Behind
newbiewebSr. Software EngineerAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
Kusala WijayasenaConnect With a Mentor Software EngineerCommented:
Change the fist line of code behind page

from

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TableList.aspx.cs" Inherits="RDDBWebAdmin.TableList" %>

Open in new window


to

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TableList.aspx.cs" Inherits="RDDBWebAdmin.Pages.TableList" %>

Open in new window


-Kusala
0
 
Nash2334Commented:
The order of events dictates that the codebehind is processed on the server first.  Your script block should be moved to the codebehind as well.
0
 
Paul MacDonaldDirector, Information SystemsCommented:
What [Nash2334] said.

An alternative would be to maybe put a hidden field in the page and push the value to it on Page.Load.
0
 
jkofteConnect With a Mentor Commented:
Kusala's solution seems to be correct. The namespace you use in your aspx should contain the definitions you try to use in codebehind.
0
 
newbiewebSr. Software EngineerAuthor Commented:
Yes, it was a namespace issue.
Thanks!
0
All Courses

From novice to tech pro — start learning today.