Solved

ASPX page can not access Code Behind

Posted on 2011-03-17
5
500 Views
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?

newbieweb

 Can not access Code Behind
 Code Behind
0
Comment
Question by:newbieweb
5 Comments
 
LVL 10

Expert Comment

by:Nash2334
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.
0
 
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.
0
 
LVL 11

Accepted Solution

by:
Kusala Wijayasena earned 350 total points
ID: 35159701
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
 
LVL 9

Assisted Solution

by:jkofte
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.
0
 

Author Closing Comment

by:newbieweb
ID: 35165222
Yes, it was a namespace issue.
Thanks!
0

Featured Post

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

Question has a verified solution.

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

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

830 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