How to link VS ASPX web designer to the code behind

Posted on 2008-11-04
Last Modified: 2013-12-17
Am running VS2008 and it seems my web project's files are not linked properly. I created a web ASCX page and am populating the page with controls. When I attempt to add events to the code behind (via the designer properties back-tab) the designer creates a script block. How do I link the ASCX page to its respective code-behind file? I prefer to deploy the code-behind via a complied DLL.  I am running C#.

<%@ Register assembly="DevExpress.Xpo.v8.2, Version=, Culture=neutral, PublicKeyToken=9b171c9fd64da1d1" namespace="DevExpress.Xpo" tagprefix="dxxpo" %>

<script runat="server">

    protected void ASPxButtonUpdateReports_Click(object sender, EventArgs e)

Question by:TimPeer
    LVL 13

    Accepted Solution

    Seems like you have not enabled the option to place code in seperate file.

    While creating the new control visual studio displays a check box "place code behind in seperate file" you have to enable it. Delete the file and create it again and enable it.

    Author Comment

    Does VS have the ability to check this option (in or outside) the IDE? Perhaps I can toggle it there? I am not looking forward to rebuilding the already completed page.

    Thanks for you quick response to the question!!!!!


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Find Ransomware Secrets With All-Source Analysis

    Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

    For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK ( for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
    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…
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.
    This video discusses moving either the default database or any database to a new volume.

    779 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

    14 Experts available now in Live!

    Get 1:1 Help Now