CodeVerge.Net Beta


   Explore    Item Entry   Register  Login  
Microsoft News
Asp.Net Forums
IBM Software
Borland Forums
Adobe Forums
Novell Forums

ASP.NET Web Hosting – 3 Months Free!



Zone: > NEWSGROUP > Asp.Net Forum > windows_hosting.hosting_open_forum Tags:
Item Type: NewsGroup Date Entered: 4/26/2004 2:28:58 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 3 Views: 27 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
4 Items, 1 Pages 1 |< << Go >> >|
sikittle
Asp.Net User
user controls + events4/26/2004 2:28:58 PM

0/0

Hi,

I've got a user control i'm developing which accesses info from a database and displays it. It is essentially one record.

I am displaying the fields in text boxes, and I have a button which can be used to put it the record in Edit mode.

This button works fine normally. But if I create the control at runtime using LoadControl(), none of the button events (Edit, Cancel, Delete) seem to fire.

Does any special stuff have to be done to be able to handle events if the user control is created at runtime?

Would creating a user control to handle all functionality related to one database record, for example, displaying it, editing it, etc, be considered a bad idea?

I read one ASP.NET starter kit where it says that User Controls should not really contain Form controls inside it, but I'm not sure if that was in specific context.

Thanks

Simon
master4eva
Asp.Net User
Re: user controls + events4/26/2004 8:35:54 PM

0/0

Do you recreate the user control every post back?
-- Justin Lovell
Robske
Asp.Net User
Re: user controls + events4/27/2004 7:27:47 AM

0/0

Don't know if this is the solution but it's worth trying.
If you create a control at run-time and you click on the control.... (button in this example) the control is not saved on the page. You have to create the button again or store it als an object in a session or viewstate.

Session["button"] = btnToSave;

on page load

btnToSave = (Button)Session["button"] ;

Do you have added a eventhandler??

btnToSave.Click += new EventHandler(method name without parameters);

Rob
hiskid
Asp.Net User
Re: user controls + events8/20/2004 6:38:48 PM

0/0

You need to bubble your events...

MS has a great HOWTO at MSDN

4 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
Programming ASP.NET: Building Web Applications and Services with ASP.NET 2.0 Authors: Jesse Liberty, Dan Hurwitz, Pages: 930, Published: 2005
ASP.NET Cookbook Authors: Michael A. Kittel, Michael A. Kittel Geoffrey T. LeBlond, Geoffrey T. LeBlond, Pages: 824, Published: 2004
Pro ASP.NET 2.0 in VB 2005: From Professional to Expert Authors: Laurence Moroney, Matthew MacDonald, Pages: 1253, Published: 2006
Professional ASP.NET 2.0 Authors: Bill Evjen, Scott Hanselman, Farhan Muhammad, Srinivasa Sivakumar, Devin Rader, Pages: 1253, Published: 2005
Beginning JavaScript Authors: Paul Wilton, Pages: 1056, Published: 2000
Access 2003 Bible Authors: Cary N. Prague, Michael R. Irwin, Jennifer Reardon, Pages: 1464, Published: 2003
The Human-computer Interaction Handbook: Fundamentals, Evolving Technologies, and Emerging Applications Authors: Julie A. Jacko, Andrew Sears, Pages: 1277, Published: 2003
Learning C# 2005: Get Started with C# 2.0 and .NET Programming Authors: Jesse Liberty, Brian MacDonald, Pages: 528, Published: 2006
Programming C#: Building .NET Applications with C# Authors: Jesse Liberty, Pages: 644, Published: 2005
Microsoft Office Access 2003: The Complete Reference Authors: Virginia Andersen, Pages: 719, Published: 2003

Web:
Handling User Control Events Do not include user control event handlers in the containing page; write them in the code declaration block of the user control or in the code-behind file ...
ASP 101 - User Controls NET User Control Sample - Validation & Events Event Bubbling From Web User Controls in ASP.NET (C#) C# code for event bubbling from a web user control (ASCX) to a parent page (ASPX ) and the shows the flow of events through execution.
Dynamically Creating User Controls That Fire Events Back To You ... May 7, 2008 ... The key is to give that user control its own EventArgs type (to hold its unique ID ) and thus also give it a delegate and an event. ...
Silverlight: User Controls with events Instead of declaring RoutedEvents in our User Control, we have to resort to standard .NET events then. From a user point of view, it doesn't make a very big ...
Sending events from user controls to the parent containers - Johan ... Apr 6, 2005 ... This sample lets the user control raise an event, which the parent page catches. The event contains information about what text the label ...
How do you capture User control events in the parent page Talk about How do you capture User control events in the parent page.
Easily Raise Events From ASP.NET ASCX User Controls - Brendan ... NET developers don't implement events from their user controls. .... I have been looking for a solution to get my user control events fired. ...
15 Seconds : Building ASP.NET User and Server Controls -- Part 1 The event that this fires on is the OnPreRender event. This event is part of the page life cycle (which user controls consequently share), ...
UserControl Class (System.Windows.Forms) MiddleRight ' Add the controls to the user control. Controls. ... ex As Exception ' Cancel the event and select the text to be corrected by the user. e. ...

Videos:
Move Networks at CONVERGE event during NAB Combining several innovative technologies, Move Networks provides a platform that allows content owners and distributors to create and expand new rev...
Access 2000 Dev Level 11 The Access 2000 Dev Level 11 is part of KeyStone Learning Systems library of more than 1,200 CD-ROM and video-based information technology course tit...
Macro: A custom dialog box - step 3 After you have added controls to your dialog box or document, you add event procedures to determine how the controls respond to user actions.
Access 2000 Dev Level 11 The Access 2000 Dev Level 11 is part of KeyStone Learning Systems library of more than 1,200 CD-ROM and video-based information technology course tit...
Bitwise Rhythm Generator 2 Download the patch here: http://milkcrate.com.au/_other/downloads/max_patches/bitwise.rhythm/ More Info: http://little-scale.blogspot.com/2007/12/...
Access 2000 Dev Level 11 The Access 2000 Dev Level 11 is part of KeyStone Learning Systems library of more than 1,200 CD-ROM and video-based information technology course tit...
Digidesign VENUE - D-Show 2.5 Software D-Show™ 2.5 software improves upon the VENUE system's acclaimed operating system by adding support for both D-Show™ and D-Show Profile™ mixing consol...
Access 2000 Dev Level 11 The Access 2000 Dev Level 11 is part of KeyStone Learning Systems library of more than 1,200 CD-ROM and video-based information technology course tit...
Commitment Control 8.9 Part 2 This webinar is designed especially for PS/Commitment Control implementers and users. Here, we showcase how version 8.9 can be used in order to effe...
Access 2000 Dev Level 11 The Access 2000 Dev Level 11 is part of KeyStone Learning Systems library of more than 1,200 CD-ROM and video-based information technology course tit...




Search This Site:










httpmodule - platformnotsupportedexception exception when accessing response.headers. why?

crazy condional (look inside) - is there a better way?

webcontrols toolbar javascript question

.net charts

findcontrol in page that uses a master page

executenonquery creates 2 new identical records.

deleting files

"not a valid virtual path"

how to get selected from checkboxlist into database?

remove spaces and lines from source code

compiler error message: cs1595: 'myclass' is defined in multiple places

problem while using services of other site

what this small code do?

image is not loaded - strange problem

how to send an email

cant get controls to work in visual studio

abstact class vs interface

my first asp.net page

problem with varybycontrol

viewstate error with page template

finding control in panel in repeater in tabpanel in tabcontainer

deleting rows in dataset

affiliate program

starting asp.net

stor procedure not working in .aspx page

encoding email

best way to store data visible in every page of every session...

<ypbp:categorytree id="categorytree" runat="server"></ypbp:categorytree>

[help] select the end date of particular month

how can i modify the position of "create user" button from the createuserwizzard?

  Privacy | Contact Us
All Times Are GMT