ASPX page can not access Code Behind

Posted on 2011-03-17
Last Modified: 2012-05-11
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?


 Can not access Code Behind
 Code Behind
Question by:newbieweb
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 10

Expert Comment

ID: 35156015
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.
LVL 34

Expert Comment

by:Paul MacDonald
ID: 35156054
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.
LVL 11

Accepted Solution

Kusala Wijayasena earned 350 total points
ID: 35159701
Change the fist line of code behind page


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

Open in new window


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

Open in new window


Assisted Solution

jkofte earned 150 total points
ID: 35164305
Kusala's solution seems to be correct. The namespace you use in your aspx should contain the definitions you try to use in codebehind.

Author Closing Comment

ID: 35165222
Yes, it was a namespace issue.

Featured Post

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
aspx ascx, c# 7 43
Best book for Internet security 4 53
Can Selenium do Load Testing? 2 59
Need Help With GDI+ in VB.Net 8 41
Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question