How to use Codebehind?

How to use Codebehind?

Post by Christian- » Tue, 31 May 2005 23:54:23


I want to split my working ASP.NET page into HTML-file and JSL-file.

To handle this on an easy way, I donwloadet the Visual Web Developer
2005 Express Edition Beta 2 and installed it.

After that, I created a new Web-Project with two files. In the
login.aspx is only the HTML-Code from my old file. And I changed the
first line to this:

<%@ Page Language="VJ#" CodeFile="login.jsl" Inherits="login"%>

In the login.jsl is now a class with the name login, which has the
complete VJ#-Code from the old file.

But if I try now to build a web site (Build -> Build Web Site...), I
get the following errors:

Error 1 C:\Dokumente und Einstellungen\Christian\Eigene Dateien\Visual
Studio 2005\WebSites\WebSite2\login.jsl(5): error VJS1183:
Redeclaration of type 'login' declared in another source file /

Error 2 Redeclaration of type 'login' declared in another source file
C:\Dokumente und Einstellungen\Christian\Eigene Dateien\Visual Studio
2005\WebSites\WebSite2\login.jsl 5

Please can anoyone help me to correct this problem?

Thanks and greetings,

1. set screentip/tooltip in InfoPath using codebehind

2. Using Codebehind

Hi. I've just started my second ASP.NET (VB) app and I'm using
codebehind this time.

I'm not using visual studio but am instead coding it all in notepad

I'm trying to understand how to best use codebehind to do what I want
to achieve. Basically, so far I have a codebehind file for one page
which works as I wanted but I want other pages to share that
codebehind file. That's no problem except I want each one to use
there own Page_Load subroutine in the codebehind and to share some

The only way I think might work would be to use different classes
within the codebehind file. I did consider two codebehind files I
couldn't inherit them both. I'm not sure how the classes work exactly
and I have no idea if I can pass variables between them and call subs
from one class into another!

I'm really after some information on how to use the classes /
codebehind to allow me to have page specific subroutines and shared
subroutines within one or more codebehind file.

Any advice welcomed to help me learn this a bit better will be



----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==---- The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---

3. Calling a Javascript function using VB.NET Codebehind

4. Can I break a codebehind file up into two parts using partial

5. Keeping .ASPX pages PURE using C# Codebehind

6. using reflection in codebehind

7. Adding codebehind files to an app. developed using .net framework

8. C#: CodeBehind and Code Re-Use Using Inheritance in windows applications

9. VSS and VS.Net 2003 when using a common Asp.Net codebehind file

10. Codebehind in a web control. Can I use another assembly as codebehind?

11. Deleted Form's CodeBehind Still Exists - Can't Delete

12. Is there a CodeBehind concept?

13. javascript confirm in codebehind with C#

14. Adding "form runat server" from codebehind..

15. dynamically create multiple instances of usercontrol in codebehind