Solved

ASPX page can not access Code Behind

Posted on 2011-03-17
5
501 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 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

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 asp.net 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