Page and Control events

General disucssion on Regionerate.

Page and Control events

Postby mattias » Tue May 11, 2010 11:18 am

Hello and thanks for an excellent product!


I was wondering if there is any way to produce something like:

Code: Select all
#region Page Events

protected void Page_Load(object sender, EventArgs e) { .. }

#endregion

#region Control Events

protected void MyDropDownList_SelectedIndexChanged(object sender, EventArgs e) { ... }

#endregion


Or something similiar. I want to distinguish page events from regular methods.
mattias
 
Posts: 1
Joined: Tue May 11, 2010 11:13 am

Re: Page and Control events

Postby rauchy » Tue May 11, 2010 7:47 pm

mattias,

If you know the names of all your page events, you can easily write a regular expression that will match all of them.
If they all begin with Page_, it's even super-easy.

Create a region called "Page Events" with a PutMethods where name matches that regular expression.
Then create another region called "Control Events" with another PutMethods, that will put the rest of the methods there.

Cheers.
-- rauchy.
rauchy
Site Admin
 
Posts: 267
Joined: Wed May 09, 2007 2:39 am
Location: Israel


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 1 guest

cron