473,545 Members | 1,924 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

SRC instead of CodeBehind

A.M
Hi,

Using VS.NET 2003, If i use SRC page attribute instead of CodeBehind, do i
still have intelisence and generally IDE support for that?

Thanks,
Ali
Nov 18 '05 #1
12 1739
Hi Richard,

Thank you for using Microsoft Newsgroup Service. As for the question you
mentioned, the "SRC" attribute and "CodeBehind " attribute of the <%@Page
...> Direction will specify different compile mode for the ASP.NET web
page. Also, that will cause quite different effect when designing the
page's binded class at design-time. Here is the description in the MSDN:

"CodeBehind " attribute:
Specifies the name of the compiled file that contains the class associated
with the page. This attribute is used by the Visual Studio .NET Web Forms
designer. It tells the designer where to find the page class so that the
designer can create an instance of it for you to work with at design time.
For example, if you create a Web Forms page in Visual Studio called
WebForm1, the designer will assign the Codebehind attribute the value of
WebForm1.aspx.v b, for Visual Basic, or WebForm1.aspx.c s, for C#. This
attribute is not used at run time.

"SRC" attribute:
Specifies the source file name of the code-behind class to dynamically
compile when the page is requested. You can choose to include programming
logic for your page either in a code-behind class or in a code declaration
block in the .aspx file.

Note RAD designers, such as Visual Studio .NET, do not use this
attribute. Instead, they precompile code-behind classes and then use the
Inherits attribute.

So if use "SRC" attribute, the IDE Designer won't get any of the page's
binded class info until the page is requested at runtime. Thus, when
designing the page class source, it will lose the intelisence and
generally IDE support for it.
Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Nov 18 '05 #2
A.M

Thanks Steven for help.

I underestand the best way to have IDE support is using code behind.

We like to use SRC because we can use notepad to change the codes
whenever/wherever we want and ASP.NET will take care of compilation; however
we also would like to have IDE support during the actual development.

To achive what we need can i develop my web application with CodeBehind page
attribute (to have IDE support during development) and right before
deployment change all CodeBehind page attribute to SRC ?

To re-phrase my question: If i develop my web application using CodeBehind
page attribute, can i change "CodeBehinf " to "SRC" and my pages get compiled
by ASP.NET? If the answer is no, then how can I convert a page from
"CodeBehind " model to "SRC" model ?

Thanks again,
Ali


"MSFT" <v-******@online.m icrosoft.com> wrote in message
news:dS******** ******@cpmsftng xa07.phx.gbl...
Hi Richard,

Thank you for using Microsoft Newsgroup Service. As for the question you
mentioned, the "SRC" attribute and "CodeBehind " attribute of the <%@Page
..> Direction will specify different compile mode for the ASP.NET web
page. Also, that will cause quite different effect when designing the
page's binded class at design-time. Here is the description in the MSDN:

"CodeBehind " attribute:
Specifies the name of the compiled file that contains the class associated
with the page. This attribute is used by the Visual Studio .NET Web Forms
designer. It tells the designer where to find the page class so that the
designer can create an instance of it for you to work with at design time.
For example, if you create a Web Forms page in Visual Studio called
WebForm1, the designer will assign the Codebehind attribute the value of
WebForm1.aspx.v b, for Visual Basic, or WebForm1.aspx.c s, for C#. This
attribute is not used at run time.

"SRC" attribute:
Specifies the source file name of the code-behind class to dynamically
compile when the page is requested. You can choose to include programming
logic for your page either in a code-behind class or in a code declaration
block in the .aspx file.

Note RAD designers, such as Visual Studio .NET, do not use this
attribute. Instead, they precompile code-behind classes and then use the
Inherits attribute.

So if use "SRC" attribute, the IDE Designer won't get any of the page's
binded class info until the page is requested at runtime. Thus, when
designing the page class source, it will lose the intelisence and
generally IDE support for it.
Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Nov 18 '05 #3
You don't want to CHANGE "CodeBehind " to "Src" - you want to use BOTH.
"CodeBehind " tells the VS.Net IDE where to find the CodeBehind file at
design-time. "Src" tells your ASP.Net Page Template where to find it at
run-time.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"A.M" <IH*******@sapm 123.com> wrote in message
news:O2******** ******@TK2MSFTN GP09.phx.gbl...

Thanks Steven for help.

I underestand the best way to have IDE support is using code behind.

We like to use SRC because we can use notepad to change the codes
whenever/wherever we want and ASP.NET will take care of compilation; however we also would like to have IDE support during the actual development.

To achive what we need can i develop my web application with CodeBehind page attribute (to have IDE support during development) and right before
deployment change all CodeBehind page attribute to SRC ?

To re-phrase my question: If i develop my web application using CodeBehind
page attribute, can i change "CodeBehinf " to "SRC" and my pages get compiled by ASP.NET? If the answer is no, then how can I convert a page from
"CodeBehind " model to "SRC" model ?

Thanks again,
Ali


"MSFT" <v-******@online.m icrosoft.com> wrote in message
news:dS******** ******@cpmsftng xa07.phx.gbl...
Hi Richard,

Thank you for using Microsoft Newsgroup Service. As for the question you
mentioned, the "SRC" attribute and "CodeBehind " attribute of the <%@Page
..> Direction will specify different compile mode for the ASP.NET web
page. Also, that will cause quite different effect when designing the
page's binded class at design-time. Here is the description in the MSDN:

"CodeBehind " attribute:
Specifies the name of the compiled file that contains the class associated with the page. This attribute is used by the Visual Studio .NET Web Forms designer. It tells the designer where to find the page class so that the
designer can create an instance of it for you to work with at design time. For example, if you create a Web Forms page in Visual Studio called
WebForm1, the designer will assign the Codebehind attribute the value of
WebForm1.aspx.v b, for Visual Basic, or WebForm1.aspx.c s, for C#. This
attribute is not used at run time.

"SRC" attribute:
Specifies the source file name of the code-behind class to dynamically
compile when the page is requested. You can choose to include programming logic for your page either in a code-behind class or in a code declaration block in the .aspx file.

Note RAD designers, such as Visual Studio .NET, do not use this
attribute. Instead, they precompile code-behind classes and then use the
Inherits attribute.

So if use "SRC" attribute, the IDE Designer won't get any of the page's
binded class info until the page is requested at runtime. Thus, when
designing the page class source, it will lose the intelisence and
generally IDE support for it.
Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)


Nov 18 '05 #4
I am curious. I have tried using both but I get runtime errors for ambiguous
names. Am I doing something wrong?
Mike

"Kevin Spencer" <ke***@takempis .com> wrote in message
news:Oi******** ******@tk2msftn gp13.phx.gbl...
You don't want to CHANGE "CodeBehind " to "Src" - you want to use BOTH.
"CodeBehind " tells the VS.Net IDE where to find the CodeBehind file at
design-time. "Src" tells your ASP.Net Page Template where to find it at
run-time.

--
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"A.M" <IH*******@sapm 123.com> wrote in message
news:O2******** ******@TK2MSFTN GP09.phx.gbl...

Thanks Steven for help.

I underestand the best way to have IDE support is using code behind.

We like to use SRC because we can use notepad to change the codes
whenever/wherever we want and ASP.NET will take care of compilation;

however
we also would like to have IDE support during the actual development.

To achive what we need can i develop my web application with CodeBehind

page
attribute (to have IDE support during development) and right before
deployment change all CodeBehind page attribute to SRC ?

To re-phrase my question: If i develop my web application using CodeBehind
page attribute, can i change "CodeBehinf " to "SRC" and my pages get

compiled
by ASP.NET? If the answer is no, then how can I convert a page from
"CodeBehind " model to "SRC" model ?

Thanks again,
Ali


"MSFT" <v-******@online.m icrosoft.com> wrote in message
news:dS******** ******@cpmsftng xa07.phx.gbl...
Hi Richard,

Thank you for using Microsoft Newsgroup Service. As for the question you mentioned, the "SRC" attribute and "CodeBehind " attribute of the <%@Page ..> Direction will specify different compile mode for the ASP.NET web
page. Also, that will cause quite different effect when designing the
page's binded class at design-time. Here is the description in the MSDN:
"CodeBehind " attribute:
Specifies the name of the compiled file that contains the class

associated with the page. This attribute is used by the Visual Studio .NET Web Forms designer. It tells the designer where to find the page class so that the designer can create an instance of it for you to work with at design time. For example, if you create a Web Forms page in Visual Studio called
WebForm1, the designer will assign the Codebehind attribute the value of WebForm1.aspx.v b, for Visual Basic, or WebForm1.aspx.c s, for C#. This
attribute is not used at run time.

"SRC" attribute:
Specifies the source file name of the code-behind class to dynamically
compile when the page is requested. You can choose to include programming logic for your page either in a code-behind class or in a code declaration block in the .aspx file.

Note RAD designers, such as Visual Studio .NET, do not use this
attribute. Instead, they precompile code-behind classes and then use the Inherits attribute.

So if use "SRC" attribute, the IDE Designer won't get any of the page's binded class info until the page is requested at runtime. Thus, when
designing the page class source, it will lose the intelisence and
generally IDE support for it.
Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)



Nov 18 '05 #5
A.M

I didn't know that i can have both. If what you are saying is possible then
that would be greate, so i can develop/debug in VS.NET and after deployment
(both .aspx and .aspx.vb files and no dll files) i can edit .aspx.vb files
with notepad upon any intsant cahnge requirements.

I tried having CodeBehind and SRC both together, it didn't worked. am i
missing something ?

Thanks for help,
Ali

"Kevin Spencer" <ke***@takempis .com> wrote in message
news:Oi******** ******@tk2msftn gp13.phx.gbl...
You don't want to CHANGE "CodeBehind " to "Src" - you want to use BOTH.
"CodeBehind " tells the VS.Net IDE where to find the CodeBehind file at
design-time. "Src" tells your ASP.Net Page Template where to find it at
run-time.

--
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"A.M" <IH*******@sapm 123.com> wrote in message
news:O2******** ******@TK2MSFTN GP09.phx.gbl...

Thanks Steven for help.

I underestand the best way to have IDE support is using code behind.

We like to use SRC because we can use notepad to change the codes
whenever/wherever we want and ASP.NET will take care of compilation;

however
we also would like to have IDE support during the actual development.

To achive what we need can i develop my web application with CodeBehind

page
attribute (to have IDE support during development) and right before
deployment change all CodeBehind page attribute to SRC ?

To re-phrase my question: If i develop my web application using CodeBehind
page attribute, can i change "CodeBehinf " to "SRC" and my pages get

compiled
by ASP.NET? If the answer is no, then how can I convert a page from
"CodeBehind " model to "SRC" model ?

Thanks again,
Ali


"MSFT" <v-******@online.m icrosoft.com> wrote in message
news:dS******** ******@cpmsftng xa07.phx.gbl...
Hi Richard,

Thank you for using Microsoft Newsgroup Service. As for the question you mentioned, the "SRC" attribute and "CodeBehind " attribute of the <%@Page ..> Direction will specify different compile mode for the ASP.NET web
page. Also, that will cause quite different effect when designing the
page's binded class at design-time. Here is the description in the MSDN:
"CodeBehind " attribute:
Specifies the name of the compiled file that contains the class

associated with the page. This attribute is used by the Visual Studio .NET Web Forms designer. It tells the designer where to find the page class so that the designer can create an instance of it for you to work with at design time. For example, if you create a Web Forms page in Visual Studio called
WebForm1, the designer will assign the Codebehind attribute the value of WebForm1.aspx.v b, for Visual Basic, or WebForm1.aspx.c s, for C#. This
attribute is not used at run time.

"SRC" attribute:
Specifies the source file name of the code-behind class to dynamically
compile when the page is requested. You can choose to include programming logic for your page either in a code-behind class or in a code declaration block in the .aspx file.

Note RAD designers, such as Visual Studio .NET, do not use this
attribute. Instead, they precompile code-behind classes and then use the Inherits attribute.

So if use "SRC" attribute, the IDE Designer won't get any of the page's binded class info until the page is requested at runtime. Thus, when
designing the page class source, it will lose the intelisence and
generally IDE support for it.
Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)



Nov 18 '05 #6
A.M
I am having same problem too.

"vMike" <Mi************ @nospam.gewarre n.com.delete> wrote in message
news:br******** **@ngspool-d02.news.aol.co m...
I am curious. I have tried using both but I get runtime errors for ambiguous names. Am I doing something wrong?
Mike

"Kevin Spencer" <ke***@takempis .com> wrote in message
news:Oi******** ******@tk2msftn gp13.phx.gbl...
You don't want to CHANGE "CodeBehind " to "Src" - you want to use BOTH.
"CodeBehind " tells the VS.Net IDE where to find the CodeBehind file at
design-time. "Src" tells your ASP.Net Page Template where to find it at
run-time.

--
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"A.M" <IH*******@sapm 123.com> wrote in message
news:O2******** ******@TK2MSFTN GP09.phx.gbl...

Thanks Steven for help.

I underestand the best way to have IDE support is using code behind.

We like to use SRC because we can use notepad to change the codes
whenever/wherever we want and ASP.NET will take care of compilation; however
we also would like to have IDE support during the actual development.

To achive what we need can i develop my web application with CodeBehind
page
attribute (to have IDE support during development) and right before
deployment change all CodeBehind page attribute to SRC ?

To re-phrase my question: If i develop my web application using CodeBehind page attribute, can i change "CodeBehinf " to "SRC" and my pages get

compiled
by ASP.NET? If the answer is no, then how can I convert a page from
"CodeBehind " model to "SRC" model ?

Thanks again,
Ali


"MSFT" <v-******@online.m icrosoft.com> wrote in message
news:dS******** ******@cpmsftng xa07.phx.gbl...
> Hi Richard,
>
> Thank you for using Microsoft Newsgroup Service. As for the question you > mentioned, the "SRC" attribute and "CodeBehind " attribute of the <%@Page > ..> Direction will specify different compile mode for the ASP.NET
web > page. Also, that will cause quite different effect when designing the > page's binded class at design-time. Here is the description in the

MSDN: >
> "CodeBehind " attribute:
> Specifies the name of the compiled file that contains the class

associated
> with the page. This attribute is used by the Visual Studio .NET Web

Forms
> designer. It tells the designer where to find the page class so that the > designer can create an instance of it for you to work with at design

time.
> For example, if you create a Web Forms page in Visual Studio called
> WebForm1, the designer will assign the Codebehind attribute the value of
> WebForm1.aspx.v b, for Visual Basic, or WebForm1.aspx.c s, for C#.
This > attribute is not used at run time.
>
> "SRC" attribute:
> Specifies the source file name of the code-behind class to dynamically > compile when the page is requested. You can choose to include

programming
> logic for your page either in a code-behind class or in a code

declaration
> block in the .aspx file.
>
> Note RAD designers, such as Visual Studio .NET, do not use this
> attribute. Instead, they precompile code-behind classes and then use

the > Inherits attribute.
>
> So if use "SRC" attribute, the IDE Designer won't get any of the page's > binded class info until the page is requested at runtime. Thus, when
> designing the page class source, it will lose the intelisence and
> generally IDE support for it.
>
>
> Steven Cheng
> Microsoft Online Support
>
> Get Secure! www.microsoft.com/security
> (This posting is provided "AS IS", with no warranties, and confers no > rights.)
>



Nov 18 '05 #7
> I am curious. I have tried using both but I get runtime errors for
ambiguous
names. Am I doing something wrong?
Obviously, yes. However, since you provided no detailed information about
what you did, or what the error messages were, that's all I can tell you.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"vMike" <Mi************ @nospam.gewarre n.com.delete> wrote in message
news:br******** **@ngspool-d02.news.aol.co m... I am curious. I have tried using both but I get runtime errors for ambiguous names. Am I doing something wrong?
Mike

"Kevin Spencer" <ke***@takempis .com> wrote in message
news:Oi******** ******@tk2msftn gp13.phx.gbl...
You don't want to CHANGE "CodeBehind " to "Src" - you want to use BOTH.
"CodeBehind " tells the VS.Net IDE where to find the CodeBehind file at
design-time. "Src" tells your ASP.Net Page Template where to find it at
run-time.

--
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"A.M" <IH*******@sapm 123.com> wrote in message
news:O2******** ******@TK2MSFTN GP09.phx.gbl...

Thanks Steven for help.

I underestand the best way to have IDE support is using code behind.

We like to use SRC because we can use notepad to change the codes
whenever/wherever we want and ASP.NET will take care of compilation; however
we also would like to have IDE support during the actual development.

To achive what we need can i develop my web application with CodeBehind
page
attribute (to have IDE support during development) and right before
deployment change all CodeBehind page attribute to SRC ?

To re-phrase my question: If i develop my web application using CodeBehind page attribute, can i change "CodeBehinf " to "SRC" and my pages get

compiled
by ASP.NET? If the answer is no, then how can I convert a page from
"CodeBehind " model to "SRC" model ?

Thanks again,
Ali


"MSFT" <v-******@online.m icrosoft.com> wrote in message
news:dS******** ******@cpmsftng xa07.phx.gbl...
> Hi Richard,
>
> Thank you for using Microsoft Newsgroup Service. As for the question you > mentioned, the "SRC" attribute and "CodeBehind " attribute of the <%@Page > ..> Direction will specify different compile mode for the ASP.NET
web > page. Also, that will cause quite different effect when designing the > page's binded class at design-time. Here is the description in the

MSDN: >
> "CodeBehind " attribute:
> Specifies the name of the compiled file that contains the class

associated
> with the page. This attribute is used by the Visual Studio .NET Web

Forms
> designer. It tells the designer where to find the page class so that the > designer can create an instance of it for you to work with at design

time.
> For example, if you create a Web Forms page in Visual Studio called
> WebForm1, the designer will assign the Codebehind attribute the value of
> WebForm1.aspx.v b, for Visual Basic, or WebForm1.aspx.c s, for C#.
This > attribute is not used at run time.
>
> "SRC" attribute:
> Specifies the source file name of the code-behind class to dynamically > compile when the page is requested. You can choose to include

programming
> logic for your page either in a code-behind class or in a code

declaration
> block in the .aspx file.
>
> Note RAD designers, such as Visual Studio .NET, do not use this
> attribute. Instead, they precompile code-behind classes and then use

the > Inherits attribute.
>
> So if use "SRC" attribute, the IDE Designer won't get any of the page's > binded class info until the page is requested at runtime. Thus, when
> designing the page class source, it will lose the intelisence and
> generally IDE support for it.
>
>
> Steven Cheng
> Microsoft Online Support
>
> Get Secure! www.microsoft.com/security
> (This posting is provided "AS IS", with no warranties, and confers no > rights.)
>



Nov 18 '05 #8
> I tried having CodeBehind and SRC both together, it didn't worked. am i
missing something ?
Yup. But since you provided no details about exactly what you did and
exactly what the resulting behavior was, that's all I can tell you.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"A.M" <IH*******@sapm 123.com> wrote in message
news:O8******** ******@TK2MSFTN GP12.phx.gbl...
I didn't know that i can have both. If what you are saying is possible then that would be greate, so i can develop/debug in VS.NET and after deployment (both .aspx and .aspx.vb files and no dll files) i can edit .aspx.vb files
with notepad upon any intsant cahnge requirements.

I tried having CodeBehind and SRC both together, it didn't worked. am i
missing something ?

Thanks for help,
Ali

"Kevin Spencer" <ke***@takempis .com> wrote in message
news:Oi******** ******@tk2msftn gp13.phx.gbl...
You don't want to CHANGE "CodeBehind " to "Src" - you want to use BOTH.
"CodeBehind " tells the VS.Net IDE where to find the CodeBehind file at
design-time. "Src" tells your ASP.Net Page Template where to find it at
run-time.

--
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"A.M" <IH*******@sapm 123.com> wrote in message
news:O2******** ******@TK2MSFTN GP09.phx.gbl...

Thanks Steven for help.

I underestand the best way to have IDE support is using code behind.

We like to use SRC because we can use notepad to change the codes
whenever/wherever we want and ASP.NET will take care of compilation; however
we also would like to have IDE support during the actual development.

To achive what we need can i develop my web application with CodeBehind
page
attribute (to have IDE support during development) and right before
deployment change all CodeBehind page attribute to SRC ?

To re-phrase my question: If i develop my web application using CodeBehind page attribute, can i change "CodeBehinf " to "SRC" and my pages get

compiled
by ASP.NET? If the answer is no, then how can I convert a page from
"CodeBehind " model to "SRC" model ?

Thanks again,
Ali


"MSFT" <v-******@online.m icrosoft.com> wrote in message
news:dS******** ******@cpmsftng xa07.phx.gbl...
> Hi Richard,
>
> Thank you for using Microsoft Newsgroup Service. As for the question you > mentioned, the "SRC" attribute and "CodeBehind " attribute of the <%@Page > ..> Direction will specify different compile mode for the ASP.NET
web > page. Also, that will cause quite different effect when designing the > page's binded class at design-time. Here is the description in the

MSDN: >
> "CodeBehind " attribute:
> Specifies the name of the compiled file that contains the class

associated
> with the page. This attribute is used by the Visual Studio .NET Web

Forms
> designer. It tells the designer where to find the page class so that the > designer can create an instance of it for you to work with at design

time.
> For example, if you create a Web Forms page in Visual Studio called
> WebForm1, the designer will assign the Codebehind attribute the value of
> WebForm1.aspx.v b, for Visual Basic, or WebForm1.aspx.c s, for C#.
This > attribute is not used at run time.
>
> "SRC" attribute:
> Specifies the source file name of the code-behind class to dynamically > compile when the page is requested. You can choose to include

programming
> logic for your page either in a code-behind class or in a code

declaration
> block in the .aspx file.
>
> Note RAD designers, such as Visual Studio .NET, do not use this
> attribute. Instead, they precompile code-behind classes and then use

the > Inherits attribute.
>
> So if use "SRC" attribute, the IDE Designer won't get any of the page's > binded class info until the page is requested at runtime. Thus, when
> designing the page class source, it will lose the intelisence and
> generally IDE support for it.
>
>
> Steven Cheng
> Microsoft Online Support
>
> Get Secure! www.microsoft.com/security
> (This posting is provided "AS IS", with no warranties, and confers no > rights.)
>



Nov 18 '05 #9
vMike wrote:
I am curious. I have tried using both but I get runtime errors for ambiguous
names. Am I doing something wrong?
The problem is probably this:

VS.NET compiles your codebehind source into an assembly, which gets
deployed into the ASPX application's bin directory.

When you first load the page in the browser, the ASP.NET runtime sees
the src attribute and compiles that file into another assembly, which it
makes available for use by the app. Now when the parsed ASPX page is
compiled, it references both assemblies which have different classes
defined with the same name (the classes are different even though they
are compiled from the same code because they are in different assemblies).

You might be able to get the result you want by manually deleting from
the bin directory the assembly that VS.NET builds (maybe a custom build
step can handle that for you).

However, I predict that doing what you want to do will cause you major
pain if you use VS.NET.
Mike

"Kevin Spencer" <ke***@takempis .com> wrote in message
news:Oi******** ******@tk2msftn gp13.phx.gbl...
You don't want to CHANGE "CodeBehind " to "Src" - you want to use BOTH.
"CodeBehind " tells the VS.Net IDE where to find the CodeBehind file at
design-time. "Src" tells your ASP.Net Page Template where to find it at
run-time.

--
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"A.M" <IH*******@sapm 123.com> wrote in message
news:O2****** ********@TK2MSF TNGP09.phx.gbl. ..
Thanks Steven for help.

I underestand the best way to have IDE support is using code behind.

We like to use SRC because we can use notepad to change the codes
whenever/wherever we want and ASP.NET will take care of compilation;


however
we also would like to have IDE support during the actual development.

To achive what we need can i develop my web application with CodeBehind


page
attribute (to have IDE support during development) and right before
deployment change all CodeBehind page attribute to SRC ?

To re-phrase my question: If i develop my web application using
CodeBehind
page attribute, can i change "CodeBehinf " to "SRC" and my pages get


compiled
by ASP.NET? If the answer is no, then how can I convert a page from
"CodeBehin d" model to "SRC" model ?

Thanks again,
Ali


"MSFT" <v-******@online.m icrosoft.com> wrote in message
news:dS***** *********@cpmsf tngxa07.phx.gbl ...

Hi Richard,

Thank you for using Microsoft Newsgroup Service. As for the question
you
mentioned , the "SRC" attribute and "CodeBehind " attribute of the
<%@Page
..> Direction will specify different compile mode for the ASP.NET web
page. Also, that will cause quite different effect when designing the
page's binded class at design-time. Here is the description in the
MSDN:
"CodeBehind " attribute:
Specifies the name of the compiled file that contains the class


associated
with the page. This attribute is used by the Visual Studio .NET Web


Forms
designer. It tells the designer where to find the page class so that
the
designer can create an instance of it for you to work with at design


time.
For example, if you create a Web Forms page in Visual Studio called
WebForm1, the designer will assign the Codebehind attribute the value
of
WebForm1.as px.vb, for Visual Basic, or WebForm1.aspx.c s, for C#. This
attribute is not used at run time.

"SRC" attribute:
Specifies the source file name of the code-behind class to dynamically
compile when the page is requested. You can choose to include


programming
logic for your page either in a code-behind class or in a code


declaration
block in the .aspx file.

Note RAD designers, such as Visual Studio .NET, do not use this
attribute . Instead, they precompile code-behind classes and then use
the
Inherits attribute.

So if use "SRC" attribute, the IDE Designer won't get any of the
page's
binded class info until the page is requested at runtime. Thus, when
designing the page class source, it will lose the intelisence and
generally IDE support for it.
Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)



--
mikeb
Nov 18 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2877
by: Graham Allwood | last post by:
I'm reading the Essential ASP.NET book by Fritz onion and he says that when VS.NET creates a new .aspx page for you is uses the codebehind attribute on the Page directive rather than the src attribute. From what I understand the src attrib is standard ASP.NET but the codebehind attribute is only understood by VS.NET. Doesn't this make the...
6
2840
by: Thomas Connolly | last post by:
I have 2 pages referencing the same codebehind file in my project. Originally the pages referenced separate code behind files. Once I changed the reference to the same file, everything worked fine while the file was in the project directory. When the obsolete file was removed from the project directory, my application will no longer...
12
1631
by: Karl Hungus | last post by:
If I use a code behind class for an aspx page, what is the best way to get data from the codebehind class into my aspx page? I know about databinding, but is there a more basic way of just referencing the variables or calling getters? thanks in advance
3
238
by: jm | last post by:
I have a question about codebehind. I have an upload namespace, class and all in a codebehind. I currently have it so it works with one of my .aspx pages. I want to use it for another .aspx page. The problem is that they codebehind looks at a specific directory (since it was only being used by one page). I need it to decide which...
4
1384
by: darrel | last post by:
I have a contact form that a person submits to the server. In ASP, you'd make a page, post the form to another page, which would grab the values and do somethign with them. in ASP.NET, it appears that you grab the values directly from the form objects on the postback. Here's our problem:
7
2213
by: Jack | last post by:
Hello, What is the difference between SRC and CODEBEHIND Tags? Example <%@ Page Language="vb" ValidateRequest="false" AutoEventWireup="false" Codebehind="WebForm1.aspx.vb" %> or
1
2516
by: Randall Parker | last post by:
Using VS 2003 and Cassini web server. I'm new to ASP.Net and so this may be a dumb question. I'm getting an error where the type 'FarmLand.WebForm1' is not found. The Codebehind C# source file declares a namespace of FarmLand and a class of WebForm1. Does one have to restrict which namespace one uses in Codebehind forms? Maybe match the...
6
1551
by: antonyliu2002 | last post by:
Right now I put my VB code in the aspx pages. I would prefer to use codebehind, especially many of my VB functions may be shared across multiple aspx pages. I've tried a few pages with codebehind by follwing some examples on the Web and they work just fine. However, I am scared away from codebehind by such extenstions as "Handles...
6
7933
by: WT | last post by:
Hello, I am searching for a way to generate automatically from codebehind the <!Doctype....for asp.net pages using .net 3.5 c# and vs2008. Subidiary question: if I do a server transfert in my codebehind, do I need any Doctype or html tags in the page ? Thanks CS
0
7668
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7923
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7773
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5984
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5343
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3466
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3448
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1025
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
722
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.