Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > does it still apply in 2.0

Reply
Thread Tools

does it still apply in 2.0

 
 
=?Utf-8?B?cm9kY2hhcg==?=
Guest
Posts: n/a
 
      02-14-2007
hey all,
i was wondering if the following code snippet from a 1.1 exerpt still apply
in asp.net 2.0 framework:

#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
InitializeComponent();
base.OnInit(e);
}

private void InitializeComponent()
{
BubbleControl.BubbleClick += new EventHandler(WebForm1_BubbleClick);
}
#endregion

thanks,
rodchar
 
Reply With Quote
 
 
 
 
Teemu Keiski
Guest
Posts: n/a
 
      02-14-2007
Yes it would work as-is, however VS2005 doesn't use it because in ASP.NET
2.0 / VS2005 you can wire event handlers without touching the exact
code-behind file (thanks to partial classes).

--
Teemu Keiski
AspInsider, ASP.NET MVP
http://blogs.aspadvice.com/joteke
http://teemukeiski.net



"rodchar" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> hey all,
> i was wondering if the following code snippet from a 1.1 exerpt still
> apply
> in asp.net 2.0 framework:
>
> #region Web Form Designer generated code
> override protected void OnInit(EventArgs e)
> {
> InitializeComponent();
> base.OnInit(e);
> }
>
> private void InitializeComponent()
> {
> BubbleControl.BubbleClick += new EventHandler(WebForm1_BubbleClick);
> }
> #endregion
>
> thanks,
> rodchar


 
Reply With Quote
 
 
 
 
=?Utf-8?B?cm9kY2hhcg==?=
Guest
Posts: n/a
 
      02-14-2007
so where could i put the contents of InitializeComponent() with regards to
the partial class model?

"Teemu Keiski" wrote:

> Yes it would work as-is, however VS2005 doesn't use it because in ASP.NET
> 2.0 / VS2005 you can wire event handlers without touching the exact
> code-behind file (thanks to partial classes).
>
> --
> Teemu Keiski
> AspInsider, ASP.NET MVP
> http://blogs.aspadvice.com/joteke
> http://teemukeiski.net
>
>
>
> "rodchar" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > hey all,
> > i was wondering if the following code snippet from a 1.1 exerpt still
> > apply
> > in asp.net 2.0 framework:
> >
> > #region Web Form Designer generated code
> > override protected void OnInit(EventArgs e)
> > {
> > InitializeComponent();
> > base.OnInit(e);
> > }
> >
> > private void InitializeComponent()
> > {
> > BubbleControl.BubbleClick += new EventHandler(WebForm1_BubbleClick);
> > }
> > #endregion
> >
> > thanks,
> > rodchar

>

 
Reply With Quote
 
Teemu Keiski
Guest
Posts: n/a
 
      02-14-2007
Note that what I meant is that it's not used at all anymore. You can write
it manually like that into code-behind if you like

E.g With VS2005 you could to add it manually in case you intent to use it.
The VS2005's ways are either just writing the handler in code or
double-click the control in design view (or select the event from property
browser and click it) to force it to generate the event handler. VS2005
would generate them in C# as attributes to the controls. E.g if you have a
Button on Page

<asp:Button ID="Button1" runat="server" Text="Click me" />

Double clicking the control on designer view would add
OnClick="Button1_Click" to the Button's tag and add protected method to
code-behind or inline code (depending on which model you use)


--
Teemu Keiski
AspInsider, ASP.NET MVP
http://blogs.aspadvice.com/joteke
http://teemukeiski.net




"rodchar" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> so where could i put the contents of InitializeComponent() with regards to
> the partial class model?
>
> "Teemu Keiski" wrote:
>
>> Yes it would work as-is, however VS2005 doesn't use it because in ASP.NET
>> 2.0 / VS2005 you can wire event handlers without touching the exact
>> code-behind file (thanks to partial classes).
>>
>> --
>> Teemu Keiski
>> AspInsider, ASP.NET MVP
>> http://blogs.aspadvice.com/joteke
>> http://teemukeiski.net
>>
>>
>>
>> "rodchar" <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>> > hey all,
>> > i was wondering if the following code snippet from a 1.1 exerpt still
>> > apply
>> > in asp.net 2.0 framework:
>> >
>> > #region Web Form Designer generated code
>> > override protected void OnInit(EventArgs e)
>> > {
>> > InitializeComponent();
>> > base.OnInit(e);
>> > }
>> >
>> > private void InitializeComponent()
>> > {
>> > BubbleControl.BubbleClick += new EventHandler(WebForm1_BubbleClick);
>> > }
>> > #endregion
>> >
>> > thanks,
>> > rodchar

>>


 
Reply With Quote
 
bruce barker
Guest
Posts: n/a
 
      02-14-2007
OnInit

-- bruce (sqlwork.com)

rodchar wrote:
> so where could i put the contents of InitializeComponent() with regards to
> the partial class model?
>
> "Teemu Keiski" wrote:
>
>> Yes it would work as-is, however VS2005 doesn't use it because in ASP.NET
>> 2.0 / VS2005 you can wire event handlers without touching the exact
>> code-behind file (thanks to partial classes).
>>
>> --
>> Teemu Keiski
>> AspInsider, ASP.NET MVP
>> http://blogs.aspadvice.com/joteke
>> http://teemukeiski.net
>>
>>
>>
>> "rodchar" <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>>> hey all,
>>> i was wondering if the following code snippet from a 1.1 exerpt still
>>> apply
>>> in asp.net 2.0 framework:
>>>
>>> #region Web Form Designer generated code
>>> override protected void OnInit(EventArgs e)
>>> {
>>> InitializeComponent();
>>> base.OnInit(e);
>>> }
>>>
>>> private void InitializeComponent()
>>> {
>>> BubbleControl.BubbleClick += new EventHandler(WebForm1_BubbleClick);
>>> }
>>> #endregion
>>>
>>> thanks,
>>> rodchar

 
Reply With Quote
 
=?Utf-8?B?cm9kY2hhcg==?=
Guest
Posts: n/a
 
      02-15-2007
Thanks everyone for the replies. I appreciate it. rod.


"rodchar" wrote:

> hey all,
> i was wondering if the following code snippet from a 1.1 exerpt still apply
> in asp.net 2.0 framework:
>
> #region Web Form Designer generated code
> override protected void OnInit(EventArgs e)
> {
> InitializeComponent();
> base.OnInit(e);
> }
>
> private void InitializeComponent()
> {
> BubbleControl.BubbleClick += new EventHandler(WebForm1_BubbleClick);
> }
> #endregion
>
> thanks,
> rodchar

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
do design patterns still apply with Python? John Salerno Python 28 01-27-2008 03:20 AM
Does the cascading rule apply to switches? Boe Cisco 4 03-29-2006 11:02 PM
Datalist selects Item after first click, but does apply the SelectedItemTemplate after the second click only Dirk Meusel ASP .Net 1 08-19-2003 09:56 AM
VB6 exams still apply to any certification? Jerry Microsoft Certification 1 08-07-2003 11:35 PM
[XSLT] could not apply "apply-templates" Stefan Siegl XML 1 07-18-2003 09:43 AM



Advertisments