Hi
Changed the ModeChanged method (plse see below).
Got this: "Extender controls may not be registered after PreRender." on this ine:
addressODS.SelectParameter
Main Topics
Browse All Topics Greetings all
I have a page that conatins a listbox (holds people names) and two formviews (each linked to an ObjectDataSource) - one that holds the selected person's personal details and one that holds their address details. As the user scrolls up/down the listbox, the corresponding details are displayed -- no problem with that.
When the user clicks the Insert button on the personal details (ie they want to create a new person, the personal details formview displays the InsertTemplate without any problem. The address formview needs to display the EmptyTemplate, as the select should have no data.
In the person formview's ModeChanged method (see attached), I have confirmed that its CurrentMode = Insert. I then I call the Select method of the address ODS. Control then passes to the OnSelecting method of the address ODS. Here I check the CurrentMode of the person formview, before setting the parameter to zero (if the person formview CurrentMode = Insert) - PROBLEM -- the CurrentMode is ReadOnly -- so the wrong code is executed. When execution retuirns to the person formview's ModeChanged method, the CurrentMode is back to Insert.
As an experiment I created a priuvate variable, at the class level and then set it's value to the CurrentMode of the person fromview , in the person formview's ModeCHanged method. Then, in the addres ODS's Selecting method, I check that value and it is null -- almost as if it's doing another postback - yet, I have a break in the Page_Load method and it isn;t hitting that.
Any thoughts on what I'm missing?
In advance, thanks!!
allanmark
CODE BEHIND:
protected void addressODS_Selecting(objec
{
string beforeSelect = fvSpousal.CurrentMode.ToSt
if (fvSpousal.CurrentMode == FormViewMode.Insert)
{
e.InputParameters["CoupleI
}
else
{
Greetings all
I have a page that conatins a listbox (holds people names) and two formviews (each linked to an ObjectDataSource) - one that holds the selected person's personal details and one that holds their address details. As the user scrolls up/down the listbox, the corresponding details are displayed -- no problem with that.
When the user clicks the Insert button on the personal details (ie they want to create a new person, the personal details formview displays the InsertTemplate without any problem. The address formview needs to display the EmptyTemplate, as the select should have no data.
In the person formview's ModeChanged method (see attached), I have confirmed that its CurrentMode = Insert. I then I call the Select method of the address ODS. Control then passes to the OnSelecting method of the address ODS. Here I check the CurrentMode of the person formview, before setting the parameter to zero (if the person formview CurrentMode = Insert) - PROBLEM -- the CurrentMode is ReadOnly -- so the wrong code is executed. When execution retuirns to the person formview's ModeChanged method, the CurrentMode is back to Insert.
Any thoughts on what I'm missing?
In advance, thanks!!
allanmark
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Can do that, but "On_selecting" may still have to give a value, eg if you scroll from one name to the next, you'd do a DataBind. Then, "On_seelcting" would have to determine if it was an Insertion and if not, take the DataKey from the Personal details formview.
I am just confused taht "fvSpousalStatus ", set in ModeChanged, has a null value in On_Selecting and yet has it s value back after control returns to ModeChanged. Having stepped through, using <F11> I am certain that it that "addressODS.Select(" sends control straight to the OnSelecting method and that no postback is occurring.
Business Accounts
Answer for Membership
by: non_zeroPosted on 2009-05-26 at 23:05:47ID: 24480205
Why not leaving this to .Net Itself.. if detail become InsertMode.. and if u set the parameter of the address view to an unused value 1st form ll be insert mode and second one ll be empty