473,569 Members | 2,701 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

click event is not firing in ascx file within web form

hi there i am trying to fire an button event in ascx file which interacts
with database ,my problem is " i am calling ascx file wiht a button click
dynamically when user needs to update database in aspx page , but the the
update button in ascx is not firing .. ..

but it is working fine when i call ascx like this manually.

'<callcontrol:c allcontrol id=callcontrol runat="server"/>

<%@ Register TagPrefix="call control" TagName="callco ntrol"
src="callcontro l.ascx" %>

sub logacall(s As Object, e As EventArgs)
dim callcontrol1 as Control
callcontrol1= new callcontrol
LoadControl("ca llcontroll.ascx ")
placeholder1.Co ntrols.Add(call control1)
end sub


plz help me in this regard i am trying since days to sort this.. i want to
load ascx file when a user needs.

sanju
Nov 18 '05 #1
2 7212
sanju,

When you add a control to a page dynamically, it needs to be added again on
postback in order for that control's events to fire on postback.

I have some sample code for dynamically adding controls that may be helpful
for you to look at. In the code library of my site, www.aboutfortunate.com,
use the search box and search for: dynamic controls. You'll get a few useful
samples.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"sanju" <sa**********@x tra.co.nz> wrote in message
news:u2******** ******@TK2MSFTN GP10.phx.gbl...
hi there i am trying to fire an button event in ascx file which interacts
with database ,my problem is " i am calling ascx file wiht a button click
dynamically when user needs to update database in aspx page , but the the
update button in ascx is not firing .. ..

but it is working fine when i call ascx like this manually.

'<callcontrol:c allcontrol id=callcontrol runat="server"/>

<%@ Register TagPrefix="call control" TagName="callco ntrol"
src="callcontro l.ascx" %>

sub logacall(s As Object, e As EventArgs)
dim callcontrol1 as Control
callcontrol1= new callcontrol
LoadControl("ca llcontroll.ascx ")
placeholder1.Co ntrols.Add(call control1)
end sub


plz help me in this regard i am trying since days to sort this.. i want to
load ascx file when a user needs.

sanju

Nov 18 '05 #2


thank u very much justin.. i got it event firing in ascx ..now its
working fine.. thank u very much,and the site is really helpful.

cheers
sanju

*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
2553
by: Tim Thomas | last post by:
Hi, I am very new to .NET and am in the process of building my first web application. I will briefly describe what i am trying to achieve: I have a system where suppliers register their details, their locations, and then add themselves to categories. Each category requires additional info from the suppliers, this additional category info...
1
8143
by: Earl Teigrob | last post by:
PROBLEM: When a user control is loaded into a PlaceHolder control more than once, the events do not fire on the first click of a control on the dynamically loaded user control. In other words, the first time the control is dynamically loaded, everything works fine. After that, if the control is loaded again from the page button event handler,...
2
9837
by: ~~~ .NET Ed ~~~ | last post by:
I have a problem (don't we all?). I have a web form with multiple modules, some of these modules have an ASP.NET (server run) button. OK, now I have UserControlX which has one such button (say Login). In that user control I defined both the Command and Click events for the button and placed a break point on it (in addition to traces). This...
1
311
by: Luis Esteban Valencia Muñoz | last post by:
Hello Experts, I have three classes: Globals.cs, FunctionalArea.ascx.cs, and ReprotList.ascx.cs. The idea is that when one drop down is changed (i.e. Functional Area), another drop down on the page (Reports) would get updated. Both of theses are controls in the same web form. In Globals.cs:
2
4868
by: Curt_C [MVP] | last post by:
I've got a Repeater and within it a LinkButton. The LinkButton has an CommandName="Test" In the Repeater's ItemCommand event I want to check for this command name but the problem I'm having is that the ItemCommand event is not firing the first time the LinkButton is clicked. 2nd-(n)times after it's fine but the FIRST time it's clicked I get...
4
4180
by: TS | last post by:
I am creating a User control and i create some dynamic controls in the init handler. one of the controls is a custom validator which i assign a serverValidate event handler. I usally always do my controls as custom server controls and don't understand why this event won't fire. I figured if the creation of the control was in the init, it...
0
1508
by: =?Utf-8?B?Smlt?= | last post by:
I have an application that was built using asp.net 1.1. The application interviews the user with a parent form that loads a series of web user controls (.ascx files)dynamically with page.loadcontrol. It needs to be dynamic because the next user control loaded is based on the answer to the previous question. The application has worked...
1
3094
by: Andrew Jocelyn | last post by:
Hi I have a Formview control in a UserControl. The server-side validation is not working, i.e. the events are not firing when a button control which causes validation is fired or even when Page.Validate() is explicitly called. I'm loading the FormView as an IBindableTemplate as in this article but I don't think this is the reason for the...
1
4283
by: \Ji Zhou [MSFT]\ | last post by:
Hello Jason, Thanks for using Microsoft Newsgroup Support Service, my name is Ji Zhou and I will be working on this issue with you. I have tried to but cannot reproduce your issue on my side. From your codes, I think the logical is, every time the Timer's elapsed event fires, we call the Check_For_Version_Update() function. From the...
0
7697
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7612
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7968
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6283
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5512
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3653
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3640
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1212
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
937
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.