This is a migrated thread and some comments may be shown as answers.

[Solved] UserControl edit form requires code-behind file to be deployed

2 Answers 139 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Yen
Top achievements
Rank 1
Yen asked on 13 Apr 2009, 10:43 PM
Dear Telerik:

I am using build 2009.1.311.35.  I have a Web application containing a RadGrid with a UserControl edit form as follows:

<EditFormSettings CaptionDataField="ID" CaptionFormatString="Edit Form for Case {0}" EditFormType="WebUserControl" UserControlName="EditForm.ascx"></EditFormSettings> 
 

I discovered that the UserControl requires the presence of the code-behind to work!  The edit form works fine when I browse the page from Visual Studio.  However, if I removed the UserControl's code-behind file or if I deployed the application without the code-behind file, I got the following error:

Message: Sys.WebForms.PageRequestManagerServerErrorException: The file '/webtest/EditForm.ascx.cs' does not exist.  
 
URI: http://localhost:88/webtest/Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=RadScriptManager1_HiddenField&compress=1&_TSM_CombinedScripts_=%3b%3bSystem.Web.Extensions%2c+Version%3d3.5.0.0%2c+Culture%3dneutral%2c+PublicKeyToken%3d31bf3856ad364e35%3aen-US%3a3bbfe379-348b-450d-86a7-bb22e53c1978%3aea597d4b%3ab25378d2%3bTelerik.Web.UI%2c+Version%3d2009.1.311.35%2c+Culture%3dneutral%2c+PublicKeyToken%3d121fae78165ba3d4%3aen-US%3ae7ad36d2-e9ec-4737-9fbd-fcc9c464e2bd%3a16e4e7cd%3aed16cbdc%3a58366029%3af7645509%3a24ee1bba%3a1e771326%3aaa288e2d%3ae330518b%3ac8618e41%3ae4f8f289  
 
 

The error is also returned if the application uses a post-back instead of an Ajax call.  Since we are not able to deploy the code-behind file in production, any information you can provide to help troubleshoot this issue would be appreciated.

Thanks,

-Yen

2 Answers, 1 is accepted

Sort by
0
Accepted
Sebastian
Telerik team
answered on 16 Apr 2009, 02:49 PM
Hello Yen,

I think that the error you observed is due to the fact that the CodeFile attribute in the Control directive of your user control (which relates the aspx with the code-behind file) still remains despite you removed manually the .cs file. I suppose you will get the same error if you place your user control on an empty web form and view the page in the browser.

Let me know if I am missing something.

Regards,
Sebastian
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Yen
Top achievements
Rank 1
answered on 20 Apr 2009, 11:09 PM
Sebastian,

You are absolutely right! My mistake. Changing the CodeFile attribute to CodeBehind in the Page directive does the trick.

Thanks for your help.
Tags
Grid
Asked by
Yen
Top achievements
Rank 1
Answers by
Sebastian
Telerik team
Yen
Top achievements
Rank 1
Share this question
or