CodeVerge.Net Beta


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




Can Reply:  No Members Can Edit: No Online: Yes
Zone: > NEWSGROUP > Asp.Net Forum > windows_hosting.hosting_open_forum Tags:
Item Type: NewsGroup Date Entered: 8/29/2003 3:02:34 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
NR
XPoints: N/A Replies: 0 Views: 35 Favorited: 0 Favorite
1 Items, 1 Pages 1 |< << Go >> >|
scott hopkinson
Asp.Net User
Dynamically assigned events to Dynamic controls8/29/2003 3:02:34 PM

0

Ok I have seen this happen to many people. I have read the suggestions and feel I am still missing something. The created imagebuttons do not fire the assigned btnImg_Click method although the page does post back. Here is my code for reference.


public class Navigation : System.Web.UI.UserControl
{
private Security _security;
private PrivilegeDS _privileges;

private void Page_Load(object sender, System.EventArgs e)
{
_security = (Security)HttpContext.Current.Session["SECURITY"];
_privileges = _security.GetUserPriviledges();
createNavigation();
}

private void createNavigation()
{
foreach(PrivilegeDS.tblPrivilegeRow privilegeDR in _privileges.tblPrivilege)
{
ImageButton btnImg = new ImageButton();
btnImg.ImageUrl = Config.RetrieveConfigSetting("WEB.ImagePath.Nav") + privilegeDR.vchrPrivilege.ToString() + ".gif";
btnImg.CommandArgument = privilegeDR.vchrControl.ToString();
btnImg.CommandName = "MenuItem";
btnImg.ID = privilegeDR.vchrPrivilege.ToString();
btnImg.Click += new System.Web.UI.ImageClickEventHandler(this.btnImg_Click);
this.Controls.Add(btnImg);
}
}


private void btnImg_Click(object sender, System.Web.UI.ImageClickEventArgs e)
{
RaiseBubbleEvent(sender,e);
}



Everything I have read seams to point to the fact that the dynamic controls must be created the same for each post back. These controls must also be created in the Page_Load event or the init.
1 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
Dynamic and mobile GIS: investigating changes in space and time Authors: Jane Drummond, Roland Billen, Elsa Joao, David Forrest, Pages: 310, Published: 2006
Pro ASP.NET 2.0 in VB 2005 Authors: Laurence Moroney, Matthew MacDonald, Pages: 1253, Published: 2006
Pro ASP.NET 2.0 in C# 2005 Authors: Matthew Macdonald, Mario Szpuszta, Pages: 1288, Published: 2005
Pro ASP.NET 2.0 in C# 2005 Authors: Matthew MacDonald, Mario Szpuszta, Pages: 1255, Published: 2005
Pro ASP.NET 3.5 in C# 2008 Authors: Matthew MacDonald, Mario Szpuszta, Pages: 1498, Published: 2007

Web:
Dynamically assigned events to Dynamic controls - ASP.NET Forums Dynamically assigned events to Dynamic controls. Last post 08-29-2003 11:03 AM by Scott Hopkinson. 0 replies. Sort Posts: Oldest to newest, Newest to oldest ...
SingingEels : Dynamically Created Controls in ASP.NET Jun 19, 2007 ... Recreate dynamic controls in response to user actions in event handlers. ... Assign unique IDs to dynamically created controls. ...
Creating dynamic controls with events - Software Development I wonder if it is possible to assign an event management control to a dynamically created AFTER the Page_Load? The control is created as expected but the ...
C#.NET Insert Dynamic Controls Into Middle of Controls Collection ... If i didn't have to handle events from these dynamic controls this ... Obviously , on a postback, the controls have to have their unique IDs assigned, ...
Dynamic Event(e.g. Button Click) creating and handling in C# ASP ... Here this article on dynamic event assignment will explain you how the ASP. ... method is going to call again and event will be assigned as per the code. ... I was trying for a long time to locate which dynamically created control ...

Programmatically adding ASP.net User Control to Partial Page ... This is more a dynamic controls problem than an AJAX problem. .... Instead of using the click event to call the LoadUserControl function, I did this: ..... ViewState["blah"] is null if that value has never been assigned, ...
CompositeDataBoundControl and PerformSelect - ng.asp-net-forum ... It assigns the data from the GetData method of the data source control to the .... dynamically assigned events to dynamic controls ยท Privacy | Contact Us ...

Videos:
Hour of the Furnaces - 2 of 3 A classic protest film by Fernando Solanas. Part 2 of 3. SUBTERRANEAN CINEMA http://subcin.com THE SUBTERRANEAN COLLECTION http ...
Hora de los Hornos - The Hour of Furnaces (Ep.2) 2
the Healing begins NOW (closed captioned) by Jonathan / adampants The Healing Begins Now is a great audio session from the "Reconnecting to Spirit" series by Jonathan (aka adampants). He shares his lessons from ...
Long Beach City Council Meeting Long Beach City Council Meeting
Long Beach City Council Meeting Long Beach City Council Meeting






need hosting with full trust level

adding controls in response to postbacks

hosting support crystal reports for visual studio 2005 !!??

ispostback and viewstate not initialized in composite control

child lists (again i know)....

user control from code behind page failure

saas / application hosting with windows terminalsever 2003

how do i enable thead/tbody output for a system.web.ui.webcontrols.table?

question: active frame does not support this element 'asp:listitem' ?

weird behavior with datagrid-like control

dropdownmenu in a custom control

including asp files in asp.net projects

problems with viewstate

urgent please: i'm frustrated with creating a server control - some sort of a listcontrol, please help me!

get embedded image from dll and display it in the html form

persisting collection item in a server control

how to host an asp.net 2.0 website on 2003 server iis 6.0

loding a usercontrol winth in an other user control

calendar control, how to modify the day mon, tue etc.. display

email validation

debugging client side !!

validators within composite control

asp.net 3.5 extensions host services

template control

creating a tab control using ie controls,not getting it in correct form

problems with placeholder control

datagrid paging in server control

context meu within my composite control

custom control class name?

need help with trouble shooting viewing asp with iis

   
  Privacy | Contact Us
All Times Are GMT