Solved

ASPX page can not access Code Behind

Posted on 2011-03-17
5
497 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
Comment Utility
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 33

Expert Comment

by:paulmacd
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Yes, it was a namespace issue.
Thanks!
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

762 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now