code behind pages not supported

  • Thread starter Thread starter draganc
  • Start date Start date
D

draganc

Hello,

I just want to test my application, and I want to upload it to
www.brinkster.com server, but free host version does not support
code behind pages.

Can Visual Studio make both the code and the html in one .aspx file,
and how can I do that?

If not can You tell me where to find free hosting that supports code
behind pages?

Sorry for bad english,
dragan
 
draganc said:
Hello,

I just want to test my application, and I want to upload it to
www.brinkster.com server, but free host version does not support
code behind pages.

Can Visual Studio make both the code and the html in one .aspx file,
and how can I do that?

Visual Studio won't help, but if you manually change the:

codebehind="whatever.aspx.cs"

attribute in the @Page directive of your aspx page to:

src="whatever.aspx.cs"

and upload the whatever.aspx.cs file to the same directory as the aspx
file, then the ASP.NET runtime should automatically compile your
codebehind source file the first time the page is accessed.

Alternatively, you can simply copy the contents of the whatever.aspx.cs
file into a code block in your aspx page:

<script runat="server" language="c#">
//
// copy the whatever.aspx.cs file contents here...
//
</script>

But that would require some significant massaging of the code in the
script block to get things to work.

Remember to perform a similar operation to the global.asax file(s) if
you need them, and remember that if you want to go back and forth using
VS.NET you'll be in for a world of pain.

Note that if your VS.NET WebForm project consists of multiple C# source
files and/or has .resx files, the effort to get the VS.NET project to
work in this situation increases - you might want to look for another
host or take a look at WebMatrix, which doesn't support code-behind.
 
Back
Top