Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > click event is not firing in ascx file within web form

Reply
Thread Tools

click event is not firing in ascx file within web form

 
 
sanju
Guest
Posts: n/a
 
      06-17-2004
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:callcontrol id=callcontrol runat="server"/>

<%@ Register TagPrefix="callcontrol" TagName="callcontrol"
src="callcontrol.ascx" %>

sub logacall(s As Object, e As EventArgs)
dim callcontrol1 as Control
callcontrol1= new callcontrol
LoadControl("callcontroll.ascx")
placeholder1.Controls.Add(callcontrol1)
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


 
Reply With Quote
 
 
 
 
S. Justin Gengo
Guest
Posts: n/a
 
      06-17-2004
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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:callcontrol id=callcontrol runat="server"/>
>
> <%@ Register TagPrefix="callcontrol" TagName="callcontrol"
> src="callcontrol.ascx" %>
>
> sub logacall(s As Object, e As EventArgs)
> dim callcontrol1 as Control
> callcontrol1= new callcontrol
> LoadControl("callcontroll.ascx")
> placeholder1.Controls.Add(callcontrol1)
> 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
>
>



 
Reply With Quote
 
 
 
 
sanju reddy
Guest
Posts: n/a
 
      06-17-2004


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!
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
dynamic loaded ascx delegate event not firing in parent form CMELLO@tams.com ASP .Net Building Controls 1 09-12-2008 06:20 PM
dynamic loaded datalist ascx event delegate not firing in parent f cindy ASP .Net 0 09-09-2008 04:16 PM
User Control Button Click event not firing when placed in a Web form ~~~ .NET Ed ~~~ ASP .Net 3 09-08-2008 05:36 AM
Wire up a click event within another click event doesn't work... Chu ASP .Net 2 04-10-2006 10:43 PM
TabStrip/Multipage using UserControl (.ascx) contained within a UserControl(.ascx) shaileenpatel@yahoo.com ASP .Net Web Controls 2 05-03-2005 05:01 PM



Advertisments