473,804 Members | 3,742 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1829
On Feb 1, 9:42 am, xke...@gmail.co m 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_newsgroup s" <rowe_em...@yah oo.comwrote:
On Feb 1, 9:42 am, xke...@gmail.co m 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.co m 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_newsgroup s" <rowe_em...@yah oo.comwrote:
On Feb 1, 9:42 am, xke...@gmail.co m 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.Control s.Add(Me.LoadCo ntrol("usercont rol/
myusercontrol.a scx"))

I have specified the ID for the dynamically added control:

mDynamicCtl = Me.LoadControl( "usercontro l/
myusercontrol.a scx")
mDynamicCtl.ID = "kbCont"
Me.Main.Control s.Add(mDynamicC tl)

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

xke

On Feb 1, 11:49 am, "rowe_newsgroup s" <rowe_em...@yah oo.comwrote:
On Feb 1, 11:39 am, xke...@gmail.co m 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_newsgroup s" <rowe_em...@yah oo.comwrote:
On Feb 1, 9:42 am, xke...@gmail.co m 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
14485
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 System.Windows.Forms.TextBox textBox1; private WindowsApplication1.UserControl1 userControl11;
0
1424
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 the data in the forms. I want my UserControl to know when the SAVE button is clicked. example:
0
1115
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 the data in the forms. I want my UserControl to know when the SAVE button is clicked. example:
0
226
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 the data in the forms. I want my UserControl to know when the SAVE button is clicked. example:
0
232
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 the data in the forms. I want my UserControl to know when the SAVE button is clicked. example:
0
9704
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10561
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10302
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10069
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7608
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6845
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5639
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4277
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3803
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.