Controls don't appear in the code view of the ASP.NET Web application Project

Last post 07-01-2009 10:04 AM by alaa9jo. 2 replies.

Sort Posts:

  • Controls don't appear in the code view of the ASP.NET Web application Project

    06-03-2009, 8:31 AM
    • Member
      point Member
    • Sami324
    • Member since 06-03-2009, 12:23 PM
    • Posts 1

    Hi All,

    I am having a strange type of problem. I am writing a custom aspx page for SharePoint using  ASP.NET Web application project type. The problem which I am facing is that whatever controls i place on the page.There events are not generarted in the code i.e when i place a button and try double clicking it..it doesn't goes in to .cs file.Similar is the case for the lables and textboxes.The code doesn't know about the controls on the form.

    Could anyone of you please inform me what can be the reason?

    I am using VS 2005 Professional edtion.

    Thanks,

    Sami

  • Re: Controls don't appear in the code view of the ASP.NET Web application Project

    06-24-2009, 3:06 AM
    • Member
      172 point Member
    • blbirajdar02
    • Member since 02-25-2008, 7:32 AM
    • Posts 68

    I tried your scenario. It works for me in VS2008 PE.

    Balaji Birajdar
    Pune, India
  • Re: Controls don't appear in the code view of the ASP.NET Web application Project

    07-01-2009, 10:04 AM
    • Contributor
      5,320 point Contributor
    • alaa9jo
    • Member since 07-01-2009, 9:17 AM
    • Jordan
    • Posts 974

     check on "Codebehind" (in the source of the page) that it is referenced to the correct class (pagename.aspx.cs in c#),also check on "inherits" that contains the class name in codebehind of the page taking in consideration the namespace if used (namespace.classname)

    ex:

    <%@ Page Codebehind="mypage.aspx.cs" 

    Inherits="mynamespace.mypage" ....

     

    in codebehind (in the class that the page should use):

    namespace mynamespace

    {

    public partial class mypage : System.Web.UI.Page

    {....

    Best Regards,
    Ala'a Alnajjar
    ----------------------------------------------------
    Please remember to click “Mark as Answer” on the post(s) that help(s) you even if they were for the same person.
    Also remember to close the thread by selecting “Resolved”,you will find it in your first post.

    Convert C# to VB.net and visa versus

    My Webblog
Page 1 of 1 (3 items)