473,405 Members | 2,421 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

button in the usercontrol

I'm working in VS2003 VB.NET environment.
I created a based class template (BasePage) and there is a new aspx
win form (winform1.aspx)
inheriting BasePage.

In winform1.aspx I have added a new usercontrol uc1 and in uc1 I have
a textbox and a
save button (btn_Save).

When I click the save button the btnSave_Click event doesn't fire.
Only second time I click it does.

What am I doing wrong? I need to save the usercontrol data and I was
thinking to put the
code inside my uc1.

Thanks,
xke

Feb 1 '07 #1
4 1810
On Feb 1, 9:42 am, xke...@gmail.com wrote:
I'm working in VS2003 VB.NET environment.
I created a based class template (BasePage) and there is a new aspx
win form (winform1.aspx)
inheriting BasePage.

In winform1.aspx I have added a new usercontrol uc1 and in uc1 I have
a textbox and a
save button (btn_Save).

When I click the save button the btnSave_Click event doesn't fire.
Only second time I click it does.

What am I doing wrong? I need to save the usercontrol data and I was
thinking to put the
code inside my uc1.

Thanks,
xke
Is it PostingBack on the first click?

Thanks,

Seth Rowe

Feb 1 '07 #2
Yes it does PostBack into Page_Load event on both usercontrol and the
winform.aspx parent page.


On Feb 1, 10:19 am, "rowe_newsgroups" <rowe_em...@yahoo.comwrote:
On Feb 1, 9:42 am, xke...@gmail.com wrote:


I'm working in VS2003 VB.NET environment.
I created a based class template (BasePage) and there is a new aspx
win form (winform1.aspx)
inheriting BasePage.
In winform1.aspx I have added a new usercontrol uc1 and in uc1 I have
a textbox and a
save button (btn_Save).
When I click the save button the btnSave_Click event doesn't fire.
Only second time I click it does.
What am I doing wrong? I need to save the usercontrol data and I was
thinking to put the
code inside my uc1.
Thanks,
xke

Is it PostingBack on the first click?

Thanks,

Seth Rowe- Hide quoted text -

- Show quoted text -

Feb 1 '07 #3
On Feb 1, 11:39 am, xke...@gmail.com wrote:
Yes it does PostBack into Page_Load event on both usercontrol and the
winform.aspx parent page.

On Feb 1, 10:19 am, "rowe_newsgroups" <rowe_em...@yahoo.comwrote:
On Feb 1, 9:42 am, xke...@gmail.com wrote:
I'm working in VS2003 VB.NET environment.
I created a based class template (BasePage) and there is a new aspx
win form (winform1.aspx)
inheriting BasePage.
In winform1.aspx I have added a new usercontrol uc1 and in uc1 I have
a textbox and a
save button (btn_Save).
When I click the save button the btnSave_Click event doesn't fire.
Only second time I click it does.
What am I doing wrong? I need to save the usercontrol data and I was
thinking to put the
code inside my uc1.
Thanks,
xke
Is it PostingBack on the first click?
Thanks,
Seth Rowe- Hide quoted text -
- Show quoted text -
Is this UC dynamically added? If so this is a fairly common problem
and is covered multiple times in the asp.net newsgroup. Try out the
below link for some solutions (hopefully) to the problem:

http://groups.google.com/group/micro...rch+this+group

Thanks,

Seth Rowe

Feb 1 '07 #4
Seth, thanks a lot. It did solve my problem.

Instead of
Me.Main.Controls.Add(Me.LoadControl("usercontrol/
myusercontrol.ascx"))

I have specified the ID for the dynamically added control:

mDynamicCtl = Me.LoadControl("usercontrol/
myusercontrol.ascx")
mDynamicCtl.ID = "kbCont"
Me.Main.Controls.Add(mDynamicCtl)

Now it works. Much apreciate your help!!!!!!!

xke

On Feb 1, 11:49 am, "rowe_newsgroups" <rowe_em...@yahoo.comwrote:
On Feb 1, 11:39 am, xke...@gmail.com wrote:


Yes it does PostBack into Page_Load event on both usercontrol and the
winform.aspx parent page.
On Feb 1, 10:19 am, "rowe_newsgroups" <rowe_em...@yahoo.comwrote:
On Feb 1, 9:42 am, xke...@gmail.com wrote:
I'm working in VS2003 VB.NET environment.
I created a based class template (BasePage) and there is a new aspx
win form (winform1.aspx)
inheriting BasePage.
In winform1.aspx I have added a new usercontrol uc1 and in uc1 I have
a textbox and a
save button (btn_Save).
When I click the save button the btnSave_Click event doesn't fire.
Only second time I click it does.
What am I doing wrong? I need to save the usercontrol data and I was
thinking to put the
code inside my uc1.
Thanks,
xke
Is it PostingBack on the first click?
Thanks,
Seth Rowe- Hide quoted text -
- Show quoted text -

Is this UC dynamically added? If so this is a fairly common problem
and is covered multiple times in the asp.net newsgroup. Try out the
below link for some solutions (hopefully) to the problem:

http://groups.google.com/group/micro...framework.aspn...

Thanks,

Seth Rowe- Hide quoted text -

- Show quoted text -

Feb 1 '07 #5

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

Similar topics

4
by: athlonman | last post by:
Hi all!! II'm trying to set the Text of a TextBox in "Form1" when I click a Button in a UserControl. My code is: : public class Form1 : System.Windows.Forms.Form { public...
0
by: Pingo | last post by:
Hi! How do I handle a Page event in my UserControl. My .aspx page contain 5 different buttons and one of them is the SAVE button. All buttons do PostBack to the page but only one should Save...
0
by: Pingo | last post by:
Hi! How do I handle a Page event in my UserControl. My .aspx page contain 5 different buttons and one of them is the SAVE button. All buttons do PostBack to the page but only one should Save...
0
by: Pingo | last post by:
Hi! How do I handle a Page event in my UserControl. My .aspx page contain 5 different buttons and one of them is the SAVE button. All buttons do PostBack to the page but only one should Save...
0
by: Pingo | last post by:
Hi! How do I handle a Page event in my UserControl. My .aspx page contain 5 different buttons and one of them is the SAVE button. All buttons do PostBack to the page but only one should Save...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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...
0
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...

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.