button in the usercontrol

X

xkeops

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
 
R

rowe_newsgroups

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
 
X

xkeops

Yes it does PostBack into Page_Load event on both usercontrol and the
winform.aspx parent page.
 
X

xkeops

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top