Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 3.5 > ASP.NET 3.5 Basics
|
ASP.NET 3.5 Basics If you are new to ASP or ASP.NET programming with version 3.5, this is the forum to begin asking questions. Please also see the Visual Web Developer 2008 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 3.5 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 17th, 2011, 04:58 AM
Authorized User
 
Join Date: Oct 2010
Posts: 17
Thanks: 0
Thanked 1 Time in 1 Post
Post UserControl not capturing Button click event when loaded with PlaceHolder Control

This is first times i met an error like this .I have also tried to find, but it is not successfully.
This is the whole my code
Here is my code
default.aspx.cs
protected void Page_Load(object sender, EventArgs e)
{
if (!base.IsPostBack)
{
switch (((base.Request.QueryString["Page"] != null) ? base.Request.QueryString["Page"].ToUpper() : "HOME"))
{
case "CONTACT":
phdDefault.Controls.Clear();
Control myUserControl = (Control)Page.LoadControl("Modules/WebUserControl.ascx");

phdDefault.Controls.Add(myUserControl);

break;
}
}
}

WebUserControl.ascx.cs


<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<asp:Button ID="Button1" runat="server" Text="Button" onclick="Button1_Click" />
<asp:Label ID="Label1" runat="server"></asp:Label>
Code behind

protected void Button1_Click(object sender, EventArgs e)
{
// OnBubbleClick(e);
TextBox1.Text = "";
Label1.Text = "What is this an error ?";
}

Do not capture the value. on Button click

Please help me

Thanks
Phuc Hoang





Similar Threads
Thread Thread Starter Forum Replies Last Post
Click event not firing for Dynamic button control when it has validation control Gayathri79 ASP.NET 3.5 Basics 5 August 20th, 2010 06:58 PM
Capturing Button Click in Page_Init? jlrolin ASP.NET 1.0 and 1.1 Professional 3 February 22nd, 2007 03:38 PM
Duplicate Control Creation on button click event kapi.goel C# 1 December 21st, 2005 02:42 PM
Capturing Mouse Click Event whiterainbow ASP.NET 1.0 and 1.1 Professional 1 December 8th, 2005 01:44 AM
Capturing the Control + C event Sammy8932 Access VBA 8 June 8th, 2005 09:05 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.