|
|
|
start date: Wed, 22 Aug 2007 07:26:05 -0700,
posted on: microsoft.public.dotnet.framework.aspnet
back
| Thread Index |
|
1
WebBuilder451
|
|
2
Patrice http://www.chez.com/scribe/
|
|
3
WebBuilder451
|
|
4
Patrice http://www.chez.com/scribe/
|
|
5
WebBuilder451
|
|
6
Patrice http://www.chez.com/scribe/
|
|
7
WebBuilder451
|
|
8
Juan T. Llibre
|
|
9
WebBuilder451
|
|
10
Mark Rae [MVP]
|
|
11
WebBuilder451
|
|
12
Juan T. Llibre
|
|
13
Mark Rae [MVP]
|
|
14
WebBuilder451
|
|
15
WebBuilder451
|
|
16
WebBuilder451
|
|
17
Evan M.
|
|
18
Damien
|
|
19
Evan M.
|
VB vs C# question (trying to switch languages)
I'm trying to make the jump from VB to C#. Aside from the syntax issues i'm
running into some execution differences i think
1. I created a C# page in an existing VB.net website
2. I added a gridview with a footer row
3. i attempted to change the value of a label in the footer row on row
databound using:
protected void gv_catalog_RowDataBound(object sender,
System.Web.UI.WebControls.GridViewRowEventArgs e)
{
if ((e.Row.RowType == DataControlRowType.Footer))
{
Label lbl =
(Label)this.gv_catalog.FooterRow.FindControl("lbl_OrderTotal");
lbl.Text = "total go here";
lbl.Font.Bold = true;
}
}
Note: I can get it to change in the page_load, but my point is it does not
appear that the gv_catalog_RowDataBound event is firing.
Questions:
1. Is there something else i need to do to get this even to fire?
2. I noticed that Intelesense does not work, i see items grayed out, but not
selectable.
--
thanks (as always)
some day i''m gona pay this forum back for all the help i''m getting
kes
Date:Wed, 22 Aug 2007 07:26:05 -0700
Author:
|
Re: VB vs C# question (trying to switch languages)
AFAIK using both languages in the same web application is not supported (IMO
may work, may not work depending on the deployment option etc you are
using).
In your case it's likely a problme with the AutoEventWriteUp attribute that
is false for VB.NET and true in C# projects. You may want to set this valeu
to true...
See http://odetocode.com/Blogs/scott/archive/2006/02/16/2914.aspx for
details.
---
Patrice
"WebBuilder451" a crit dans le
message de news: 8329B69B-F054-4098-B2E7-1454AD5FB780@microsoft.com...
> I'm trying to make the jump from VB to C#. Aside from the syntax issues
> i'm
> running into some execution differences i think
> 1. I created a C# page in an existing VB.net website
> 2. I added a gridview with a footer row
> 3. i attempted to change the value of a label in the footer row on row
> databound using:
> protected void gv_catalog_RowDataBound(object sender,
> System.Web.UI.WebControls.GridViewRowEventArgs e)
> {
> if ((e.Row.RowType == DataControlRowType.Footer))
> {
> Label lbl =
> (Label)this.gv_catalog.FooterRow.FindControl("lbl_OrderTotal");
> lbl.Text = "total go here";
> lbl.Font.Bold = true;
> }
> }
> Note: I can get it to change in the page_load, but my point is it does not
> appear that the gv_catalog_RowDataBound event is firing.
>
> Questions:
> 1. Is there something else i need to do to get this even to fire?
> 2. I noticed that Intelesense does not work, i see items grayed out, but
> not
> selectable.
>
> --
> thanks (as always)
> some day i''m gona pay this forum back for all the help i''m getting
> kes
Date:Wed, 22 Aug 2007 16:37:04 +0200
Author:
|
Re: VB vs C# question (trying to switch languages)
it was set to true. so this is odd, unless it's a mixed code issue.
i did notice from the article you referencd that "Note: C# doesn’t make the
dropdown list of events available when editing a code-beside file, but the
dropdown is available when writing in-line code. "
Why is that?, i'd think it would code seperation would be encourged es in
C#! I'd hate to think i'll need to use in-line code sections to get the tools
available in VS.
--
thanks (as always)
some day i''m gona pay this forum back for all the help i''m getting
kes
"Patrice" wrote:
> AFAIK using both languages in the same web application is not supported (IMO
> may work, may not work depending on the deployment option etc you are
> using).
>
> In your case it's likely a problme with the AutoEventWriteUp attribute that
> is false for VB.NET and true in C# projects. You may want to set this valeu
> to true...
>
> See http://odetocode.com/Blogs/scott/archive/2006/02/16/2914.aspx for
> details.
>
> ---
> Patrice
>
> "WebBuilder451" a écrit dans le
> message de news: 8329B69B-F054-4098-B2E7-1454AD5FB780@microsoft.com...
> > I'm trying to make the jump from VB to C#. Aside from the syntax issues
> > i'm
> > running into some execution differences i think
> > 1. I created a C# page in an existing VB.net website
> > 2. I added a gridview with a footer row
> > 3. i attempted to change the value of a label in the footer row on row
> > databound using:
> > protected void gv_catalog_RowDataBound(object sender,
> > System.Web.UI.WebControls.GridViewRowEventArgs e)
> > {
> > if ((e.Row.RowType == DataControlRowType.Footer))
> > {
> > Label lbl =
> > (Label)this.gv_catalog.FooterRow.FindControl("lbl_OrderTotal");
> > lbl.Text = "total go here";
> > lbl.Font.Bold = true;
> > }
> > }
> > Note: I can get it to change in the page_load, but my point is it does not
> > appear that the gv_catalog_RowDataBound event is firing.
> >
> > Questions:
> > 1. Is there something else i need to do to get this even to fire?
> > 2. I noticed that Intelesense does not work, i see items grayed out, but
> > not
> > selectable.
> >
> > --
> > thanks (as always)
> > some day i''m gona pay this forum back for all the help i''m getting
> > kes
>
>
>
Date:Wed, 22 Aug 2007 08:22:02 -0700
Author:
|
Re: VB vs C# question (trying to switch languages)
re:
!> AFAIK using both languages in the same web application is not supported
Yes, it is supported.
You have to create a couple of subdirectories of the App_Code directory,
one for each language, and declare those directories in your web.config.
<configuration>
<system.web>
<compilation debug="false">
<codeSubDirectories>
<add directoryName="VB"/>
<add directoryName="CS"/>
</codeSubDirectories>
</compilation>
</system.web>
</configuration>
Then, creating the App_Code\VB and App_Code\CS directories,
and placing your VB and CS files in each, will allow you to use both languages in your app.
This only works in ASP.NET 2.0! ( and is quite easy to implement )
Caveat: this works only for "helper classes".
You cannot place code-behind pages in the individual language directories.
However, it *does* allow you to mix different-language source files in the same app,
and it does allow you to call classes/methods/properties in different languages.
An alternative would be to compile your different-language source files
from the command-line, and placing the compiled assemblies in /bin.
Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaol : http://asp.net.do/foros/
======================================
"Patrice" <http://www.chez.com/scribe/> wrote in message news:%234XwqnM5HHA.5844@TK2MSFTNGP02.phx.gbl...
> AFAIK using both languages in the same web application is not supported (IMO may work, may not work depending on the
> deployment option etc you are using).
>
> In your case it's likely a problme with the AutoEventWriteUp attribute that is false for VB.NET and true in C#
> projects. You may want to set this valeu to true...
>
> See http://odetocode.com/Blogs/scott/archive/2006/02/16/2914.aspx for details.
>
> ---
> Patrice
>
> "WebBuilder451" a crit dans le message de news:
> 8329B69B-F054-4098-B2E7-1454AD5FB780@microsoft.com...
>> I'm trying to make the jump from VB to C#. Aside from the syntax issues i'm
>> running into some execution differences i think
>> 1. I created a C# page in an existing VB.net website
>> 2. I added a gridview with a footer row
>> 3. i attempted to change the value of a label in the footer row on row
>> databound using:
>> protected void gv_catalog_RowDataBound(object sender,
>> System.Web.UI.WebControls.GridViewRowEventArgs e)
>> {
>> if ((e.Row.RowType == DataControlRowType.Footer))
>> {
>> Label lbl =
>> (Label)this.gv_catalog.FooterRow.FindControl("lbl_OrderTotal");
>> lbl.Text = "total go here";
>> lbl.Font.Bold = true;
>> }
>> }
>> Note: I can get it to change in the page_load, but my point is it does not
>> appear that the gv_catalog_RowDataBound event is firing.
>>
>> Questions:
>> 1. Is there something else i need to do to get this even to fire?
>> 2. I noticed that Intelesense does not work, i see items grayed out, but not
>> selectable.
>>
>> --
>> thanks (as always)
>> some day i''m gona pay this forum back for all the help i''m getting
>> kes
>
>
Date:Wed, 22 Aug 2007 12:38:01 -0400
Author:
|
Re: VB vs C# question (trying to switch languages)
Historical reasons maybe. They 'll probably catch up in the future ?
So for now you could perhaps try to programmaticaly check if the event
handler is wired ? Try also perhaps to start a new project just to see if
you have the same behavior... Is this a page in the same dir than other
VB.NET pages etc...
Note also Juan response. This is actually supported despite a caveat....
Good luck and please let us know...
---
Patrice
"WebBuilder451" a crit dans le
message de news: DEF3F084-87F0-47CE-BE85-F4B7E0BAA15F@microsoft.com...
> it was set to true. so this is odd, unless it's a mixed code issue.
> i did notice from the article you referencd that "Note: C# doesn't make
> the
> dropdown list of events available when editing a code-beside file, but the
> dropdown is available when writing in-line code. "
>
> Why is that?, i'd think it would code seperation would be encourged es in
> C#! I'd hate to think i'll need to use in-line code sections to get the
> tools
> available in VS.
>
>
> --
> thanks (as always)
> some day i''m gona pay this forum back for all the help i''m getting
> kes
>
>
> "Patrice" wrote:
>
>> AFAIK using both languages in the same web application is not supported
>> (IMO
>> may work, may not work depending on the deployment option etc you are
>> using).
>>
>> In your case it's likely a problme with the AutoEventWriteUp attribute
>> that
>> is false for VB.NET and true in C# projects. You may want to set this
>> valeu
>> to true...
>>
>> See http://odetocode.com/Blogs/scott/archive/2006/02/16/2914.aspx for
>> details.
>>
>> ---
>> Patrice
>>
>> "WebBuilder451" a crit dans le
>> message de news: 8329B69B-F054-4098-B2E7-1454AD5FB780@microsoft.com...
>> > I'm trying to make the jump from VB to C#. Aside from the syntax issues
>> > i'm
>> > running into some execution differences i think
>> > 1. I created a C# page in an existing VB.net website
>> > 2. I added a gridview with a footer row
>> > 3. i attempted to change the value of a label in the footer row on row
>> > databound using:
>> > protected void gv_catalog_RowDataBound(object sender,
>> > System.Web.UI.WebControls.GridViewRowEventArgs e)
>> > {
>> > if ((e.Row.RowType == DataControlRowType.Footer))
>> > {
>> > Label lbl =
>> > (Label)this.gv_catalog.FooterRow.FindControl("lbl_OrderTotal");
>> > lbl.Text = "total go here";
>> > lbl.Font.Bold = true;
>> > }
>> > }
>> > Note: I can get it to change in the page_load, but my point is it does
>> > not
>> > appear that the gv_catalog_RowDataBound event is firing.
>> >
>> > Questions:
>> > 1. Is there something else i need to do to get this even to fire?
>> > 2. I noticed that Intelesense does not work, i see items grayed out,
>> > but
>> > not
>> > selectable.
>> >
>> > --
>> > thanks (as always)
>> > some day i''m gona pay this forum back for all the help i''m getting
>> > kes
>>
>>
>>
Date:Wed, 22 Aug 2007 19:18:29 +0200
Author:
|
Re: VB vs C# question (trying to switch languages)
very appreciated!! thank you
--
thanks (as always)
some day i''m gona pay this forum back for all the help i''m getting
kes
"Patrice" wrote:
> Historical reasons maybe. They 'll probably catch up in the future ?
>
> So for now you could perhaps try to programmaticaly check if the event
> handler is wired ? Try also perhaps to start a new project just to see if
> you have the same behavior... Is this a page in the same dir than other
> VB.NET pages etc...
>
> Note also Juan response. This is actually supported despite a caveat....
>
> Good luck and please let us know...
>
> ---
> Patrice
>
>
>
> "WebBuilder451" a écrit dans le
> message de news: DEF3F084-87F0-47CE-BE85-F4B7E0BAA15F@microsoft.com...
> > it was set to true. so this is odd, unless it's a mixed code issue.
> > i did notice from the article you referencd that "Note: C# doesn't make
> > the
> > dropdown list of events available when editing a code-beside file, but the
> > dropdown is available when writing in-line code. "
> >
> > Why is that?, i'd think it would code seperation would be encourged es in
> > C#! I'd hate to think i'll need to use in-line code sections to get the
> > tools
> > available in VS.
> >
> >
> > --
> > thanks (as always)
> > some day i''m gona pay this forum back for all the help i''m getting
> > kes
> >
> >
> > "Patrice" wrote:
> >
> >> AFAIK using both languages in the same web application is not supported
> >> (IMO
> >> may work, may not work depending on the deployment option etc you are
> >> using).
> >>
> >> In your case it's likely a problme with the AutoEventWriteUp attribute
> >> that
> >> is false for VB.NET and true in C# projects. You may want to set this
> >> valeu
> >> to true...
> >>
> >> See http://odetocode.com/Blogs/scott/archive/2006/02/16/2914.aspx for
> >> details.
> >>
> >> ---
> >> Patrice
> >>
> >> "WebBuilder451" a écrit dans le
> >> message de news: 8329B69B-F054-4098-B2E7-1454AD5FB780@microsoft.com...
> >> > I'm trying to make the jump from VB to C#. Aside from the syntax issues
> >> > i'm
> >> > running into some execution differences i think
> >> > 1. I created a C# page in an existing VB.net website
> >> > 2. I added a gridview with a footer row
> >> > 3. i attempted to change the value of a label in the footer row on row
> >> > databound using:
> >> > protected void gv_catalog_RowDataBound(object sender,
> >> > System.Web.UI.WebControls.GridViewRowEventArgs e)
> >> > {
> >> > if ((e.Row.RowType == DataControlRowType.Footer))
> >> > {
> >> > Label lbl =
> >> > (Label)this.gv_catalog.FooterRow.FindControl("lbl_OrderTotal");
> >> > lbl.Text = "total go here";
> >> > lbl.Font.Bold = true;
> >> > }
> >> > }
> >> > Note: I can get it to change in the page_load, but my point is it does
> >> > not
> >> > appear that the gv_catalog_RowDataBound event is firing.
> >> >
> >> > Questions:
> >> > 1. Is there something else i need to do to get this even to fire?
> >> > 2. I noticed that Intelesense does not work, i see items grayed out,
> >> > but
> >> > not
> >> > selectable.
> >> >
> >> > --
> >> > thanks (as always)
> >> > some day i''m gona pay this forum back for all the help i''m getting
> >> > kes
> >>
> >>
> >>
>
>
>
Date:Wed, 22 Aug 2007 10:44:02 -0700
Author:
|
Re: VB vs C# question (trying to switch languages)
very appreciated!!!!!!!
Thanks to both of you. My question other question is the same as above:
Do mos CS developers use inline as opposed to code sepration?
I'd perfer to use code separation but do not know how to get the events to
come up
with the exception of adding a gridview and then double clicking on it to
get the index_changed event.
How do you do it?
--
thanks (as always)
some day i''m gona pay this forum back for all the help i''m getting
kes
"Juan T. Llibre" wrote:
> re:
> !> AFAIK using both languages in the same web application is not supported
>
> Yes, it is supported.
>
> You have to create a couple of subdirectories of the App_Code directory,
> one for each language, and declare those directories in your web.config.
>
> <configuration>
> <system.web>
> <compilation debug="false">
> <codeSubDirectories>
> <add directoryName="VB"/>
> <add directoryName="CS"/>
> </codeSubDirectories>
> </compilation>
> </system.web>
> </configuration>
>
> Then, creating the App_Code\VB and App_Code\CS directories,
> and placing your VB and CS files in each, will allow you to use both languages in your app.
>
> This only works in ASP.NET 2.0! ( and is quite easy to implement )
>
> Caveat: this works only for "helper classes".
> You cannot place code-behind pages in the individual language directories.
>
> However, it *does* allow you to mix different-language source files in the same app,
> and it does allow you to call classes/methods/properties in different languages.
>
> An alternative would be to compile your different-language source files
> from the command-line, and placing the compiled assemblies in /bin.
>
>
>
>
>
>
> Juan T. Llibre, asp.net MVP
> asp.net faq : http://asp.net.do/faq/
> foros de asp.net, en español : http://asp.net.do/foros/
> ======================================
> "Patrice" <http://www.chez.com/scribe/> wrote in message news:%234XwqnM5HHA.5844@TK2MSFTNGP02.phx.gbl...
> > AFAIK using both languages in the same web application is not supported (IMO may work, may not work depending on the
> > deployment option etc you are using).
> >
> > In your case it's likely a problme with the AutoEventWriteUp attribute that is false for VB.NET and true in C#
> > projects. You may want to set this valeu to true...
> >
> > See http://odetocode.com/Blogs/scott/archive/2006/02/16/2914.aspx for details.
> >
> > ---
> > Patrice
> >
> > "WebBuilder451" a écrit dans le message de news:
> > 8329B69B-F054-4098-B2E7-1454AD5FB780@microsoft.com...
> >> I'm trying to make the jump from VB to C#. Aside from the syntax issues i'm
> >> running into some execution differences i think
> >> 1. I created a C# page in an existing VB.net website
> >> 2. I added a gridview with a footer row
> >> 3. i attempted to change the value of a label in the footer row on row
> >> databound using:
> >> protected void gv_catalog_RowDataBound(object sender,
> >> System.Web.UI.WebControls.GridViewRowEventArgs e)
> >> {
> >> if ((e.Row.RowType == DataControlRowType.Footer))
> >> {
> >> Label lbl =
> >> (Label)this.gv_catalog.FooterRow.FindControl("lbl_OrderTotal");
> >> lbl.Text = "total go here";
> >> lbl.Font.Bold = true;
> >> }
> >> }
> >> Note: I can get it to change in the page_load, but my point is it does not
> >> appear that the gv_catalog_RowDataBound event is firing.
> >>
> >> Questions:
> >> 1. Is there something else i need to do to get this even to fire?
> >> 2. I noticed that Intelesense does not work, i see items grayed out, but not
> >> selectable.
> >>
> >> --
> >> thanks (as always)
> >> some day i''m gona pay this forum back for all the help i''m getting
> >> kes
> >
> >
>
>
>
>
Date:Wed, 22 Aug 2007 10:44:04 -0700
Author:
|
Re: VB vs C# question (trying to switch languages)
"WebBuilder451" wrote in message
news:09AA7A02-9A9E-4431-BCD1-3A6EE28FA25C@microsoft.com...
> Do most CS developers use inline as opposed to code sepration?
I never use in-line server-side code...
> I'd perfer to use code separation but do not know how to get the events to
> come up
> with the exception of adding a gridview and then double clicking on it to
> get the index_changed event.
>
> How do you do it?
1) Switch into Design view
2) Select the relevant control
3) Click the lightning bolt icon in the Properties pane
4) Double-click the event which you want to create
--
Mark Rae
ASP.NET MVP
http://www.markrae.net
Date:Wed, 22 Aug 2007 19:22:47 +0100
Author:
|
Re: VB vs C# question (trying to switch languages)
My Friend,
Truely you are a "Fine American!!!" (or a fine "what ever country you care
to confess affiliation") can't thank you enough for this simple and obvious
item in VS. You have saved me from my greatest fear: having to write inline
code!!!! (i mean it)
IOU1 big time!
--
thanks (as always)
some day i''m gona pay this forum back for all the help i''m getting
kes
"Mark Rae [MVP]" wrote:
> "WebBuilder451" wrote in message
> news:09AA7A02-9A9E-4431-BCD1-3A6EE28FA25C@microsoft.com...
>
> > Do most CS developers use inline as opposed to code sepration?
>
> I never use in-line server-side code...
>
> > I'd perfer to use code separation but do not know how to get the events to
> > come up
> > with the exception of adding a gridview and then double clicking on it to
> > get the index_changed event.
> >
> > How do you do it?
>
> 1) Switch into Design view
>
> 2) Select the relevant control
>
> 3) Click the lightning bolt icon in the Properties pane
>
> 4) Double-click the event which you want to create
>
>
> --
> Mark Rae
> ASP.NET MVP
> http://www.markrae.net
>
>
Date:Wed, 22 Aug 2007 11:44:03 -0700
Author:
|
Re: VB vs C# question (trying to switch languages)
On Aug 22, 2:22 pm, "Mark Rae [MVP]" wrote:
> "WebBuilder451" wrote in message
>
> news:09AA7A02-9A9E-4431-BCD1-3A6EE28FA25C@microsoft.com...
>
> > Do most CS developers use inline as opposed to code sepration?
>
> I never use in-line server-side code...
>
> > I'd perfer to use code separation but do not know how to get the events to
> > come up
> > with the exception of adding a gridview and then double clicking on it to
> > get the index_changed event.
>
> > How do you do it?
>
> 1) Switch into Design view
>
> 2) Select the relevant control
>
> 3) Click the lightning bolt icon in the Properties pane
>
> 4) Double-click the event which you want to create
>
> --
> Mark Rae
> ASP.NET MVPhttp://www.markrae.net
Or to do it purely with manual code, which is all that these helper
double-clicks do:
On your ASPX page, pull up the source code, and find your gridview
item, and add the EventHandler method name to the event type, like so:
<asp:GridView id="GridView1" runat="server"
OnRowDataBound="MyEventNameHere" />
Then, add your event handler method to the code-behind page, as you
did above.
Date:Wed, 22 Aug 2007 11:49:01 -0700
Author:
|
Re: VB vs C# question (trying to switch languages)
For the alternative point of view : I *never* use codebehind.
I haven't come across anything which can be done
in codebehind which can't be done in inline code.
As far as I'm concerned, codebehind is a duplication of effort which
involves doing in multiple files what can be done in a single file.
I hope this doesn't confuse the h*ll out of you, but only provides insight into that
the choice of inline vs. codebehind is up to the developer and what he/she feels
most comfortable with, depending on his/her programming style.
:-)
Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaol : http://asp.net.do/foros/
======================================
"WebBuilder451" wrote in message
news:EBE6216B-5408-41EB-A83A-F8F3C13C23CD@microsoft.com...
> My Friend,
> Truely you are a "Fine American!!!" (or a fine "what ever country you care
> to confess affiliation") can't thank you enough for this simple and obvious
> item in VS. You have saved me from my greatest fear: having to write inline
> code!!!! (i mean it)
>
> IOU1 big time!
> --
> thanks (as always)
> some day i''m gona pay this forum back for all the help i''m getting
> kes
>
>
> "Mark Rae [MVP]" wrote:
>
>> "WebBuilder451" wrote in message
>> news:09AA7A02-9A9E-4431-BCD1-3A6EE28FA25C@microsoft.com...
>>
>> > Do most CS developers use inline as opposed to code sepration?
>>
>> I never use in-line server-side code...
>>
>> > I'd perfer to use code separation but do not know how to get the events to
>> > come up
>> > with the exception of adding a gridview and then double clicking on it to
>> > get the index_changed event.
>> >
>> > How do you do it?
>>
>> 1) Switch into Design view
>>
>> 2) Select the relevant control
>>
>> 3) Click the lightning bolt icon in the Properties pane
>>
>> 4) Double-click the event which you want to create
>>
>>
>> --
>> Mark Rae
>> ASP.NET MVP
>> http://www.markrae.net
>>
>>
Date:Wed, 22 Aug 2007 15:10:13 -0400
Author:
|
Re: VB vs C# question (trying to switch languages)
"Juan T. Llibre" wrote in message
news:OsPjQAP5HHA.1204@TK2MSFTNGP03.phx.gbl...
> I haven't come across anything which can be done
> in codebehind which can't be done in inline code.
That is indeed true.
> As far as I'm concerned, codebehind is a duplication of effort which
> involves doing in multiple files what can be done in a single file.
The reason that I prefer codebehind is because I have a whole slew of base
classes which (obviously) all live in .cs files, so it just feels more
consistent to have *all* my server-side code in .cs files...
> depending on his/her programming style.
That's the thing - there's really no difference once the web app is compiled
and deployed...
--
Mark Rae
ASP.NET MVP
http://www.markrae.net
Date:Wed, 22 Aug 2007 21:13:01 +0100
Author:
|
Re: VB vs C# question (trying to switch languages)
A lightning striked me while going back to work. The event you are using is
just not handled automatically by the autoeventwireup attribute.
So you'll have to explicitely add this handler as shown in the article I
mentionned earlier...
---
Patrice
"WebBuilder451" a crit dans le
message de news: 5568BA8D-6CFB-41AE-8D46-B6F2647A5124@microsoft.com...
> very appreciated!! thank you
> --
> thanks (as always)
> some day i''m gona pay this forum back for all the help i''m getting
> kes
>
>
> "Patrice" wrote:
>
>> Historical reasons maybe. They 'll probably catch up in the future ?
>>
>> So for now you could perhaps try to programmaticaly check if the event
>> handler is wired ? Try also perhaps to start a new project just to see if
>> you have the same behavior... Is this a page in the same dir than other
>> VB.NET pages etc...
>>
>> Note also Juan response. This is actually supported despite a caveat....
>>
>> Good luck and please let us know...
>>
>> ---
>> Patrice
>>
>>
>>
>> "WebBuilder451" a crit dans le
>> message de news: DEF3F084-87F0-47CE-BE85-F4B7E0BAA15F@microsoft.com...
>> > it was set to true. so this is odd, unless it's a mixed code issue.
>> > i did notice from the article you referencd that "Note: C# doesn't make
>> > the
>> > dropdown list of events available when editing a code-beside file, but
>> > the
>> > dropdown is available when writing in-line code. "
>> >
>> > Why is that?, i'd think it would code seperation would be encourged es
>> > in
>> > C#! I'd hate to think i'll need to use in-line code sections to get the
>> > tools
>> > available in VS.
>> >
>> >
>> > --
>> > thanks (as always)
>> > some day i''m gona pay this forum back for all the help i''m getting
>> > kes
>> >
>> >
>> > "Patrice" wrote:
>> >
>> >> AFAIK using both languages in the same web application is not
>> >> supported
>> >> (IMO
>> >> may work, may not work depending on the deployment option etc you are
>> >> using).
>> >>
>> >> In your case it's likely a problme with the AutoEventWriteUp attribute
>> >> that
>> >> is false for VB.NET and true in C# projects. You may want to set this
>> >> valeu
>> >> to true...
>> >>
>> >> See http://odetocode.com/Blogs/scott/archive/2006/02/16/2914.aspx for
>> >> details.
>> >>
>> >> ---
>> >> Patrice
>> >>
>> >> "WebBuilder451" a crit dans
>> >> le
>> >> message de news: 8329B69B-F054-4098-B2E7-1454AD5FB780@microsoft.com...
>> >> > I'm trying to make the jump from VB to C#. Aside from the syntax
>> >> > issues
>> >> > i'm
>> >> > running into some execution differences i think
>> >> > 1. I created a C# page in an existing VB.net website
>> >> > 2. I added a gridview with a footer row
>> >> > 3. i attempted to change the value of a label in the footer row on
>> >> > row
>> >> > databound using:
>> >> > protected void gv_catalog_RowDataBound(object sender,
>> >> > System.Web.UI.WebControls.GridViewRowEventArgs e)
>> >> > {
>> >> > if ((e.Row.RowType == DataControlRowType.Footer))
>> >> > {
>> >> > Label lbl =
>> >> > (Label)this.gv_catalog.FooterRow.FindControl("lbl_OrderTotal");
>> >> > lbl.Text = "total go here";
>> >> > lbl.Font.Bold = true;
>> >> > }
>> >> > }
>> >> > Note: I can get it to change in the page_load, but my point is it
>> >> > does
>> >> > not
>> >> > appear that the gv_catalog_RowDataBound event is firing.
>> >> >
>> >> > Questions:
>> >> > 1. Is there something else i need to do to get this even to fire?
>> >> > 2. I noticed that Intelesense does not work, i see items grayed out,
>> >> > but
>> >> > not
>> >> > selectable.
>> >> >
>> >> > --
>> >> > thanks (as always)
>> >> > some day i''m gona pay this forum back for all the help i''m getting
>> >> > kes
>> >>
>> >>
>> >>
>>
>>
>>
Date:Thu, 23 Aug 2007 09:59:21 +0200
Author:
|
Re: VB vs C# question (trying to switch languages)
On Aug 22, 9:13 pm, "Mark Rae [MVP]" wrote:
> "Juan T. Llibre" wrote in messagenews:OsPjQAP5HHA.1204@TK2MSFTNGP03.phx.gbl...
>
> > I haven't come across anything which can be done
> > in codebehind which can't be done in inline code.
>
> That is indeed true.
>
But you can do something with inline code which you can't do with
codebehind - you can postpone a compilation error until the page is
hit :-)
Damien
Date:Thu, 23 Aug 2007 02:37:57 -0700
Author:
|
Re: VB vs C# question (trying to switch languages)
On Aug 23, 5:37 am, Damien wrote:
> On Aug 22, 9:13 pm, "Mark Rae [MVP]" wrote:> "Juan T. Llibre" wrote in messagenews:OsPjQAP5HHA.1204@TK2MSFTNGP03.phx.gbl...
>
> > > I haven't come across anything which can be done
> > > in codebehind which can't be done in inline code.
>
> > That is indeed true.
>
> But you can do something with inline code which you can't do with
> codebehind - you can postpone a compilation error until the page is
> hit :-)
>
> Damien
Only if you're pre-compiling the web-app. If you're doing it on the
fly, you'll be fine (VS will inform you of the error whne you start to
debug it, but you can continue forward).
The reason I like code-behind rather than inline is the same reason
that I like separate CSS files rather than doing inline stylesheets:
It's the physical separation between content, formatting, and
scripting. Plus, I find it much easier to work with two, shorter,
files than one larger file.
Date:Thu, 23 Aug 2007 06:16:44 -0700
Author:
|
Re: VB vs C# question (trying to switch languages)
Opinion appreciated!
I'm creating classes in vb now and have used code behind exclusively in all
my projects. It makes my life safer because when errors pop in as a result of
designers i can at least know they did not alter the code by accident. It
makes their life easier because they can create and complain (rightly so)
only about the junk html introduced by VS, but not about the stuff at the top.
--
thanks (as always)
some day i''m gona pay this forum back for all the help i''m getting
kes
"Juan T. Llibre" wrote:
> For the alternative point of view : I *never* use codebehind.
>
> I haven't come across anything which can be done
> in codebehind which can't be done in inline code.
>
> As far as I'm concerned, codebehind is a duplication of effort which
> involves doing in multiple files what can be done in a single file.
>
> I hope this doesn't confuse the h*ll out of you, but only provides insight into that
> the choice of inline vs. codebehind is up to the developer and what he/she feels
> most comfortable with, depending on his/her programming style.
>
> :-)
>
>
>
>
> Juan T. Llibre, asp.net MVP
> asp.net faq : http://asp.net.do/faq/
> foros de asp.net, en español : http://asp.net.do/foros/
> ======================================
> "WebBuilder451" wrote in message
> news:EBE6216B-5408-41EB-A83A-F8F3C13C23CD@microsoft.com...
> > My Friend,
> > Truely you are a "Fine American!!!" (or a fine "what ever country you care
> > to confess affiliation") can't thank you enough for this simple and obvious
> > item in VS. You have saved me from my greatest fear: having to write inline
> > code!!!! (i mean it)
> >
> > IOU1 big time!
> > --
> > thanks (as always)
> > some day i''m gona pay this forum back for all the help i''m getting
> > kes
> >
> >
> > "Mark Rae [MVP]" wrote:
> >
> >> "WebBuilder451" wrote in message
> >> news:09AA7A02-9A9E-4431-BCD1-3A6EE28FA25C@microsoft.com...
> >>
> >> > Do most CS developers use inline as opposed to code sepration?
> >>
> >> I never use in-line server-side code...
> >>
> >> > I'd perfer to use code separation but do not know how to get the events to
> >> > come up
> >> > with the exception of adding a gridview and then double clicking on it to
> >> > get the index_changed event.
> >> >
> >> > How do you do it?
> >>
> >> 1) Switch into Design view
> >>
> >> 2) Select the relevant control
> >>
> >> 3) Click the lightning bolt icon in the Properties pane
> >>
> >> 4) Double-click the event which you want to create
> >>
> >>
> >> --
> >> Mark Rae
> >> ASP.NET MVP
> >> http://www.markrae.net
> >>
> >>
>
>
>
Date:Thu, 23 Aug 2007 06:34:01 -0700
Author:
|
Re: VB vs C# question (trying to switch languages)
same here but in vb.net however, i'm already starting to perfer cs. I, thanks
to your help and others, can create dual directories for code and add cs
classes for new items i create without having to rewrite the old (for now).
--
thanks (as always)
some day i''m gona pay this forum back for all the help i''m getting
kes
"Mark Rae [MVP]" wrote:
> "Juan T. Llibre" wrote in message
> news:OsPjQAP5HHA.1204@TK2MSFTNGP03.phx.gbl...
>
> > I haven't come across anything which can be done
> > in codebehind which can't be done in inline code.
>
> That is indeed true.
>
> > As far as I'm concerned, codebehind is a duplication of effort which
> > involves doing in multiple files what can be done in a single file.
>
> The reason that I prefer codebehind is because I have a whole slew of base
> classes which (obviously) all live in .cs files, so it just feels more
> consistent to have *all* my server-side code in .cs files...
>
> > depending on his/her programming style.
>
> That's the thing - there's really no difference once the web app is compiled
> and deployed...
>
>
> --
> Mark Rae
> ASP.NET MVP
> http://www.markrae.net
>
>
Date:Thu, 23 Aug 2007 06:36:04 -0700
Author:
|
Re: VB vs C# question (trying to switch languages)
!
This is now, but i see a lot of room for other opinions here and they all work
--
thanks (as always)
some day i''m gona pay this forum back for all the help i''m getting
kes
"Evan M." wrote:
> On Aug 23, 5:37 am, Damien wrote:
> > On Aug 22, 9:13 pm, "Mark Rae [MVP]" wrote:> "Juan T. Llibre" wrote in messagenews:OsPjQAP5HHA.1204@TK2MSFTNGP03.phx.gbl...
> >
> > > > I haven't come across anything which can be done
> > > > in codebehind which can't be done in inline code.
> >
> > > That is indeed true.
> >
> > But you can do something with inline code which you can't do with
> > codebehind - you can postpone a compilation error until the page is
> > hit :-)
> >
> > Damien
>
> Only if you're pre-compiling the web-app. If you're doing it on the
> fly, you'll be fine (VS will inform you of the error whne you start to
> debug it, but you can continue forward).
>
> The reason I like code-behind rather than inline is the same reason
> that I like separate CSS files rather than doing inline stylesheets:
> It's the physical separation between content, formatting, and
> scripting. Plus, I find it much easier to work with two, shorter,
> files than one larger file.
>
>
Date:Thu, 23 Aug 2007 06:38:00 -0700
Author:
|
Re: VB vs C# question (trying to switch languages)
thanks
--
thanks (as always)
some day i''m gona pay this forum back for all the help i''m getting
kes
"Patrice" wrote:
> A lightning striked me while going back to work. The event you are using is
> just not handled automatically by the autoeventwireup attribute.
>
> So you'll have to explicitely add this handler as shown in the article I
> mentionned earlier...
>
> ---
> Patrice
>
> "WebBuilder451" a écrit dans le
> message de news: 5568BA8D-6CFB-41AE-8D46-B6F2647A5124@microsoft.com...
> > very appreciated!! thank you
> > --
> > thanks (as always)
> > some day i''m gona pay this forum back for all the help i''m getting
> > kes
> >
> >
> > "Patrice" wrote:
> >
> >> Historical reasons maybe. They 'll probably catch up in the future ?
> >>
> >> So for now you could perhaps try to programmaticaly check if the event
> >> handler is wired ? Try also perhaps to start a new project just to see if
> >> you have the same behavior... Is this a page in the same dir than other
> >> VB.NET pages etc...
> >>
> >> Note also Juan response. This is actually supported despite a caveat....
> >>
> >> Good luck and please let us know...
> >>
> >> ---
> >> Patrice
> >>
> >>
> >>
> >> "WebBuilder451" a écrit dans le
> >> message de news: DEF3F084-87F0-47CE-BE85-F4B7E0BAA15F@microsoft.com...
> >> > it was set to true. so this is odd, unless it's a mixed code issue.
> >> > i did notice from the article you referencd that "Note: C# doesn't make
> >> > the
> >> > dropdown list of events available when editing a code-beside file, but
> >> > the
> >> > dropdown is available when writing in-line code. "
> >> >
> >> > Why is that?, i'd think it would code seperation would be encourged es
> >> > in
> >> > C#! I'd hate to think i'll need to use in-line code sections to get the
> >> > tools
> >> > available in VS.
> >> >
> >> >
> >> > --
> >> > thanks (as always)
> >> > some day i''m gona pay this forum back for all the help i''m getting
> >> > kes
> >> >
> >> >
> >> > "Patrice" wrote:
> >> >
> >> >> AFAIK using both languages in the same web application is not
> >> >> supported
> >> >> (IMO
> >> >> may work, may not work depending on the deployment option etc you are
> >> >> using).
> >> >>
> >> >> In your case it's likely a problme with the AutoEventWriteUp attribute
> >> >> that
> >> >> is false for VB.NET and true in C# projects. You may want to set this
> >> >> valeu
> >> >> to true...
> >> >>
> >> >> See http://odetocode.com/Blogs/scott/archive/2006/02/16/2914.aspx for
> >> >> details.
> >> >>
> >> >> ---
> >> >> Patrice
> >> >>
> >> >> "WebBuilder451" a écrit dans
> >> >> le
> >> >> message de news: 8329B69B-F054-4098-B2E7-1454AD5FB780@microsoft.com...
> >> >> > I'm trying to make the jump from VB to C#. Aside from the syntax
> >> >> > issues
> >> >> > i'm
> >> >> > running into some execution differences i think
> >> >> > 1. I created a C# page in an existing VB.net website
> >> >> > 2. I added a gridview with a footer row
> >> >> > 3. i attempted to change the value of a label in the footer row on
> >> >> > row
> >> >> > databound using:
> >> >> > protected void gv_catalog_RowDataBound(object sender,
> >> >> > System.Web.UI.WebControls.GridViewRowEventArgs e)
> >> >> > {
> >> >> > if ((e.Row.RowType == DataControlRowType.Footer))
> >> >> > {
> >> >> > Label lbl =
> >> >> > (Label)this.gv_catalog.FooterRow.FindControl("lbl_OrderTotal");
> >> >> > lbl.Text = "total go here";
> >> >> > lbl.Font.Bold = true;
> >> >> > }
> >> >> > }
> >> >> > Note: I can get it to change in the page_load, but my point is it
> >> >> > does
> >> >> > not
> >> >> > appear that the gv_catalog_RowDataBound event is firing.
> >> >> >
> >> >> > Questions:
> >> >> > 1. Is there something else i need to do to get this even to fire?
> >> >> > 2. I noticed that Intelesense does not work, i see items grayed out,
> >> >> > but
> >> >> > not
> >> >> > selectable.
> >> >> >
> >> >> > --
> >> >> > thanks (as always)
> >> >> > some day i''m gona pay this forum back for all the help i''m getting
> >> >> > kes
> >> >>
> >> >>
> >> >>
> >>
> >>
> >>
>
>
>
Date:Thu, 23 Aug 2007 06:44:04 -0700
Author:
|
|
|