Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Parent Postback from User Control

Status
Not open for further replies.

PNeems

Programmer
May 17, 2008
19
US
I am created a user profile page. The page needs certrain criteria to be filled out before advancing to the next page. So there is code in the parent page the control is being used in to check this criteria. However when the person edits it the edit and update button are all done in the control so it doesnt postback the main page and it doesnt check the criteria again unless you manually refresh the page. How do i make the update of the control cause a postback of the parent page? Does anyone know?

Thanks
 
maybe it's me, but your statement isn't that easy to follow. it could be that your page is responsible for too many functions. if the page flow is different for adding vs. editing then you should consider making 2 seperate pages; 1. add profile, 2. edit profile.

if you post the relevant code this would also be more beneficial that talking about the code.

Jason Meckley
Programmer
Specialty Bakers, Inc.
 
jmeckley,
Thanks for the reply. Let me try explaining it better. Basically I am using a FormView Object on the control and there is an items template and an edit item template. The control is then on different pages. One of the pages looks at some of the values on page load and determine whether to show or hide a button. If there is a missing address then the button will not show up. If the person edits the user control and then adds an address the button should become visiable; however, it doesnt because the page load event dont occur again because the edit in the control doesnt not postback the parent page which has the page load events. I want to make this occur so the update button in the form view in the control will cause a postback on the parent page so the page load events will occur again.

DOes this make more sense?
 
ok, that helps.

a couple options.
1. use css to show/hide button in stead of code-behind not generating the button at all. wire some js to textboxes or whatever control would add the address and your set.

2. you need a control to postback to the server after the address is added. most web server controls have an auto-postback property. set this to true and use the default event to make the button visible.

3. make the save button always show and use field validators (rquired or custom) to validate the fields.

Jason Meckley
Programmer
Specialty Bakers, Inc.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top