Professional Web Applications Themes

codebehind files in different location - ASP.NET General

hi, I hope someone can help me with this please I'm trying to move my codebehind files to a folder other than the one my webform sits in. I've tried changing the 'scr' page level attribute of my webform, but i get the following pr error; Pr Error Message: 'c:\WebForm2.aspx.vb' is a physical path. this the code; <% Page Language="vb" AutoEventWireup="false" src="c:\WebForm2.aspx.vb" Inherits="mywork"%> Is my syntax for the physical path incorrect? I know it might seem like a silly question, but what IS the correct syntax? Also, how do i move this codebehind file? many thanks m...

  1. #1

    Default codebehind files in different location

    hi, I hope someone can help me with this please


    I'm trying to move my codebehind files to a folder other than the one
    my webform sits in. I've tried changing the 'scr' page level attribute
    of my webform, but i get the following pr error;

    Pr Error Message: 'c:\WebForm2.aspx.vb' is a physical path.

    this the code;
    <% Page Language="vb" AutoEventWireup="false"
    src="c:\WebForm2.aspx.vb" Inherits="mywork"%>


    Is my syntax for the physical path incorrect? I know it might seem
    like a silly question, but what IS the correct syntax? Also, how do i
    move this codebehind file?

    many thanks

    m
    Maurice Guest

  2. #2

    Default Re: codebehind files in different location

    Try setting the source the same way you would set a link in a web site:

    "codebehindfolder/WebForm2.aspx.vb"

    Or if the folder is back one folder from the .aspx file:

    "../codebehindfolder/WebForm2.aspx.vb"

    Sincerely,

    --
    S. Justin Gengo, MCP
    Web Developer

    Free code library at:
    www.aboutfortunate.com

    "Out of chaos comes order."
    Nietzche


    "Maurice Walmsley" <com> wrote in message
    news:google.com... 


    S. Guest

  3. #3

    Default Re: codebehind files in different location

    So you have to make your code behind files available on the web (and hope
    that IIS filters won't serve them). So much for security...

    Jerry

    "S. Justin Gengo" <com> wrote in message
    news:e%phx.gbl... 
    >
    >[/ref]


    Jerry Guest

  4. #4

    Default Re: codebehind files in different location

    Unless there's a bug in the filter. If you could have your code-behind in a
    location that's not available on the web (like Maurice is trying to do) you
    would not have to worry about this.

    Jerry

    "Kevin Spencer" <com> wrote in message
    news:O%phx.gbl... 
    he's [/ref]
    hope [/ref][/ref]
    site: [/ref][/ref]
    one [/ref][/ref]
    attribute [/ref][/ref]

    > >
    > >[/ref]
    >
    >[/ref]


    Jerry Guest

  5. #5

    Default Re: codebehind files in different location

    hi all,

    thanks for the answers.

    I never concidered removing them from the current file to protect them
    from web access, but so that I could have my vb files in a central
    location (just like classic asp and include files).

    I still can't get this to work, though. The issue seems to be with my
    use of an absolute path as the src of the codebehind[1] file.

    I've tried navigating using relative paths, but get this pr error;
    "Cannot use a leading .. to exit above the top directory"

    I've tried absolute paths; [src="c:\WebForm2.aspx.vb"], but get;
    "Pr Error Message: 'c:\WebForm2.aspx.vb' is a physical path"


    The whole point is code 'behind'. I'm sure there is a way to do this,
    I just havent found the right syntax/way yet.

    cheers

    maurice


    [1]ofc, the codebehind attrubiute is only used by VS.NET, not the
    asp.net page/form itself. The page needs the src attribute.
    Maurice Guest

  6. #6

    Default Re: codebehind files in different location

    correct me someone if im wrong but I think not because it works for me
    if you are doing that for security reasons, then its not necessary
    When you build your app, your dll contains the compiled codebehind so you
    can erase the ".aspx.vb" if you wish, you dont need them there.
    Just leave the .config, .aspx, global.asax and other configuration files

    Xavier
    Costa Rica


    "Maurice Walmsley" <com> wrote in message
    news:google.com... 


    Xavier Guest

  7. #7

    Default Re: codebehind files in different location

    No need for the .vb or .cs
    need .dll, .aspx, .config, .asax, images, etc....

    "Xavier MT" <com> wrote in message
    news:phx.gbl... 
    >
    >[/ref]


    MS Guest

Similar Threads

  1. Installing Shockwave - location of files
    By rln1001 in forum Macromedia Shockwave
    Replies: 0
    Last Post: June 1st, 03:02 PM
  2. Work files - changing their location
    By Mpolha in forum Macromedia Contribute Connection Administrtion
    Replies: 0
    Last Post: June 14th, 04:44 PM
  3. location of cfc files; jars anyone
    By maybenull in forum Coldfusion Component Development
    Replies: 9
    Last Post: March 8th, 06:54 AM
  4. Location of Temporary Flash Files
    By Vincent in forum Macromedia Flash
    Replies: 1
    Last Post: April 4th, 02:42 AM
  5. project Files Location
    By SStory in forum ASP.NET General
    Replies: 0
    Last Post: August 8th, 09:53 PM

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