codebehind files in different location

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Maurice Walmsley

    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 parser error;

    Parser Error Message: 'c:\WebForm2.as px.vb' is a physical path.

    this the code;
    <%@ Page Language="vb" AutoEventWireup ="false"
    src="c:\WebForm 2.aspx.vb" Inherits="mywor k"%>


    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
  • S. Justin Gengo

    #2
    Re: codebehind files in different location

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

    "codebehindfold er/WebForm2.aspx.v b"

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

    "../codebehindfolde r/WebForm2.aspx.v b"

    Sincerely,

    --
    S. Justin Gengo, MCP
    Web Developer

    Free code library at:


    "Out of chaos comes order."
    Nietzche


    "Maurice Walmsley" <mbwalmsley@hot mail.com> wrote in message
    news:922b3604.0 308191511.3e22c 972@posting.goo gle.com...[color=blue]
    > 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 parser error;
    >
    > Parser Error Message: 'c:\WebForm2.as px.vb' is a physical path.
    >
    > this the code;
    > <%@ Page Language="vb" AutoEventWireup ="false"
    > src="c:\WebForm 2.aspx.vb" Inherits="mywor k"%>
    >
    >
    > 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[/color]


    Comment

    • Jerry III

      #3
      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" <sjgengo@aboutf ortunate.com> wrote in message
      news:e%230hhKrZ DHA.1680@tk2msf tngp13.phx.gbl. ..[color=blue]
      > Try setting the source the same way you would set a link in a web site:
      >
      > "codebehindfold er/WebForm2.aspx.v b"
      >
      > Or if the folder is back one folder from the .aspx file:
      >
      > "../codebehindfolde r/WebForm2.aspx.v b"
      >
      > Sincerely,
      >
      > --
      > S. Justin Gengo, MCP
      > Web Developer
      >
      > Free code library at:
      > www.aboutfortunate.com
      >
      > "Out of chaos comes order."
      > Nietzche
      >
      >
      > "Maurice Walmsley" <mbwalmsley@hot mail.com> wrote in message
      > news:922b3604.0 308191511.3e22c 972@posting.goo gle.com...[color=green]
      > > 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 parser error;
      > >
      > > Parser Error Message: 'c:\WebForm2.as px.vb' is a physical path.
      > >
      > > this the code;
      > > <%@ Page Language="vb" AutoEventWireup ="false"
      > > src="c:\WebForm 2.aspx.vb" Inherits="mywor k"%>
      > >
      > >
      > > 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[/color]
      >
      >[/color]


      Comment

      • Jerry III

        #4
        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" <kevin@takempis .com> wrote in message
        news:O%23p71SxZ DHA.2032@TK2MSF TNGP10.phx.gbl. ..[color=blue]
        > If you set up your filters correctly, there is no security issue. What[/color]
        he's[color=blue]
        > doing is a perfectly legitimate use of ASP.Net.
        >
        > --
        > HTH,
        >
        > Kevin Spencer
        > Microsoft MVP
        > .Net Developer
        > http://www.takempis.com
        > Neither a follower nor a lender be.
        >
        > "Jerry III" <jerryiii@hotma il.com> wrote in message
        > news:uHQtOjsZDH A.2032@TK2MSFTN GP10.phx.gbl...[color=green]
        > > So you have to make your code behind files available on the web (and[/color][/color]
        hope[color=blue][color=green]
        > > that IIS filters won't serve them). So much for security...
        > >
        > > Jerry
        > >
        > > "S. Justin Gengo" <sjgengo@aboutf ortunate.com> wrote in message
        > > news:e%230hhKrZ DHA.1680@tk2msf tngp13.phx.gbl. ..[color=darkred]
        > > > Try setting the source the same way you would set a link in a web[/color][/color][/color]
        site:[color=blue][color=green][color=darkred]
        > > >
        > > > "codebehindfold er/WebForm2.aspx.v b"
        > > >
        > > > Or if the folder is back one folder from the .aspx file:
        > > >
        > > > "../codebehindfolde r/WebForm2.aspx.v b"
        > > >
        > > > Sincerely,
        > > >
        > > > --
        > > > S. Justin Gengo, MCP
        > > > Web Developer
        > > >
        > > > Free code library at:
        > > > www.aboutfortunate.com
        > > >
        > > > "Out of chaos comes order."
        > > > Nietzche
        > > >
        > > >
        > > > "Maurice Walmsley" <mbwalmsley@hot mail.com> wrote in message
        > > > news:922b3604.0 308191511.3e22c 972@posting.goo gle.com...
        > > > > hi, I hope someone can help me with this please
        > > > >
        > > > >
        > > > > I'm trying to move my codebehind files to a folder other than the[/color][/color][/color]
        one[color=blue][color=green][color=darkred]
        > > > > my webform sits in. I've tried changing the 'scr' page level[/color][/color][/color]
        attribute[color=blue][color=green][color=darkred]
        > > > > of my webform, but i get the following parser error;
        > > > >
        > > > > Parser Error Message: 'c:\WebForm2.as px.vb' is a physical path.
        > > > >
        > > > > this the code;
        > > > > <%@ Page Language="vb" AutoEventWireup ="false"
        > > > > src="c:\WebForm 2.aspx.vb" Inherits="mywor k"%>
        > > > >
        > > > >
        > > > > 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[/color][/color][/color]
        i[color=blue][color=green][color=darkred]
        > > > > move this codebehind file?
        > > > >
        > > > > many thanks
        > > > >
        > > > > m
        > > >
        > > >[/color]
        > >
        > >[/color]
        >
        >[/color]


        Comment

        • Maurice Walmsley

          #5
          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 parser error;
          "Cannot use a leading .. to exit above the top directory"

          I've tried absolute paths; [src="c:\WebForm 2.aspx.vb"], but get;
          "Parser Error Message: 'c:\WebForm2.as px.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.

          Comment

          • Xavier MT

            #6
            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" <mbwalmsley@hot mail.com> wrote in message
            news:922b3604.0 308191511.3e22c 972@posting.goo gle.com...[color=blue]
            > 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 parser error;
            >
            > Parser Error Message: 'c:\WebForm2.as px.vb' is a physical path.
            >
            > this the code;
            > <%@ Page Language="vb" AutoEventWireup ="false"
            > src="c:\WebForm 2.aspx.vb" Inherits="mywor k"%>
            >
            >
            > 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[/color]


            Comment

            • MS News \(MS ILM\)

              #7
              Re: codebehind files in different location

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

              "Xavier MT" <xmorera@hotmai l.com> wrote in message
              news:Oe9XtvAbDH A.736@TK2MSFTNG P09.phx.gbl...[color=blue]
              > 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" <mbwalmsley@hot mail.com> wrote in message
              > news:922b3604.0 308191511.3e22c 972@posting.goo gle.com...[color=green]
              > > 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 parser error;
              > >
              > > Parser Error Message: 'c:\WebForm2.as px.vb' is a physical path.
              > >
              > > this the code;
              > > <%@ Page Language="vb" AutoEventWireup ="false"
              > > src="c:\WebForm 2.aspx.vb" Inherits="mywor k"%>
              > >
              > >
              > > 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[/color]
              >
              >[/color]


              Comment

              Working...