Professional Web Applications Themes

use both C# and VB in ASP development - ASP Components

I followed a Microsoft Webcast and constructed a Website. I have VB code in the App_Code folder. Everything works. I learned that every time I change the VB code in App_Code folder, it will be automatically re-compiled. Then I used C# to write a public class and also put in the App_Code folder. I failed to build with an error saying that I can not put 2 different language in the same App_Code folder. So I created another folder called App_Code_c and had my C# code put in there. When I build, I see the message saying my C# code ...

  1. #1

    Default use both C# and VB in ASP development

    I followed a Microsoft Webcast and constructed a Website. I have VB code in
    the App_Code folder. Everything works. I learned that every time I change the
    VB code in App_Code folder, it will be automatically re-compiled. Then I used
    C# to write a public class and also put in the App_Code folder. I failed to
    build with an error saying that I can not put 2 different language in the
    same App_Code folder. So I created another folder called App_Code_c and had
    my C# code put in there. When I build, I see the message saying my C# code is
    complied, and without an error, but in my ASP code, I can not refer to the
    class that is defined in my C# code. I can make my C# code work if I kick out
    all the VB code in App_Code folder & only put C# code in App_Code.

    How can I write some classes in C# and make them accessible in ASP which is
    primarily composed with VB ?

    Thanks.
    dotNetFan Guest

  2. #2

    Default RE: use both C# and VB in ASP development

    Hello,

    I think you may create two different project in one solution, for example,
    a VB.NET ASP.NET project as the main project, and C# class library project
    with your customized C# class. In the VB ASP.NET project, you can add a
    reference to the C# project so that you can use the classes defined in the
    C# project.

    BTW, for ASP.NET issues, we usually post in following group:

    microsoft.public.dotnet.framework.aspnet

    Sincerely,

    Luke Zhang

    Microsoft Online Community Support
    ==================================================
    Get notification to my posts through email? Please refer to
    [url]http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif[/url]
    ications.

    Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
    where an initial response from the community or a Microsoft Support
    Engineer within 1 business day is acceptable. Please note that each follow
    up response may take approximately 2 business days as the support
    professional working with you may need further investigation to reach the
    most efficient resolution. The offering is not appropriate for situations
    that require urgent, real-time or phone-based interactions or complex
    project ysis and dump ysis issues. Issues of this nature are best
    handled working with a dedicated Microsoft Support Engineer by contacting
    Microsoft Customer Support Services (CSS) at
    [url]http://msdn.microsoft.com/subscriptions/support/default.aspx[/url].
    ==================================================

    This posting is provided "AS IS" with no warranties, and confers no rights.



    Luke Zhang [MSFT] Guest

  3. #3

    Default Re: use both C# and VB in ASP development

    [url]http://www.aspkey.net/aspkey/_blog/index.asp?giorno=2&month=2&year=2007[/url]





    "dotNetFan" <nickAliasnospam.nospam> wrote in message news:BD8C026B-DED8-4167-9618-6DDEF0B43DEFmicrosoft.com...
    >I followed a Microsoft Webcast and constructed a Website. I have VB code in
    > the App_Code folder. Everything works. I learned that every time I change the
    > VB code in App_Code folder, it will be automatically re-compiled. Then I used
    > C# to write a public class and also put in the App_Code folder. I failed to
    > build with an error saying that I can not put 2 different language in the
    > same App_Code folder. So I created another folder called App_Code_c and had
    > my C# code put in there. When I build, I see the message saying my C# code is
    > complied, and without an error, but in my ASP code, I can not refer to the
    > class that is defined in my C# code. I can make my C# code work if I kick out
    > all the VB code in App_Code folder & only put C# code in App_Code.
    >
    > How can I write some classes in C# and make them accessible in ASP which is
    > primarily composed with VB ?
    >
    > Thanks.

    Jon Paal [MSMD] Guest

Similar Threads

  1. Debate PHP Development
    By curiologix in forum PHP Programming
    Replies: 4
    Last Post: December 21st, 09:42 AM
  2. Web development
    By Derek W. Peck of SystemTech Computers in forum Macromedia Exchange Dreamweaver Extensions
    Replies: 3
    Last Post: January 23rd, 05:33 PM
  3. Replies: 4
    Last Post: August 6th, 10:20 PM
  4. what to use for development
    By Arthur Marsh in forum Sun Solaris
    Replies: 0
    Last Post: July 11th, 02:11 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139