PC Review


Reply
Thread Tools Rate Thread

button in the usercontrol

 
 
xkeops@gmail.com
Guest
Posts: n/a
 
      1st Feb 2007
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

 
Reply With Quote
 
 
 
 
rowe_newsgroups
Guest
Posts: n/a
 
      1st Feb 2007
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

 
Reply With Quote
 
xkeops@gmail.com
Guest
Posts: n/a
 
      1st Feb 2007
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.com> wrote:
> 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 -



 
Reply With Quote
 
rowe_newsgroups
Guest
Posts: n/a
 
      1st Feb 2007
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.com> wrote:
>
> > 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

 
Reply With Quote
 
xkeops@gmail.com
Guest
Posts: n/a
 
      1st Feb 2007
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.com> wrote:
> 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.com> wrote:

>
> > > 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 -



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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
OnClick from UserControl Button =?Utf-8?B?RGlhbW9uZERhdmU=?= Microsoft Dot NET Framework Forms 5 31st Jul 2005 04:27 PM
Button in UserControl Question Patrick.O.Ige Microsoft ASP .NET 0 7th Jul 2005 01:07 PM
Button in usercontrol. =?Utf-8?B?TWFsZG9uYWRv?= Microsoft ASP .NET 0 24th Mar 2005 01:35 AM
UserControl inheritting from Button sotto Microsoft VB .NET 3 24th Dec 2003 06:59 PM
UserControl inheritting from Button sotto Microsoft VB .NET 1 24th Dec 2003 04:58 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:47 PM.