CodeVerge.Net Beta


   Explore    Item Entry    Members      Register  Login  
NEWSGROUP
.NET
Algorithms-Data Structures
Asp.Net
C Plus Plus
CSharp
Database
HTML
Javascript
Linq
Other
Regular Expressions
VB.Net
XML

Free Download:




Zone: > NEWSGROUP > Asp.Net Forum > visual_studio.visual_studio_2005 Tags:
Item Type: NewsGroup Date Entered: 3/27/2006 3:35:26 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 3 Views: 46 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
4 Items, 1 Pages 1 |< << Go >> >|
geunger
Asp.Net User
Unable to add OnInit event3/27/2006 3:35:26 PM

0/0

I am attempting to link the OnInit event to my axp.net page in Visual Studio 2005 and have tried numerous methods.  It appears that I am supposed to have a method declaration as follows:

void

Page_OnInit(object sender, EventArgs e)

(This is a copy of the Page_Load declaration with the protected keyword removed.)

However, the code inside this method never gets executed.  This is pretty frustrating!  Anyone have any ideas why this does not work or what the correct syntax would be?

Thanks.

Guinn

XIII
Asp.Net User
Re: Unable to add OnInit event3/27/2006 4:33:56 PM

0/0

Hi Guinn,

The "problem" is known. The solution is to type in the codefile

protected override followed by a space. After that Intellisense kicks in and gives you a list. You can choose there for OnInit. It'll give you this:

protected override void OnInit(EventArgs e)

{

base.OnInit(e);

}

Grz, Kris.


Kris van der Mast [MVP] || 101 LINQ to SQL samples
geunger
Asp.Net User
Re: Unable to add OnInit event3/27/2006 5:32:32 PM

0/0

Kris,

That worked.  Thanks for the help.

I'm surprised that I could not find this documented anywhere else.  If this a "workaround" or is it the "proper" way to declare this?

Guinn

XIII
Asp.Net User
Re: Unable to add OnInit event3/27/2006 6:59:40 PM

0/0

Hi,

it was already available in previous versions of vs.net. It's a proper way and it seems it's also the preferred way these days.

Grz, Kris.


Kris van der Mast [MVP] || 101 LINQ to SQL samples
4 Items, 1 Pages 1 |< << Go >> >|


Free Download:


Web:
Unable to Override OnInit? - ASP.NET Forums I have a simple page that needs override OnInit event in ASP.net 2.0. ... Channel 10: Add “I’m a PC” To Your Windows Live Messenger ...
GridView, dynamic template fields, FindControl problem I'm building a GridView using code to add template fields, because ... in OnInit event of the Page. -- Teemu Keiski AspInsider, ASP.NET MVP ...
Yeroon's Blog - All posts Unable to add files to library in Windows Media Player 11 on Windows Vista ... The solution is to create/add your controls with the OnInit override event. ...
Nikhil Kothari's Weblog : Single Instance Templates For every template control I wished to track, I add an OnInit event to it. .... but the problem is that we are unable to close the popup after the user ...
UserControl Events Not Firing with Dynamically Created Button ... click the button it seems to fire the events but I'm unable to capture ... protected override void OnInit(EventArgs e) ...
GridView, dynamic template fields, FindControl problem ... postback and GridView_RowUpdating event occurs, I'm unable to find any ... in OnInit event of the Page. -- Teemu Keiski AspInsider, ASP. ...
Unable to Understand Compiler Error [Archive] - Ubuntu Forums //initilize the app using OnInit, which tells whether the apps' been succesfully made or not ... Create the event table for this frame DECLARE_EVENT_TABLE() ...
Dynamically controls creation asp.net/ event fire twice / event ... This means that the OnInit method will not run again and I won’t see the button until the user posts again. I tried adding a button in the event.. and they ...
TemplateControl.LoadControl Method (String) (System.Web.UI) Examples. The following code example demonstrates how to use the LoadControl method to add a user control to an ASP.NET page. In the OnInit event method, ...
TheMSsForum.com >> Asp >> asp hyperlink click event? - The ... As it's greyed-out i am unable to add another user, including when logged in as .... using the OnInit event to call the subroutine but that fires when the ...




Search This Site:










datagrid in a datagrid

errror eit h login and create user contorll. iis server 6.0

cookie problem

css master page/content

how to connect to a web site under source safe

looking to find some assistance installing dotnetnuke

how to get id of currently inserted record

formbased security

question on ip

login page with windows authentication

host settings -> smtp password

authentication error

the dnn install versions

centering account login in the container

multiple root items on menu not showing up

vs 2008 ide - splitter bar (located above the scroll bar)

forum / blog: question about user

dnn 3.0 loading images from sqlserver gives error!

different colored tabs

table - index out of range

checking security of file with httpwebrequest.getresponse problem.

fotovision: method not found: void dotnetnuke.ui.webcontrols.treenode.set_navigateurl(system.string).

url & active button

applicationname

a quick note of thanks

launching osql in a web application (w2k3), failed

how to create server control in asp.net?.please help

announcements module dnn2.1.1

problem running ajax 1.0 based controls on beta 2

my err on server - please

 
All Times Are GMT