By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,417 Members | 1,845 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,417 IT Pros & Developers. It's quick & easy.

code behind pages not supported

P: n/a
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

Nov 17 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Hello Dragan,
Check out the inline code section of this article.
303247 INFO: ASP.NET Code-Behind Model Overview
http://support.microsoft.com/?id=303247

Thank you,
John Soulis
Microsoft, ASP.NET

This posting is provided "AS IS", with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm

Nov 17 '05 #2

P: n/a
draganc wrote:
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.
If not can You tell me where to find free hosting that supports code
behind pages?

Sorry for bad english,
dragan


Nov 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.