Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

ASPX page can not access Code Behind

Posted on 2011-03-17
5
Medium Priority
?
504 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
[X]
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
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 1400 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 600 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

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

Question has a verified solution.

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

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…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

705 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