Page 1 of 1

Displaying Communication Preferences in Order Admin Default

Posted: Tue Sep 16, 2008 12:35 pm
by voir
I was semi successful in displaying Communication Preferences in Order Admin Default.aspx, but I run into a problem once the Search button is clicked... my UserControl with the communication preference data disappears.

I created a email list "Do not trade/share my information with other organizations" so the customer sees this under Communication Preferences when they checkout. In Order Admin under the Details link I add my usercontrol

Code: Select all

<uc:CommunicationPreferencesByUserSection ID="CommPref" runat="server" UserEmail='<%# GetUserEmail(Container.DataItem) %>' />
which gets and displays the email list checkbox (enabled=false so it's display only) it works great until you click the search button then it just goes away ... if you leave the page and come back to it the preferences are back again. I don't really want to add a redirect back to the same page when the search button is clicked, can anyone shed some light on what is happening and/or offer alternatives to redirect/refresh?

Re: Displaying Communication Preferences in Order Admin Default

Posted: Wed Sep 17, 2008 1:09 am
by mazhar
It would be lot more helpful if you post the complete code here.

Re: Displaying Communication Preferences in Order Admin Default

Posted: Wed Sep 17, 2008 9:05 am
by voir
mazhar wrote:It would be lot more helpful if you post the complete code here.
Ah, I figured it out :oops: I moved away from

Code: Select all

<%@ Register Src="~/ConLib/CommunicationPreferencesByUserSection.ascx" TagName="CommunicationPreferencesByUserSection" TagPrefix="uc" %>
since all I really want to do is create the control programatically in the grid I use

Code: Select all

<%@ Reference Control="~/ConLib/CommunicationPreferencesByUserSection.ascx" %>
and in OrderGrid_RowDataBound I create the controls in placeholders like Payment and Shipment status

Code: Select all

            PlaceHolder phCommPref = PageHelper.RecursiveFindControl(e.Row, "phCommPref") as PlaceHolder;
            if (phCommPref != null)
            {
                ASP.conlib_communicationpreferencesbyusersection_ascx CommPref = new ASP.conlib_communicationpreferencesbyusersection_ascx();
                CommPref.UserEmail = order.User.Email;
                phCommPref.Controls.Add(CommPref);
            }
Thank you anyway