更改gridview索引时加载总页面 [英] Loading total page while changing the gridview index

查看:59
本文介绍了更改gridview索引时加载总页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在jquery标签中使用,在其中的一个标签中有一个具有gridview的gridview,而gridview具有分页,而尝试更改分页时,它将加载整个页面..这是我的源代码,请帮助我. ..
谢谢你的adv ........

Hi,i am usin jquery tab and in that tabs one of tab is having the gridview that gridview having the paging,while trying to change the paging,it loads whole page..here is my source and code please help me...
thank u in adv........

<%@ Control Language="C#" AutoEventWireup="true" Inherits="TI.Membership.Web.members.controls.BusinessMembershipInfo"
    CodeBehind="BusinessMembershipInfo.ascx.cs" %>
<%@ Import Namespace="Vascape.DataLayer" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<%@ Register TagName="SubscriptionInfo" TagPrefix="uc1" Src="~/TIControls/SubscriptionInfo.ascx" %>
<div class="userInfoWrap" style="height: 900px">
    <%-- ajax update panel start --%>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <contenttemplate>
            <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css"
                rel="stylesheet" type="text/css" />
            <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
            <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
            <%-- <link type="text/css" href="http://ajax.microsoft.com/ajax/jquery.ui/1.8.9/themes/blitzer/jquery-ui.css"
        rel="Stylesheet"  />
    <script type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/jquery/jquery-1.4.4.js"></script>
    <script type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/jquery.ui/1.8.9/jquery-ui.min.js"></script>--%>
            <script type="text/javascript">
                $(function () {
                    $("#myTabs").tabs({ fx: { opacity: "toggle"} });

                                });
              
            </script>
            </head>
            <body>
                <div class="Container">
                    <div class="TabPanelHeaderText" id="myTabs" style="width: 900px; height: 40px; font-size: small;">
                        <div class="ContentTemplate">
                            <ul class="tabs">
                                <li><a href="#ChangePassword">ChangePassword</a></li>
                                <li><a href="#ChangeEmail">ChangeEmail</a></li>
                                <li><a href="#EditProfile">EditProfile</a></li>
                                <li><a href="#Business">Business</a></li>
                                <li><a href="#Notifications">Notifications</a></li>
                            </ul>
                            <uc1:SubscriptionInfo ID="ucSubscriptionInfo"  runat="server" Font-Size="13px" CssClass="aTab1">
                            
                            <%-- ajax tab container start --%>
                            <%-- <cc1:TabContainer ID="tcntUserInfo"  runat="server" ActiveTabIndex="5" Font-Size="13px"
                CssClass="aTab1">--%>
                            <div id="ChangePassword" class="tab_content">
                                <%--<cc1:TabPanel ID="TabPanel1"  runat="server" HeaderText="ChangePassword">
                    <contenttemplate>
                        <br />
                        <br />
                        <br />--%>
                                <div class="contentTemplate" align="center">
                                    <br />
                                    <div class="formSectionTitle2" align="center" style="font-size: large">
                                        PASSWORD DETAILS
                                    </div>
                                    <asp:ChangePassword ID="ChangePassword1" runat="server" EnableViewState="False" ContinueDestinationPageUrl="~/login.aspx">
                                        <maildefinition bodyfilename="~/email_templates/change-password.htm" isbodyhtml="True">
                                            Subject="Your password has been changed!">
                                        </maildefinition>
                                    
                                </div>
                                <%--  </contenttemplate>
             --%>
                            </div>
                            <div id="ChangeEmail" class="tab_content">
                                <%-- <cc1:TabPanel ID="TabPanel2"  runat="server" HeaderText="ChangeEmail">
                    <contenttemplate>
                        <br />
                        <br />
                        <br />
                        <br />--%>
                                <div class="contentTemplate" align="center">
                                    <div class="formSectionTitle2" align="center" style="font-size: large">
                                        USER DETAILS
                                    </div>
                                    <asp:DetailsView AutoGenerateRows="False" DataSourceID="ObjectDataSource1" ID="DetailsView1"
                                        runat="server" OnItemUpdating="DetailsView1_ItemUpdating" CssClass="dv">
                                        <fields>
                                            <asp:BoundField DataField="UserName" HeaderText="UserName" ReadOnly="True" SortExpression="UserName">
                                            
                                            <asp:TemplateField HeaderText="Email" SortExpression="Email">
                                                <edititemtemplate>
                                                    <asp:TextBox ID="TextBox1" runat="server" Text=''<%# Bind("Email") %>''>
                                                    <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="TextBox1"
                                                        Display="Dynamic" ErrorMessage="Email only!" ValidationExpression="\w+([-+.'']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*">
                                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="TextBox1"
                                                        Display="Dynamic" ErrorMessage="Email is required!" SetFocusOnError="True">
                                                </edititemtemplate>
                                                <insertitemtemplate>
                                                    <asp:TextBox ID="TextBox1" runat="server" Text=''<%# Bind("Email") %>''>
                                                </insertitemtemplate>
                                                <itemtemplate>
                                                    <asp:Label ID="Label1" runat="server" Text=''<%# Bind("Email") %>''>
                                                </itemtemplate>
                                            
                                            <asp:BoundField DataField="CreationDate" HeaderText="Creation Date" SortExpression="CreationDate"
                                                ReadOnly="True">
                                            <asp:BoundField DataField="LastActivityDate" HeaderText="Last Activity Date" SortExpression="LastActivityDate"
                                                ReadOnly="True">
                                            <asp:CheckBoxField DataField="IsOnline" HeaderText="Online?" SortExpression="IsOnline"
                                                ReadOnly="True">
                                            <asp:CheckBoxField DataField="IsApproved" HeaderText="Approved?" SortExpression="IsApproved"
                                                ReadOnly="True">
                                            <asp:CheckBoxField DataField="IsLockedOut" HeaderText="Locked Out?" SortExpression="IsLockedOut"
                                                ReadOnly="True">
                                            <asp:BoundField DataField="PasswordQuestion" HeaderText="Password Question" ReadOnly="True"
                                                SortExpression="PasswordQuestion">
                                            <asp:BoundField DataField="LastLoginDate" HeaderText="Last Login Date" SortExpression="LastLoginDate"
                                                ReadOnly="True">
                                            <asp:BoundField DataField="LastLockoutDate" HeaderText="Last Lockout Date" ReadOnly="True"
                                                SortExpression="LastLockoutDate">
                                            <asp:BoundField DataField="LastPasswordChangedDate" HeaderText="Last Password Changed Date"
                                                ReadOnly="True" SortExpression="LastPasswordChangedDate">
                                            <asp:CommandField ButtonType="Button" ShowEditButton="True" EditText="Edit User Details">
                                                <controlstyle font-size="11px" />
                                            
                                        </fields>
                                        <rowstyle cssclass="dvRowStyle" />
                                        <fieldheaderstyle cssclass="dvFieldHeader" />
                                        <HeaderStyle CssClass="dvHeader" />
                                        <alternatingrowstyle cssclass="dvAlternateRowStyle" />
                                    
                                    <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" DataObjectTypeName="System.Web.Security.MembershipUser"
                                        SelectMethod="GetUser" TypeName="System.Web.Security.Membership">
                                    <br />
                                    <br />
                                    <asp:Button ID="btnDeleteCurrentUser" runat="server" Text="Close and Delete my account"
                                        OnClick="btnDeleteCurrentUser_Click" OnClientClick="return confirm(''Are you sure? This action will delete all your information and is unrecoverable.'');" />
                                    <br />
                                    <asp:Label ID="lblResult" runat="server" Visible="False" BackColor="Red" />
                                </div>
                                <%--   </contenttemplate>
                --%>
                            </div>
                            <div id="EditProfile" class="tab_content">
                                <%--<cc1:TabPanel ID="TabPanel3"  runat="server" HeaderText="EditProfile">
                    <contenttemplate>
                        <br />
                        <br />--%>
                                <div id="tabId" align="center" style="width: 960px; font: 100%/1.4 Verdana, Arial, Helvetica, sans-serif;<br mode=" hold=" />                                    text-align: left; padding-left: 20px">
                                    <table align="center">
                                        <div align="center" style="font-size: large">
                                            <caption>
                                                ABOUT YOU
                                                <br />
                                            </caption>
                                        </div>
                                        <caption>
                                            <br />
                                            <tr>
                                                <td align="left" colspan="2">
                                                    <label for="txtFirstname">
                                                    First name</label><br />
                                                    <asp:TextBox ID="txtFirstName" runat="server" align="right" Width="400px" />
                                                </td>
                                                <td align="left" colspan="2">
                                                    <label for="txtLastname">
                                                    Last name</label><br />
                                                    <asp:TextBox ID="txtLastName" runat="server" Width="337px" />
                                                </td>
                                            </tr>
                                            <tr>
                                                <td align="left">
                                                    <label for="txtGender">
                                                    Gender</label>
                                                </td>
                                                <td align="left">
                                                    <asp:DropDownList ID="ddlGenders" runat="server" Width="200px">
                                                        <asp:ListItem Selected="True" Text="Please select one..." />
                                                        <asp:ListItem Text="Male" Value="M" />
                                                        <asp:ListItem Text="Female" Value="F" />
                                                    
                                                </td>
                                                <td>
                                                    <label for="txtBirthdate">
                                                    Birth date</label>
                                                </td>
                                                <td align="left">
                                                    <asp:TextBox ID="txtBirthDate" runat="server" Width="200px">
                                                </td>
                                                <cc1:CalendarExtender ID="txtBirthDate_CalendarExtender"  runat="server" 
                                                    Enabled="True" TargetControlID="txtBirthDate">
                                                
                                                <asp:CompareValidator ID="valBirthDateFormat" runat="server" 
                                                    ControlToValidate="txtBirthDate" Display="Dynamic" 
                                                    ErrorMessage="The format of the birth date is not valid." 
                                                    Operator="DataTypeCheck" SetFocusOnError="True" Type="Date" 
                                                    ValidationGroup="EditProfile">
                                            
                                                <cc1:MaskedEditExtender ID="MaskedEditExtender1"  runat="server" 
                                                    CultureAMPMPlaceholder="" CultureCurrencySymbolPlaceholder="" 
                                                    CultureDateFormat="" CultureDatePlaceholder="" CultureDecimalPlaceholder="" 
                                                    CultureThousandsPlaceholder="" CultureTimePlaceholder="" Enabled="True" 
                                                    Mask="99/99/9999" MaskType="Date" TargetControlID="txtBirthDate" />
                                                <cc1:MaskedEditValidator ID="MaskedEditValidator1"  runat="server" 
                                                    ControlExtender="MaskedEditExtender1" ControlToValidate="txtBirthDate" 
                                                    Display="Dynamic" EmptyValueMessage="Date must be in correct format" 
                                                    ErrorMessage="MaskedEditValidator1" InvalidValueMessage="This date is invalid" 
                                                    TooltipMessage="Please enter a date" />
                                            </tr>
                                            <tr>
                                                <td align="left">
                                                    <label for="txtOccupation">
                                                    Occupation</label>
                                                </td>
                                                <td>
                                                    <asp:DropDownList ID="ddlOccupations" runat="server" Width="200px">
                                                        <asp:ListItem Selected="True" Text="Please select one..." />
                                                        <asp:ListItem Text="Academic" />
                                                        <asp:ListItem Text="Accountant" />
                                                        <asp:ListItem Text="Actor" />
                                                        <asp:ListItem Text="Architect" />
                                                        <asp:ListItem Text="Artist" />
                                                        <asp:ListItem Text="Business Manager" />
                                                        <asp:ListItem Text="Carpenter" />
                                                        <asp:ListItem Text="Chief Executive" />
                                                        <asp:ListItem Text="Cinematographer" />
                                                        <asp:ListItem Text="Civil Servant" />
                                                        <asp:ListItem Text="Coach" />
                                                        <asp:ListItem Text="Composer" />
                                                        <asp:ListItem Text="Computer programmer" />
                                                        <asp:ListItem Text="Cook" />
                                                        <asp:ListItem Text="Counsellor" />
                                                        <asp:ListItem Text="Doctor" />
                                                        <asp:ListItem Text="Driver" />
                                                        <asp:ListItem Text="Economist" />
                                                        <asp:ListItem Text="Editor" />
                                                        <asp:ListItem Text="Electrician" />
                                                        <asp:ListItem Text="Engineer" />
                                                        <asp:ListItem Text="Executive Producer" />
                                                        <asp:ListItem Text="Fixer" />
                                                        <asp:ListItem Text="Graphic Designer" />
                                                        <asp:ListItem Text="Hairdresser" />
                                                        <asp:ListItem Text="Headhunter" />
                                                        <asp:ListItem Text="HR - Recruitment" />
                                                        <asp:ListItem Text="Information Officer" />
                                                        <asp:ListItem Text="IT Consultant" />
                                                        <asp:ListItem Text="Journalist" />
                                                        <asp:ListItem Text="Lawyer / Solicitor" />
                                                        <asp:ListItem Text="Lecturer" />
                                                        <asp:ListItem Text="Librarian" />
                                                        <asp:ListItem Text="Mechanic" />
                                                        <asp:ListItem Text="Model" />
                                                        <asp:ListItem Text="Musician" />
                                                        <asp:ListItem Text="Office Worker" />
                                                        <asp:ListItem Text="Performer" />
                                                        <asp:ListItem Text="Photographer" />
                                                        <asp:ListItem Text="Presenter" />
                                                        <asp:ListItem Text="Producer / Director" />
                                                        <asp:ListItem Text="Project Manager" />
                                                        <asp:ListItem Text="Researcher" />
                                                        <asp:ListItem Text="Salesman" />
                                                        <asp:ListItem Text="Social Worker" />
                                                        <asp:ListItem Text="Soldier" />
                                                        <asp:ListItem Text="Sportsperson" />
                                                        <asp:ListItem Text="Student" />
                                                        <asp:ListItem Text="Teacher" />
                                                        <asp:ListItem Text="Technical Crew" />
                                                        <asp:ListItem Text="Technical Writer" />
                                                        <asp:ListItem Text="Therapist" />
                                                        <asp:ListItem Text="Translator" />
                                                        <asp:ListItem Text="Waitress / Waiter" />
                                                        <asp:ListItem Text="Web designer / author" />
                                                        <asp:ListItem Text="Writer" />
                                                        <asp:ListItem Text="Other" />
                                                    
                                                </td>
                                            </tr>
                                            <tr>
                                                <td align="left" colspan="2">
                                                    <label for="txtPersonalWebsite">
                                                    Personal Website</label><br />
                                                    <asp:TextBox ID="txtWebsite" runat="server" hight="50px" Width="400px" />
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>
                                                    <label for="txtCountry">
                                                    Country</label>
                                                </td>
                                                <td>
                                                    <asp:DropDownList ID="ddlCountries" runat="server" AppendDataBoundItems="True" 
                                                        Width="200px">
                                                        <asp:ListItem Selected="True" Text="Please select one..." />
                                                    
                                                </td>
                                            </tr>
                                            <tr>
                                                <td align="left" colspan="2">
                                                    <label for="txtAddress">
                                                    Address</label><br />
                                                    <asp:TextBox ID="txtAddress" runat="server" TextMode="MultiLine" 
                                                        Width="400px" />
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>
                                                    <label for="txtApartmentNumber">
                                                    Apartment Number</label>
                                                </td>
                                                <td align="left">
                                                    <asp:TextBox ID="txtAptNumber" runat="server" Width="200px" />
                                                </td>
                                                <td>
                                                    <label for="txtCity">
                                                    City</label>
                                                </td>
                                                <td>
                                                    <asp:TextBox ID="txtCity" runat="server" Width="200px" />
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>
                                                    <label for="txtState / Region">
                                                    State / Region</label>
                                                </td>
                                                <td>
                                                    <asp:DropDownList ID="ddlStates1" runat="server" AppendDataBoundItems="True" 
                                                        Width="200px">
                                                        <asp:ListItem Selected="True" Text="Please select one..." />
                                                    
                                                </td>
                                                <td>
                                                    <label for="txtZip / Postal code">
                                                    Zip / Postal code</label>
                                                </td>
                                                <td>
                                                    <asp:TextBox ID="txtPostalCode" runat="server" Width="200px" />
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>
                                                    <label for="txtCONTACTINFO">
                                                    CONTACT INFO</label>
                                                </td>
                                                <td>
                                                    <asp:TextBox ID="txtContactInfo" runat="server" Width="200px">
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>
                                                    <label for="txtDayTimePhone">
                                                    Day Time Phone</label>
                                                </td>
                                                <td>
                                                    <asp:TextBox ID="txtDayTimePhone" runat="server" Width="200px" />
                                                </td>
                                                <td>
                                                    <label for="txtDayTimePhoneExt">
                                                    Day Time Phone Ext</label>
                                                </td>
                                                <td>
                                                    <asp:TextBox ID="txtDayTimePhoneExt" runat="server" Width="200px" />
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>
                                                    <label for="txtEveningPhone">
                                                    Evening Phone</label>
                                                </td>
                                                <td>
                                                    <asp:TextBox ID="txtEveningPhone" runat="server" Width="200px" />
                                                </td>
                                                <td>
                                                    <label for="txtEveningPhoneExt">
                                                    Evening Phone Ext</label>
                                                </td>
                                                <td>
                                                    <asp:TextBox ID="txtEveningPhoneExt" runat="server" Width="200px" />
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>
                                                    <label for="txtCellPhone">
                                                    CellPhone</label>
                                                </td>
                                                <td>
                                                    <asp:TextBox ID="txtCellPhone" runat="server" Width="200px" />
                                                </td>
                                            </tr>
                                            <tr>
                                                <td align="left" colspan="2">
                                                    <label for="txtEMail">
                                                    EMail</label><br />
                                                    <asp:TextBox ID="txtEMail" runat="server" Width="400px" />
                                                </td>
                                                <td>
                                                    <label for="txtHomeFax">
                                                    Home Fax</label>
                                                </td>
                                                <td>
                                                    <asp:TextBox ID="txtHomeFax" runat="server" Width="200px" />
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>
                                                    <label for="txtCOMPANYDETAILS">
                                                    COMPANY DETAILS</label>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td colspan="2">
                                                    <label for="txtCompanyName">
                                                    Company Name</label>
                                                    <asp:TextBox ID="txtCompanyName" runat="server" Width="300px">
                                                </td>
                                            </tr>
                                            <tr>
                                                <td colspan="2">
                                                    <label for="txtAddress">
                                                    Address</label>
                                                    <asp:TextBox ID="txtCompanyAddress" runat="server" TextMode="MultiLine" 
                                                        Width="350px">
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>
                                                    <label for="txtCity">
                                                    City</label>
                                                </td>
                                                <td>
                                                    <asp:TextBox ID="txtCompanyCity" runat="server" Width="200px" />
                                                </td>
                                                <td>
                                                    <label for="txtState / Region">
                                                    State / Region</label>
                                                </td>
                                                <td>
                                                    <asp:DropDownList ID="ddlStates2" runat="server" align="right" 
                                                        AppendDataBoundItems="True" Width="200px">
                                                        <asp:ListItem Selected="True" Text="Please select one..." />
                                                    
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>
                                                    <label for="txtZip">
                                                    Zip</label>
                                                </td>
                                                <td>
                                                    <asp:TextBox ID="txtCompanyZip" runat="server" Width="200px" />
                                                </td>
                                                <td>
                                                    <label for="txtCountry">
                                                    Country</label>
                                                </td>
                                                <td>
                                                    <asp:DropDownList ID="ddlCountries2" runat="server" AppendDataBoundItems="True" 
                                                        Width="200px">
                                                        <asp:ListItem Selected="True" Text="Please select one..." />
                                                    
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>
                                                    <label for="txtPhone">
                                                    Phone</label>
                                                </td>
                                                <td>
                                                    <asp:TextBox ID="txtCompanyPhone" runat="server" Width="200px" />
                                                </td>
                                                <td>
                                                    <label for="txtFax">
                                                    Fax</label>
                                                </td>
                                                <td>
                                                    <asp:TextBox ID="txtCompanyFax" runat="server" Width="200px" />
                                                </td>
                                            </tr>
                                            <tr>
                                                <td colspan="2">
                                                    <label for="txtEMail">
                                                    EMail</label>
                                                    <asp:TextBox ID="txtCompanyEMail" runat="server" Width="350px" />
                                                </td>
                                            </tr>
                                            <tr>
                                                <td colspan="2">
                                                    <label for="txtWebSite">
                                                    WebSite</label>
                                                    <asp:TextBox ID="txtCompanyWebsite" runat="server" Width="330px" />
                                                </td>
                                            </tr>
                                            <tr>
                                                <td align="right">
                                                    <label for="txtNEWSLETTERSUBSCRIPTION">
                                                    NEWSLETTER SUBSCRIPTION</label>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>
                                                    <label for="txtNewsletter">
                                                    Newsletter</label>
                                                </td>
                                                <td>
                                                    <asp:DropDownList ID="ddlNewsletter" runat="server" Width="200px">
                                                        <asp:ListItem Selected="true" Text="No subscription" Value="None" />
                                                        <asp:ListItem Text="Subscribe to newsletter" Value="Html" />
                                                    
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>
                                                    <asp:Button ID="btnUpdateProfile" runat="server" 
                                                        OnClick="btnUpdateProfile_Click" 
                                                        OnClientClick="return confirm(''This will Update your Profile information..\n\rClick OK to continue.'')" 
                                                        Text="Save Profile" ValidationGroup="EditProfile" />
                                                    <asp:Label ID="lblProfileMessage" runat="server" />
                                                </td>
                                            </tr>
                                        </caption>
                                    </table>
                                </div>
                                <%--      </contenttemplate>
                --%>
                            </div>
                            <div id="Business" class="tab_content">
                                <%--<cc1:TabPanel ID="panelBusiness"  runat="server" HeaderText="Business">
                    <contenttemplate>
                        <br />
                        <br />--%>
                                <table class="contentTemplate" align="center">
                                    <asp:Repeater ID="repeaterBusinessInfo" runat="server">
                                        <HeaderTemplate>
                                            <tr>
                                                <th>
                                                    BusinessID
                                                </th>
                                                <th>
                                                    BusinessName
                                                </th>
                                                <th>
                                                    BusinessAddress
                                                </th>
                                            </tr>
                                        </HeaderTemplate>
                                        <itemtemplate>
                                            <tr>
                                                <td>
                                                    <asp:Label ID="lblBusinessID" runat="server" Text=''<%#((BusinessInfo)(Container.DataItem)).BusinessID%>''>
                                                </td>
                                                <td>
                                                    <a href="../Business/EditBusinessProfile.aspx?BusinessID=<%#((BusinessInfo)(Container.DataItem)).BusinessID%>">
                                                        <%#((BusinessInfo)(Container.DataItem)).BusinessID%>
                                                        <%#((BusinessInfo)(Container.DataItem)).BusinessName%></a>
                                                </td>
                                                <td>
                                                    <%#string.Format("{0} {1}, {2} {3} {4} {5}",((BusinessInfo)(Container.DataItem)).Address1, ((BusinessInfo)(Container.DataItem)).Address2,((BusinessInfo)(Container.DataItem)).City,((BusinessInfo)(Container.DataItem)).State,((BusinessInfo)(Container.DataItem)).Zip,((BusinessInfo)(Container.DataItem)).Country)%>
                                                </td>
                                            </tr>
                                        </itemtemplate>
                                    
                                    
                                    <tr>
                                        <td align="center">
                                            <asp:Button ID="btnNewBusiness" runat="server" Text="New Business" PostBackUrl="~/Business/EditBusinessProfile.aspx?BusinessID=0" />
                                        </td>
                                    </tr>
                                </table>
                                <div align="right" style="margin-removed 40px">
        <asp:HyperLink ID="linkPrev" runat="server"><<  <asp:Label ID="Label1" runat="server">  <asp:HyperLink ID="linkNext" runat="server">>>
             </div>
                                <%-- </contenttemplate>
                --%>
                            </div>
                            <div id="Notifications" class="tab_content">
                                <%--<cc1:TabPanel ID="panelNotifications"  runat="server" HeaderText="Notifications">
                    <contenttemplate>
                        <br />
                        <br />
                        <br />--%>
                                <div align="center">
                                    <table class="contentTemplate" align="center">
                                         <asp:GridView ID="grvNotifications" runat="server" DataKeyNames="NotificationID"
                                    AutoGenerateColumns="False"
                                    PageSize="2" OnPageIndexChanged="grvNotifications_PageIndexChanged"
                      onpageindexchanging="grvNotifications_PageIndexChanging" AllowPaging="True">
                                    <columns>
                                        <asp:TemplateField>
                                            <HeaderTemplate>
                                                <asp:Label ID="lblHeader" Text="Select BusinessName" runat="server" Width="120px" />
                                            </HeaderTemplate>
                                            <itemtemplate>
                                                <asp:LinkButton ID="hlkBusinessName" runat="server" Text=''<%#Eval("Header")%>'' CommandName="Select" />
                                            </itemtemplate>
                                        
                                        <asp:BoundField DataField="NotificationID" HeaderText="NotificationID" />
                                        <asp:BoundField DataField="UserId" HeaderText="UserId" />
                                        <asp:BoundField DataField="NotificationDate" HeaderText="NotificationDate" />
                                    </columns>                                              
                            <footerstyle font-bold="True" />                                              
                           <pagersettings position="Bottom" mode="NextPreviousFirstLast" firstpagetext="<<">
                                            LastPageText=">>" NextPageText=">" PreviousPageText="<" />
                                             <pagerstyle horizontalalign="Right" font-bold="False" font-overline="False">
                                                 Font-Size="Small" ForeColor="Black" Height="5px" />
                                
                                    </pagerstyle></pagersettings></table>
                                </div>
                                <%--   </contenttemplate>
                
            --%>
                            </div>
                        </div>
                    </div>
                </div>
            </contenttemplate></div>


using System;
using System.Collections.Generic;
using System.Web;
using System.Web.Profile;
using System.Web.Security;
using System.Web.UI.WebControls;
using Vascape.DataLayer;
using TI.Membership.Library;
using Vascape.BusinessLayer;

namespace TI.Membership.Web.members.controls
{
    public partial class BusinessMembershipInfo : System.Web.UI.UserControl
    {
        #region on page load get current profile

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                grvNotifications.PageIndex = 0;
                LoadGrid();
                MembershipUser user = System.Web.Security.Membership.GetUser();
                repeaterBusinessInfo.DataSource = BusinessManager.GetBusinessInfos((Guid)user.ProviderUserKey);
                repeaterBusinessInfo.DataBind();
                if (!Page.IsPostBack)
                {
                    PagedDataSource pds = new PagedDataSource();
                    pds.DataSource = BusinessManager.GetBusinessInfos((Guid)user.ProviderUserKey);
                    pds.AllowPaging = true;
                    pds.PageSize = 10;
                    int currentPage;
                    if (Request.QueryString["page"] != null)
                    {
                        currentPage = Int32.Parse(Request.QueryString["page"]);
                    }
                    else
                    {
                        currentPage = 1;
                    }
                    pds.CurrentPageIndex = currentPage - 1;
                    Label1.Text = currentPage + " / " + pds.PageCount;

                    if (!pds.IsFirstPage)
                    {
                        linkPrev.NavigateUrl = Request.CurrentExecutionFilePath + "?page=" + (currentPage - 1);
                    }
                    if (!pds.IsLastPage)
                    {
                        linkNext.NavigateUrl = Request.CurrentExecutionFilePath + "?page=" + (currentPage + 1);
                    }

                    repeaterBusinessInfo.DataSource = pds;
                    repeaterBusinessInfo.DataBind();
                }
            }
            // Get Profile 
            if (!Page.IsPostBack)
            {
                if (Page.User.Identity.IsAuthenticated)
                {
                    // get country names from app_code folder
                    // bind country names to the dropdown list
                    ddlCountries.DataSource = CountryNames.GetCountries();
                    ddlCountries.DataBind();

                    ddlCountries2.DataSource = CountryNames.GetCountries();
                    ddlCountries2.DataBind();

                    // get state names from app_code folder
                    // bind state names to the dropdown lists in address info and company info section
                    ddlStates1.DataSource = StateNames.GetStates();
                    ddlStates1.DataBind();
                    ddlStates2.DataSource = StateNames.GetStates();
                    ddlStates2.DataBind();

                    // get the selected user's profile based on query string

                    ProfileCommon profile = null;
                    if (HttpContext.Current.Profile != null)
                    {
                        profile = (ProfileCommon)HttpContext.Current.Profile;
                    }
                    // Subscriptions
                    if (profile != null)
                    {
                        ddlNewsletter.SelectedValue = profile.Preferences.Newsletter;

                        // Personal Info
                        txtFirstName.Text = profile.Personal.FirstName;
                        txtLastName.Text = profile.Personal.LastName;
                        ddlGenders.SelectedValue = profile.Personal.Gender;
                        if (profile.Personal.BirthDate != DateTime.MinValue)
                            txtBirthDate.Text = profile.Personal.BirthDate.ToShortDateString();
                        ddlOccupations.SelectedValue = profile.Personal.Occupation;
                        txtWebsite.Text = profile.Personal.Website;

                        // Address Info
                        ddlCountries.SelectedValue = profile.Address.Country;
                        txtAddress.Text = profile.Address.Address;
                        txtAptNumber.Text = profile.Address.AptNumber;
                        txtCity.Text = profile.Address.City;
                        ddlStates1.SelectedValue = profile.Company.State;
                        txtPostalCode.Text = profile.Address.PostalCode;

                        // Contact Info
                        txtDayTimePhone.Text = profile.Contacts.DayPhone;
                        txtDayTimePhoneExt.Text = profile.Contacts.DayPhoneExt;
                        txtEveningPhone.Text = profile.Contacts.EveningPhone;
                        txtEveningPhoneExt.Text = profile.Contacts.EveningPhoneExt;
                        txtCellPhone.Text = profile.Contacts.CellPhone;
                        txtEMail.Text = profile.Contacts.EMail;
                        txtHomeFax.Text = profile.Contacts.Fax;

                        //Company Info
                        txtCompanyName.Text = profile.Company.Company;
                        txtCompanyAddress.Text = profile.Company.Address;
                        txtCompanyCity.Text = profile.Company.City;
                        ddlStates2.SelectedValue = profile.Company.State;
                        txtCompanyZip.Text = profile.Company.PostalCode;
                        txtCompanyPhone.Text = profile.Company.Phone;
                        txtCompanyEMail.Text = profile.Company.EMail;
                        txtCompanyFax.Text = profile.Company.Fax;
                        txtCompanyWebsite.Text = profile.Company.Website;
                        // Subscriptions
                        ddlNewsletter.SelectedValue = profile.Preferences.Newsletter;
                    }
                    
                    //Load Businesses for the user
                    //MembershipUser user = System.Web.Security.Membership.GetUser();
                    //repeaterBusinessInfo.DataSource = BusinessManager.GetBusinessInfos((Guid)user.ProviderUserKey);
                    //repeaterBusinessInfo.DataBind();

                    //grvNotifications.DataSource = BusinessNotificationsManager.GetUserNotifications((Guid)user.ProviderUserKey);
                    //grvNotifications.DataBind();
                }
            }
        }
        protected void grvNotifications_PageIndexChanged(object sender, EventArgs e)
        {
            LoadGrid();

        }
        private void LoadGrid()
        {
            MembershipUser user = System.Web.Security.Membership.GetUser();
            grvNotifications.DataSource = BusinessNotificationsManager.GetUserNotifications((Guid)user.ProviderUserKey);
            grvNotifications.DataBind();
        }
        protected void grvNotifications_PageIndexChanging(Object sender, GridViewPageEventArgs e)
        {
            grvNotifications.PageIndex = e.NewPageIndex;
            LoadGrid();
        }
        #endregion

        #region Update current Profile Sub

        public void SaveProfile()
        {
            if (Page.User.Identity.IsAuthenticated)
            {
                // get the selected user's profile
                ProfileCommon profile = HttpContext.Current.Profile as ProfileCommon ?? new ProfileCommon();

                // Personal Info
                profile.Personal.FirstName = txtFirstName.Text;
                profile.Personal.LastName = txtLastName.Text;
                profile.Personal.Gender = ddlGenders.SelectedValue;
                if (txtBirthDate.Text.Trim().Length > 0)
                    profile.Personal.BirthDate = DateTime.Parse(txtBirthDate.Text);
                profile.Personal.Occupation = ddlOccupations.SelectedValue;
                profile.Personal.Website = txtWebsite.Text;

                // Address Info
                profile.Address.Country = ddlCountries.SelectedValue;
                profile.Address.Address = txtAddress.Text;
                profile.Address.AptNumber = txtAptNumber.Text;
                profile.Address.City = txtCity.Text;
                profile.Address.State = ddlStates1.SelectedValue;
                profile.Address.PostalCode = txtPostalCode.Text;

                // Contact Info
                profile.Contacts.DayPhone = txtDayTimePhone.Text;
                profile.Contacts.DayPhoneExt = txtDayTimePhoneExt.Text;
                profile.Contacts.EveningPhone = txtEveningPhone.Text;
                profile.Contacts.EveningPhoneExt = txtEveningPhoneExt.Text;
                profile.Contacts.CellPhone = txtCellPhone.Text;
                profile.Contacts.Fax = txtHomeFax.Text;

                // Company Info
                profile.Company.Company = txtCompanyName.Text;
                profile.Company.Address = txtCompanyAddress.Text;
                profile.Company.City = txtCompanyCity.Text;
                profile.Company.State = ddlStates2.SelectedValue;
                profile.Company.PostalCode = txtCompanyZip.Text;
                profile.Company.Phone = txtCompanyPhone.Text;
                profile.Company.Fax = txtCompanyFax.Text;
                profile.Company.EMail = txtCompanyEMail.Text;
                profile.Company.Website = txtCompanyWebsite.Text;

                // Subscriptions
                profile.Preferences.Newsletter = ddlNewsletter.SelectedValue;

                // this is what we will call from the button click
                // to save the user's profile
                profile.Save();
            }
        }

        #endregion

        #region update user info in detailsview

        protected void DetailsView1_ItemUpdating(object sender, DetailsViewUpdateEventArgs e)
        {
            //Need to handle the update manually because MembershipUser does not have a
            //parameterless constructor  
            MembershipUser memUser = System.Web.Security.Membership.GetUser();

            memUser.Email = (string)e.NewValues[0];
            //memUser.Comment = (string)e.NewValues[1];
            //memUserIsApproved = (bool)e.NewValues[2];
            try
            {
                System.Web.Security.Membership.UpdateUser(memUser);

                e.Cancel = true;
                DetailsView1.ChangeMode(DetailsViewMode.ReadOnly);
            }
            catch (Exception ex)
            {
                Response.Write("<div>The following error occurred:<font color="red"> " + ex.Message + "</font></div>");
                e.Cancel = true;
            }
        }

        #endregion

        #region delete user account

        protected void btnDeleteCurrentUser_Click(object sender, EventArgs e)
        {
            if (System.Web.Security.Membership.DeleteUser(Page.User.Identity.Name))
            {
                FormsAuthentication.SignOut();
                Roles.DeleteCookie();
                Response.Redirect("~/account-removed.aspx");
            }
            else
            {
                lblResult.Visible = true;
                lblResult.Text = "The Membership user was not deleted.";
            }

        }

        #endregion

        #region Update current Profile Button Click

        protected void btnUpdateProfile_Click(object sender, EventArgs e)
        {
            SaveProfile();
            lblProfileMessage.Text = "Profile saved successfully!";
        }

        #endregion

        #region end all user sessions on logout

        protected void LoginStatus1_LoggingOut(object sender, LoginCancelEventArgs e)
        {
            Session.Clear();
            Session.Abandon();
            Session.RemoveAll();
        }

        #endregion

        #region Get all Notifications


        #endregion

    }

}

推荐答案

(function(){
(function () {


(#myTabs").tabs({fx: {opacity:"toggle"}}); }); </script> </head> <身体> < div class ="Container"> < div class ="TabPanelHeaderText" id ="myTabs" style ="width:900px; height:40px; font-size:small;"> < div class ="ContentTemplate"> < ul class ="tabs"> < li>< a href =#ChangePassword"> ChangePassword</a></li> < li>< a href =#ChangeEmail"> ChangeEmail</a></li> < li>< a href =#EditProfile"> EditProfile</a></li> < li>< a href =#Business"> Business</a></li> < li>< a href =#Notifications">通知</a></li> </ul> < uc1:SubscriptionInfo ID ="ucSubscriptionInfo" runat ="server" Font-Size ="13px" CssClass ="aTab1"> <%-ajax标签容器开始-%> <%-< cc1:TabContainer ID ="tcntUserInfo" runat ="server" ActiveTabIndex ="5" Font-Size ="13px" CssClass ="aTab1">-%> < div id ="ChangePassword" class ="tab_content"> <%-< cc1:TabPanel ID ="TabPanel1" runat ="server" HeaderText ="ChangePassword"> < contenttemplate> < br/> < br/> < br/>-%> < div class ="contentTemplate" align ="center"> < br/> < div class ="formSectionTitle2" align ="center" style ="font-size:large"> 密码细节 </div> < asp:ChangePassword ID ="ChangePassword1" runat =服务器" EnableViewState ="False" ContinueDestinationPageUrl =〜/login.aspx"> < maildefinition bodyfilename =〜/email_templates/change-password.htm" isbodyhtml ="True"> Subject =您的密码已更改!"> </maildefinition> </div> <%-</contenttemplate> -%> </div> < div id ="ChangeEmail" class ="tab_content"> <%-< cc1:TabPanel ID ="TabPanel2" runat ="server" HeaderText ="ChangeEmail"> < contenttemplate> < br/> < br/> < br/> < br/>-%> < div class ="contentTemplate" align ="center"> < div class ="formSectionTitle2" align ="center" style ="font-size:large"> 用户详细信息 </div> < asp:DetailsView AutoGenerateRows ="False" DataSourceID ="ObjectDataSource1" ID ="DetailsView1" runat ="server" OnItemUpdating ="DetailsView1_ItemUpdating" CssClass ="dv"> < fields> < asp:BoundField DataField ="UserName" HeaderText ="UserName" ReadOnly ="True" SortExpression ="UserName"> < asp:TemplateField HeaderText ="Email" SortExpression ="Email"> < edititemtemplate> < asp:TextBox ID ="TextBox1" runat ="server" Text =''<%#Bind("Email")%>''> < asp:RegularExpressionValidator ID ="RegularExpressionValidator1" runat =服务器" ControlToValidate ="TextBox1" Display =动态" ErrorMessage =仅电子邮件!" ValidationExpression ="\ w +([-+.''] \ w +)* @ \ w +([-.] \ w +)* \.\ w +([-.] \ w +)*"> < asp:RequiredFieldValidator ID ="RequiredFieldValidator1" runat =服务器" ControlToValidate ="TextBox1" "Display ="动态"ErrorMessage ="需要电子邮件!"SetFocusOnError ="True"> </edititemtemplate> < insertitemtemplate> < asp:TextBox ID ="TextBox1" runat ="server" Text =''<%#Bind("Email")%>''> </insertitemtemplate> < itemtemplate> < asp:标签ID ="Label1" runat =服务器" Text =''<%#Bind("Email")%>''> </itemtemplate> < asp:BoundField DataField ="CreationDate" HeaderText =创建日期" SortExpression ="CreationDate" ReadOnly ="True"> < asp:BoundField DataField ="LastActivityDate" HeaderText =最后活动日期" SortExpression ="LastActivityDate" ReadOnly ="True"> < asp:CheckBoxField DataField ="IsOnline" HeaderText =在线吗?" SortExpression ="IsOnline" ReadOnly ="True"> < asp:CheckBoxField DataField ="IsApproved" HeaderText =已批准?" SortExpression ="IsApproved" ReadOnly ="True"> < asp:CheckBoxField DataField ="IsLockedOut" HeaderText =锁定了吗?" SortExpression ="IsLockedOut" ReadOnly ="True"> < asp:BoundField DataField ="PasswordQuestion" HeaderText =密码问题" ReadOnly ="True" SortExpression ="PasswordQuestion"> < asp:BoundField DataField ="LastLoginDate" HeaderText =最后登录日期" SortExpression ="LastLoginDate" ReadOnly ="True"> < asp:BoundField DataField ="LastLockoutDate" HeaderText =最后锁定日期" ReadOnly ="True" SortExpression ="LastLockoutDate"> < asp:BoundField DataField ="LastPasswordChangedDate" HeaderText =最后密码更改日期" ReadOnly ="True" SortExpression ="LastPasswordChangedDate"> < asp:CommandField ButtonType ="Button" ShowEditButton ="True" EditText =编辑用户详细信息"> < controlstyle font-size ="11px"/> </fields> < rowstyle cssclass ="dvRowStyle"/> < fieldheaderstyle cssclass ="dvFieldHeader"/> < HeaderStyle CssClass ="dvHeader"/> < alternatingrowstyle cssclass ="dvAlternateRowStyle"/> < asp:ObjectDataSource ID ="ObjectDataSource1" runat =服务器" DataObjectTypeName ="System.Web.Security.MembershipUser" SelectMethod ="GetUser" TypeName ="System.Web.Security.Membership"> < br/> < br/> < asp:按钮ID ="btnDeleteCurrentUser" runat =服务器" Text =关闭并删除我的帐户" OnClick ="btnDeleteCurrentUser_Click" OnClientClick =返回确认("确定吗?此操作将删除您所有的信息,并且无法恢复.;" /> < br/> < asp:标签ID ="lblResult" runat =服务器" Visible ="False" BackColor ="Red"/> </div> <%-</contenttemplate> -%> </div> < div id ="EditProfile" class ="tab_content"> <%-< cc1:TabPanel ID ="TabPanel3" runat ="server" HeaderText ="EditProfile"> < contenttemplate> < br/> < br/>-%> < div id ="tabId" align ="center" style ="width:960px; font:100%/1.4 Verdana,Arial,Helvetica,sans-serif;< br mode =" hold ="/> text- align:left; padding-left:20px> < table align ="center"> < div align ="center" style ="font-size:large"> <标题> 关于你 < br/> </标题> </div> <标题> < br/> < tr> < td align ="left" colspan ="2"> < label for ="txtFirstname"> 名</label>< br/> < asp:TextBox ID ="txtFirstName" runat ="server" align ="right" Width ="400px"/> </td> < td align ="left" colspan ="2"> < label for ="txtLastname"> 姓氏</label>< br/> < asp:TextBox ID ="txtLastName" runat =服务器" Width ="337px"/> </td> </tr> < tr> < td align ="left"> < label for ="txtGender"> 性别/标签 </td> < td align ="left"> < asp:DropDownList ID ="ddlGenders" runat =服务器"宽度="200px"> < asp:ListItem Selected ="True" Text =请选择一个..."/> < asp:ListItem Text ="Male" Value ="M"/> < asp:ListItem Text ="Female" Value ="F"/> </td> < td> < label for ="txtBirthdate"> 出生日期</label> </td> < td align ="left"> < asp:TextBox ID ="txtBirthDate" runat ="server" Width ="200px"> </td> < cc1:CalendarExtender ID ="txtBirthDate_CalendarExtender" runat ="server" Enabled ="True" TargetControlID ="txtBirthDate"> < asp:CompareValidator ID ="valBirthDateFormat" runat ="server" ControlToValidate ="txtBirthDate" Display =动态" "ErrorMessage ="生日的格式无效. Operator ="DataTypeCheck" SetFocusOnError ="True" Type ="Date" ValidationGroup ="EditProfile"> < cc1:MaskedEditExtender ID ="MaskedEditExtender1" runat ="server" CultureAMPMPlaceholder =" CultureCurrencySymbolPlaceholder =" CultureDateFormat =" CultureDatePlaceholder =" CultureDecimalPlaceholder =" CultureThousandsPlaceholder =" CultureTimePlaceholder =" Enabled ="True" Mask ="99/99/9999" MaskType ="Date" TargetControlID ="txtBirthDate"/> < cc1:MaskedEditValidator ID ="MaskedEditValidator1" runat ="server" ControlExtender ="MaskedEditExtender1" ControlToValidate ="txtBirthDate" Display ="Dynamic" EmptyValueMessage =日期必须采用正确的格式" ErrorMessage ="MaskedEditValidator1" InvalidValueMessage =此日期无效" TooltipMessage =请输入日期"/> </tr> < tr> < td align ="left"> < label for ="txtOccupation"> 职业/标签. </td> < td> < asp:DropDownList ID ="ddlOccupations" runat =服务器"宽度="200px"> < asp:ListItem Selected ="True" Text =请选择一个..."/> < asp:ListItem Text ="Academic"/> < asp:ListItem Text ="Accountant"/> < asp:ListItem Text ="Actor"/> < asp:ListItem Text ="Architect"/> < asp:ListItem Text ="Artist"/> < asp:ListItem Text =业务经理"/> < asp:ListItem Text ="Carpenter"/> < asp:ListItem Text =行政长官"/> < asp:ListItem Text ="Cinematographer"/> < asp:ListItem Text =公务员"/> < asp:ListItem Text ="Coach"/> < asp:ListItem Text ="Composer"/> < asp:ListItem Text =计算机程序员"/> < asp:ListItem Text ="Cook"/> < asp:ListItem Text ="Counsellor"/> < asp:ListItem Text ="Doctor"/> < asp:ListItem Text ="Driver"/> < asp:ListItem Text ="Economist"/> < asp:ListItem Text ="Editor"/> < asp:ListItem Text =电工"/> < asp:ListItem Text ="Engineer"/> < asp:ListItem Text =行政制作人"/> < asp:ListItem Text ="Fixer"/> < asp:ListItem Text =图形设计器"/> < asp:ListItem Text ="Hairdresser"/> < asp:ListItem Text ="Headhunter"/> < asp:ListItem Text ="HR-招聘"/> < asp:ListItem Text ="Information Officer"/> < asp:ListItem Text ="IT顾问"/> < asp:ListItem Text ="Journalist"/> < asp:ListItem Text =律师/律师"/> < asp:ListItem Text =讲师"/> < asp:ListItem Text =图书管理员"/> < asp:ListItem Text ="Mechanic"/> < asp:ListItem Text ="Model"/> < asp:ListItem Text =音乐家"/> < asp:ListItem Text ="Office Worker"/> < asp:ListItem Text ="Performer"/> < asp:ListItem Text ="Photographer"/> < asp:ListItem Text ="Presenter"/> < asp:ListItem Text =制片人/导演"/> < asp:ListItem Text ="Project Manager"/> < asp:ListItem Text ="Researcher"/> < asp:ListItem Text ="Salesman"/> < asp:ListItem Text =社会工作者"/> < asp:ListItem Text =士兵"/> < asp:ListItem Text ="Sportsperson"/> < asp:ListItem Text ="Student"/> < asp:ListItem Text ="Teacher"/> < asp:ListItem Text =技术人员"/> < asp:ListItem Text =技术作家"/> < asp:ListItem Text ="Therapist"/> < asp:ListItem Text ="Translator"/> < asp:ListItem Text =女服务员/服务员"/> < asp:ListItem Text =网络设计师/作者"/> < asp:ListItem Text ="Writer"/> < asp:ListItem Text ="Other"/> </td> </tr> < tr> < td align ="left" colspan ="2"> < label for ="txtPersonalWebsite"> 个人网站</label>< br/> < asp:TextBox ID ="txtWebsite" runat =服务器" hight ="50px"宽度="400px"/> </td> </tr> < tr> < td> < label for ="txtCountry"> 国家//标签; </td> < td> < asp:DropDownList ID ="ddlCountries" runat =服务器" AppendDataBoundItems =真实" 宽度="200px"> < asp:ListItem Selected ="True" Text =请选择一个..."/> </td> </tr> < tr> < td align ="left" colspan ="2"> < label for ="txtAddress"> 地址</label>< br/> < asp:TextBox ID ="txtAddress" runat =服务器" TextMode ="MultiLine" 宽度="400px"/> </td> </tr> < tr> < td> < label for ="txtApartmentNumber"> 公寓号码</label> </td> < td align ="left"> < asp:TextBox ID ="txtAptNumber" runat =服务器" Width ="200px"/> </td> < td> < label for ="txtCity"> 城市</label> </td> < td> < asp:TextBox ID ="txtCity" runat ="server" Width ="200px"/> </td> </tr> < tr> < td> < label for ="txtState/Region"> 状态/地区</label> </td> < td> < asp:DropDownList ID ="ddlStates1" runat =服务器" AppendDataBoundItems =真实" 宽度="200px"> < asp:ListItem Selected ="True" Text =请选择一个..."/> </td> < td> < label for ="txtZip/邮政编码"> 邮编/邮政编码 </td> < td> < asp:TextBox ID ="txtPostalCode" runat =服务器" Width ="200px"/> </td> </tr> < tr> < td> < label for ="txtCONTACTINFO"> CONTACT INFO</label> </td> < td> < asp:TextBox ID ="txtContactInfo" runat =服务器" Width ="200px"> </td> </tr> < tr> < td> < label for ="txtDayTimePhone"> 白天电话</label> </td> < td> < asp:TextBox ID ="txtDayTimePhone" runat =服务器" Width ="200px"/> </td> < td> < label for ="txtDayTimePhoneExt"> 白天电话分机</label> </td> < td> < asp:TextBox ID ="txtDayTimePhoneExt" runat ="server" Width ="200px"/> </td> </tr> < tr> < td> < label for ="txtEveningPhone"> 晚上电话</label> </td> < td> < asp:TextBox ID ="txtEveningPhone" runat ="server" Width ="200px"/> </td> < td> < label for ="txtEveningPhoneExt"> 晚上电话分机</label> </td> < td> < asp:TextBox ID ="txtEveningPhoneExt" runat =服务器"宽度="200px"/> </td> </tr> < tr> < td> < label for ="txtCellPhone"> 手机</label> </td> < td> < asp:TextBox ID ="txtCellPhone" runat =服务器" Width ="200px"/> </td> </tr> < tr> < td align ="left" colspan ="2"> < label for ="txtEMail"> 电子邮件</label>< br/> < asp:TextBox ID ="txtEMail" runat ="server" Width ="400px"/> </td> < td> < label for ="txtHomeFax"> 家庭传真</label> </td> < td> < asp:TextBox ID ="txtHomeFax" runat ="server" Width ="200px"/> </td> </tr> < tr> < td> < label for ="txtCOMPANYDETAILS"> 公司详细信息</label> </td> </tr> < tr> < td colspan ="2"> < label for ="txtCompanyName"> 公司名称</label> < asp:TextBox ID ="txtCompanyName" runat =服务器" Width ="300px"> </td> </tr> < tr> < td colspan ="2"> < label for ="txtAddress"> 地址</label> < asp:TextBox ID ="txtCompanyAddress" runat =服务器" TextMode ="MultiLine" 宽度="350px"> </td> </tr> < tr> < td> < label for ="txtCity"> 城市</label> </td> < td> < asp:TextBox ID ="txtCompanyCity" runat =服务器" Width ="200px"/> </td> < td> < label for ="txtState/Region"> 状态/地区</label> </td> < td> < asp:DropDownList ID ="ddlStates2" runat =服务器" align =正确" AppendDataBoundItems ="True" Width ="200px"> < asp:ListItem Selected ="True" Text =请选择一个..."/> </td> </tr> < tr> < td> < label for ="txtZip"> 邮编/标签 </td> < td> < asp:TextBox ID ="txtCompanyZip" runat =服务器" Width ="200px"/> </td> < td> < label for ="txtCountry"> 国家//标签; </td> < td> < asp:DropDownList ID ="ddlCountries2" runat =服务器" AppendDataBoundItems =真实" 宽度="200px"> < asp:ListItem Selected ="True" Text =请选择一个..."/> </td> </tr> < tr> < td> < label for ="txtPhone"> 电话</label> </td> < td> < asp:TextBox ID ="txtCompanyPhone" runat =服务器" Width ="200px"/> </td> < td> < label for ="txtFax"> 传真</label> </td> < td> < asp:TextBox ID ="txtCompanyFax" runat ="server" Width ="200px"/> </td> </tr> < tr> < td colspan ="2"> < label for ="txtEMail"> 电子邮件</label> < asp:TextBox ID ="txtCompanyEMail" runat ="server" Width ="350px"/> </td> </tr> < tr> < td colspan ="2"> < label for ="txtWebSite"> WebSite</label> < asp:TextBox ID ="txtCompanyWebsite" runat ="server" Width ="330px"/> </td> </tr> < tr> < td align ="right"> < label for ="txtNEWSLETTERSUBSCRIPTION"> 订阅通讯</label> </td> </tr> < tr> < td> < label for ="txtNewsletter"> 时事通讯</label> </td> < td> < asp:DropDownList ID ="ddlNewsletter" runat =服务器"宽度="200px"> < asp:ListItem Selected ="true" Text =没有订阅" Value =无"/> < asp:ListItem Text =订阅新闻通讯" Value ="Html"/> </td> </tr> < tr> < td> < asp:按钮ID ="btnUpdateProfile" runat =服务器" OnClick ="btnUpdateProfile_Click" OnClientClick =返回确认(这将更新您的个人资料信息..\ n \ r单击确定"继续.") Text =保存配置文件" ValidationGroup ="EditProfile"/> < asp:标签ID ="lblProfileMessage" runat =服务器"/> </td> </tr> </标题> </table> </div> <%-</contenttemplate> -%> </div> < div id ="Business" class ="tab_content"> <%-< cc1:TabPanel ID ="panelBusiness" runat ="server" HeaderText ="Business"> < contenttemplate> < br/> < br/>-%> < table class ="contentTemplate" align ="center"> < asp:Repeater ID ="repeaterBusinessInfo" runat ="server"> < HeaderTemplate> < tr> < th> 商业编号 </th> < th> 企业名称 </th> < th> 公司地址 </th> </tr> </HeaderTemplate> < itemtemplate> < tr> < td> < asp:标签ID ="lblBusinessID" runat ="server" Text =''<%#(((BusinessInfo)(Container.DataItem)).BusinessID%>''> </td> < td> < a href ="../Business/EditBusinessProfile.aspx?BusinessID =<%#(((BusinessInfo)(Container.DataItem)).BusinessID%>"> <%#(((BusinessInfo)(Container.DataItem)).BusinessID%> <%#(((BusinessInfo)(Container.DataItem)).BusinessName%></a> </td> < td> <%#string.Format("{0} {1},{2} {3} {4} {5}",(((BusinessInfo)(Container.DataItem)).Address1,((BusinessInfo)(Container. DataItem)).Address2,(((BusinessInfo)(Container.DataItem)).City,(((BusinessInfo)(Container.DataItem)).State,(((BusinessInfo)(Container.DataItem)).Zip,(((BusinessInfo] [ Container.DataItem)).Country)%> </td> </tr> </itemtemplate> < tr> < td align ="center"> < asp:Button ID ="btnNewBusiness" runat ="server" Text ="New Business" PostBackUrl =〜/Business/EditBusinessProfile.aspx?BusinessID = 0"/> </td> </tr> </table> < div align ="right" style =已删除边距40px"> < asp:HyperLink ID ="linkPrev" runat ="server"><< < asp:标签ID ="Label1" runat =服务器"> < asp:HyperLink ID ="linkNext" runat ="server">>> </div> <%-</contenttemplate> -%> </div> < div id ="Notifications" class ="tab_content"> <%-< cc1:TabPanel ID ="panelNotifications" runat ="server" HeaderText ="Notifications"> < contenttemplate> < br/> < br/> < br/>-%> < div align ="center"> < table class ="contentTemplate" align ="center"> < asp:GridView ID ="grvNotifications" runat =服务器" DataKeyNames ="NotificationID" AutoGenerateColumns ="False" PageSize ="2" OnPageIndexChanged ="grvNotifications_PageIndexChanged" onpageindexchanging ="grvNotifications_PageIndexChanging" AllowPaging ="True"> <列> < asp:TemplateField> < HeaderTemplate> < asp:标签ID ="lblHeader"文本=选择业务名称" runat =服务器"宽度="120px"/> </HeaderTemplate> < itemtemplate> < asp:LinkBut​​ton ID ="hlkBusinessName" runat ="server" Text =''<%#Eval("Header")%>''CommandName ="Select"/> </itemtemplate> < asp:BoundField DataField ="NotificationID" HeaderText ="NotificationID"/> < asp:BoundField DataField ="UserId" HeaderText ="UserId"/> < asp:BoundField DataField ="NotificationDate" HeaderText ="NotificationDate"/> </列> < footerstyle font-bold ="True"/> < pagersettings position ="Bottom" mode ="NextPreviousFirstLast" firstpagetext =<<"> LastPageText =>>" NextPageText =>" PreviousPageText =<" /> < pagerstyle horizo​​ntalalign ="Right" font-bold ="False" font-overline ="False"> Font-Size ="Small" ForeColor ="Black" Height ="5px"/> </pagerstyle></pagersettings></table> </div> <%-</contenttemplate> -%> </div> </div> </div> </div> </contenttemplate></div>
("#myTabs").tabs({ fx: { opacity: "toggle"} }); }); </script> </head> <body> <div class="Container"> <div class="TabPanelHeaderText" id="myTabs" style="width: 900px; height: 40px; font-size: small;"> <div class="ContentTemplate"> <ul class="tabs"> <li><a href="#ChangePassword">ChangePassword</a></li> <li><a href="#ChangeEmail">ChangeEmail</a></li> <li><a href="#EditProfile">EditProfile</a></li> <li><a href="#Business">Business</a></li> <li><a href="#Notifications">Notifications</a></li> </ul> <uc1:SubscriptionInfo ID="ucSubscriptionInfo" runat="server" Font-Size="13px" CssClass="aTab1"> <%-- ajax tab container start --%> <%-- <cc1:TabContainer ID="tcntUserInfo" runat="server" ActiveTabIndex="5" Font-Size="13px" CssClass="aTab1">--%> <div id="ChangePassword" class="tab_content"> <%--<cc1:TabPanel ID="TabPanel1" runat="server" HeaderText="ChangePassword"> <contenttemplate> <br /> <br /> <br />--%> <div class="contentTemplate" align="center"> <br /> <div class="formSectionTitle2" align="center" style="font-size: large"> PASSWORD DETAILS </div> <asp:ChangePassword ID="ChangePassword1" runat="server" EnableViewState="False" ContinueDestinationPageUrl="~/login.aspx"> <maildefinition bodyfilename="~/email_templates/change-password.htm" isbodyhtml="True"> Subject="Your password has been changed!"> </maildefinition> </div> <%-- </contenttemplate> --%> </div> <div id="ChangeEmail" class="tab_content"> <%-- <cc1:TabPanel ID="TabPanel2" runat="server" HeaderText="ChangeEmail"> <contenttemplate> <br /> <br /> <br /> <br />--%> <div class="contentTemplate" align="center"> <div class="formSectionTitle2" align="center" style="font-size: large"> USER DETAILS </div> <asp:DetailsView AutoGenerateRows="False" DataSourceID="ObjectDataSource1" ID="DetailsView1" runat="server" OnItemUpdating="DetailsView1_ItemUpdating" CssClass="dv"> <fields> <asp:BoundField DataField="UserName" HeaderText="UserName" ReadOnly="True" SortExpression="UserName"> <asp:TemplateField HeaderText="Email" SortExpression="Email"> <edititemtemplate> <asp:TextBox ID="TextBox1" runat="server" Text=''<%# Bind("Email") %>''> <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="TextBox1" Display="Dynamic" ErrorMessage="Email only!" ValidationExpression="\w+([-+.'']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"> <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="TextBox1" Display="Dynamic" ErrorMessage="Email is required!" SetFocusOnError="True"> </edititemtemplate> <insertitemtemplate> <asp:TextBox ID="TextBox1" runat="server" Text=''<%# Bind("Email") %>''> </insertitemtemplate> <itemtemplate> <asp:Label ID="Label1" runat="server" Text=''<%# Bind("Email") %>''> </itemtemplate> <asp:BoundField DataField="CreationDate" HeaderText="Creation Date" SortExpression="CreationDate" ReadOnly="True"> <asp:BoundField DataField="LastActivityDate" HeaderText="Last Activity Date" SortExpression="LastActivityDate" ReadOnly="True"> <asp:CheckBoxField DataField="IsOnline" HeaderText="Online?" SortExpression="IsOnline" ReadOnly="True"> <asp:CheckBoxField DataField="IsApproved" HeaderText="Approved?" SortExpression="IsApproved" ReadOnly="True"> <asp:CheckBoxField DataField="IsLockedOut" HeaderText="Locked Out?" SortExpression="IsLockedOut" ReadOnly="True"> <asp:BoundField DataField="PasswordQuestion" HeaderText="Password Question" ReadOnly="True" SortExpression="PasswordQuestion"> <asp:BoundField DataField="LastLoginDate" HeaderText="Last Login Date" SortExpression="LastLoginDate" ReadOnly="True"> <asp:BoundField DataField="LastLockoutDate" HeaderText="Last Lockout Date" ReadOnly="True" SortExpression="LastLockoutDate"> <asp:BoundField DataField="LastPasswordChangedDate" HeaderText="Last Password Changed Date" ReadOnly="True" SortExpression="LastPasswordChangedDate"> <asp:CommandField ButtonType="Button" ShowEditButton="True" EditText="Edit User Details"> <controlstyle font-size="11px" /> </fields> <rowstyle cssclass="dvRowStyle" /> <fieldheaderstyle cssclass="dvFieldHeader" /> <HeaderStyle CssClass="dvHeader" /> <alternatingrowstyle cssclass="dvAlternateRowStyle" /> <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" DataObjectTypeName="System.Web.Security.MembershipUser" SelectMethod="GetUser" TypeName="System.Web.Security.Membership"> <br /> <br /> <asp:Button ID="btnDeleteCurrentUser" runat="server" Text="Close and Delete my account" OnClick="btnDeleteCurrentUser_Click" OnClientClick="return confirm(''Are you sure? This action will delete all your information and is unrecoverable.'');" /> <br /> <asp:Label ID="lblResult" runat="server" Visible="False" BackColor="Red" /> </div> <%-- </contenttemplate> --%> </div> <div id="EditProfile" class="tab_content"> <%--<cc1:TabPanel ID="TabPanel3" runat="server" HeaderText="EditProfile"> <contenttemplate> <br /> <br />--%> <div id="tabId" align="center" style="width: 960px; font: 100%/1.4 Verdana, Arial, Helvetica, sans-serif;<br mode=" hold=" /> text-align: left; padding-left: 20px"> <table align="center"> <div align="center" style="font-size: large"> <caption> ABOUT YOU <br /> </caption> </div> <caption> <br /> <tr> <td align="left" colspan="2"> <label for="txtFirstname"> First name</label><br /> <asp:TextBox ID="txtFirstName" runat="server" align="right" Width="400px" /> </td> <td align="left" colspan="2"> <label for="txtLastname"> Last name</label><br /> <asp:TextBox ID="txtLastName" runat="server" Width="337px" /> </td> </tr> <tr> <td align="left"> <label for="txtGender"> Gender</label> </td> <td align="left"> <asp:DropDownList ID="ddlGenders" runat="server" Width="200px"> <asp:ListItem Selected="True" Text="Please select one..." /> <asp:ListItem Text="Male" Value="M" /> <asp:ListItem Text="Female" Value="F" /> </td> <td> <label for="txtBirthdate"> Birth date</label> </td> <td align="left"> <asp:TextBox ID="txtBirthDate" runat="server" Width="200px"> </td> <cc1:CalendarExtender ID="txtBirthDate_CalendarExtender" runat="server" Enabled="True" TargetControlID="txtBirthDate"> <asp:CompareValidator ID="valBirthDateFormat" runat="server" ControlToValidate="txtBirthDate" Display="Dynamic" ErrorMessage="The format of the birth date is not valid." Operator="DataTypeCheck" SetFocusOnError="True" Type="Date" ValidationGroup="EditProfile"> <cc1:MaskedEditExtender ID="MaskedEditExtender1" runat="server" CultureAMPMPlaceholder="" CultureCurrencySymbolPlaceholder="" CultureDateFormat="" CultureDatePlaceholder="" CultureDecimalPlaceholder="" CultureThousandsPlaceholder="" CultureTimePlaceholder="" Enabled="True" Mask="99/99/9999" MaskType="Date" TargetControlID="txtBirthDate" /> <cc1:MaskedEditValidator ID="MaskedEditValidator1" runat="server" ControlExtender="MaskedEditExtender1" ControlToValidate="txtBirthDate" Display="Dynamic" EmptyValueMessage="Date must be in correct format" ErrorMessage="MaskedEditValidator1" InvalidValueMessage="This date is invalid" TooltipMessage="Please enter a date" /> </tr> <tr> <td align="left"> <label for="txtOccupation"> Occupation</label> </td> <td> <asp:DropDownList ID="ddlOccupations" runat="server" Width="200px"> <asp:ListItem Selected="True" Text="Please select one..." /> <asp:ListItem Text="Academic" /> <asp:ListItem Text="Accountant" /> <asp:ListItem Text="Actor" /> <asp:ListItem Text="Architect" /> <asp:ListItem Text="Artist" /> <asp:ListItem Text="Business Manager" /> <asp:ListItem Text="Carpenter" /> <asp:ListItem Text="Chief Executive" /> <asp:ListItem Text="Cinematographer" /> <asp:ListItem Text="Civil Servant" /> <asp:ListItem Text="Coach" /> <asp:ListItem Text="Composer" /> <asp:ListItem Text="Computer programmer" /> <asp:ListItem Text="Cook" /> <asp:ListItem Text="Counsellor" /> <asp:ListItem Text="Doctor" /> <asp:ListItem Text="Driver" /> <asp:ListItem Text="Economist" /> <asp:ListItem Text="Editor" /> <asp:ListItem Text="Electrician" /> <asp:ListItem Text="Engineer" /> <asp:ListItem Text="Executive Producer" /> <asp:ListItem Text="Fixer" /> <asp:ListItem Text="Graphic Designer" /> <asp:ListItem Text="Hairdresser" /> <asp:ListItem Text="Headhunter" /> <asp:ListItem Text="HR - Recruitment" /> <asp:ListItem Text="Information Officer" /> <asp:ListItem Text="IT Consultant" /> <asp:ListItem Text="Journalist" /> <asp:ListItem Text="Lawyer / Solicitor" /> <asp:ListItem Text="Lecturer" /> <asp:ListItem Text="Librarian" /> <asp:ListItem Text="Mechanic" /> <asp:ListItem Text="Model" /> <asp:ListItem Text="Musician" /> <asp:ListItem Text="Office Worker" /> <asp:ListItem Text="Performer" /> <asp:ListItem Text="Photographer" /> <asp:ListItem Text="Presenter" /> <asp:ListItem Text="Producer / Director" /> <asp:ListItem Text="Project Manager" /> <asp:ListItem Text="Researcher" /> <asp:ListItem Text="Salesman" /> <asp:ListItem Text="Social Worker" /> <asp:ListItem Text="Soldier" /> <asp:ListItem Text="Sportsperson" /> <asp:ListItem Text="Student" /> <asp:ListItem Text="Teacher" /> <asp:ListItem Text="Technical Crew" /> <asp:ListItem Text="Technical Writer" /> <asp:ListItem Text="Therapist" /> <asp:ListItem Text="Translator" /> <asp:ListItem Text="Waitress / Waiter" /> <asp:ListItem Text="Web designer / author" /> <asp:ListItem Text="Writer" /> <asp:ListItem Text="Other" /> </td> </tr> <tr> <td align="left" colspan="2"> <label for="txtPersonalWebsite"> Personal Website</label><br /> <asp:TextBox ID="txtWebsite" runat="server" hight="50px" Width="400px" /> </td> </tr> <tr> <td> <label for="txtCountry"> Country</label> </td> <td> <asp:DropDownList ID="ddlCountries" runat="server" AppendDataBoundItems="True" Width="200px"> <asp:ListItem Selected="True" Text="Please select one..." /> </td> </tr> <tr> <td align="left" colspan="2"> <label for="txtAddress"> Address</label><br /> <asp:TextBox ID="txtAddress" runat="server" TextMode="MultiLine" Width="400px" /> </td> </tr> <tr> <td> <label for="txtApartmentNumber"> Apartment Number</label> </td> <td align="left"> <asp:TextBox ID="txtAptNumber" runat="server" Width="200px" /> </td> <td> <label for="txtCity"> City</label> </td> <td> <asp:TextBox ID="txtCity" runat="server" Width="200px" /> </td> </tr> <tr> <td> <label for="txtState / Region"> State / Region</label> </td> <td> <asp:DropDownList ID="ddlStates1" runat="server" AppendDataBoundItems="True" Width="200px"> <asp:ListItem Selected="True" Text="Please select one..." /> </td> <td> <label for="txtZip / Postal code"> Zip / Postal code</label> </td> <td> <asp:TextBox ID="txtPostalCode" runat="server" Width="200px" /> </td> </tr> <tr> <td> <label for="txtCONTACTINFO"> CONTACT INFO</label> </td> <td> <asp:TextBox ID="txtContactInfo" runat="server" Width="200px"> </td> </tr> <tr> <td> <label for="txtDayTimePhone"> Day Time Phone</label> </td> <td> <asp:TextBox ID="txtDayTimePhone" runat="server" Width="200px" /> </td> <td> <label for="txtDayTimePhoneExt"> Day Time Phone Ext</label> </td> <td> <asp:TextBox ID="txtDayTimePhoneExt" runat="server" Width="200px" /> </td> </tr> <tr> <td> <label for="txtEveningPhone"> Evening Phone</label> </td> <td> <asp:TextBox ID="txtEveningPhone" runat="server" Width="200px" /> </td> <td> <label for="txtEveningPhoneExt"> Evening Phone Ext</label> </td> <td> <asp:TextBox ID="txtEveningPhoneExt" runat="server" Width="200px" /> </td> </tr> <tr> <td> <label for="txtCellPhone"> CellPhone</label> </td> <td> <asp:TextBox ID="txtCellPhone" runat="server" Width="200px" /> </td> </tr> <tr> <td align="left" colspan="2"> <label for="txtEMail"> EMail</label><br /> <asp:TextBox ID="txtEMail" runat="server" Width="400px" /> </td> <td> <label for="txtHomeFax"> Home Fax</label> </td> <td> <asp:TextBox ID="txtHomeFax" runat="server" Width="200px" /> </td> </tr> <tr> <td> <label for="txtCOMPANYDETAILS"> COMPANY DETAILS</label> </td> </tr> <tr> <td colspan="2"> <label for="txtCompanyName"> Company Name</label> <asp:TextBox ID="txtCompanyName" runat="server" Width="300px"> </td> </tr> <tr> <td colspan="2"> <label for="txtAddress"> Address</label> <asp:TextBox ID="txtCompanyAddress" runat="server" TextMode="MultiLine" Width="350px"> </td> </tr> <tr> <td> <label for="txtCity"> City</label> </td> <td> <asp:TextBox ID="txtCompanyCity" runat="server" Width="200px" /> </td> <td> <label for="txtState / Region"> State / Region</label> </td> <td> <asp:DropDownList ID="ddlStates2" runat="server" align="right" AppendDataBoundItems="True" Width="200px"> <asp:ListItem Selected="True" Text="Please select one..." /> </td> </tr> <tr> <td> <label for="txtZip"> Zip</label> </td> <td> <asp:TextBox ID="txtCompanyZip" runat="server" Width="200px" /> </td> <td> <label for="txtCountry"> Country</label> </td> <td> <asp:DropDownList ID="ddlCountries2" runat="server" AppendDataBoundItems="True" Width="200px"> <asp:ListItem Selected="True" Text="Please select one..." /> </td> </tr> <tr> <td> <label for="txtPhone"> Phone</label> </td> <td> <asp:TextBox ID="txtCompanyPhone" runat="server" Width="200px" /> </td> <td> <label for="txtFax"> Fax</label> </td> <td> <asp:TextBox ID="txtCompanyFax" runat="server" Width="200px" /> </td> </tr> <tr> <td colspan="2"> <label for="txtEMail"> EMail</label> <asp:TextBox ID="txtCompanyEMail" runat="server" Width="350px" /> </td> </tr> <tr> <td colspan="2"> <label for="txtWebSite"> WebSite</label> <asp:TextBox ID="txtCompanyWebsite" runat="server" Width="330px" /> </td> </tr> <tr> <td align="right"> <label for="txtNEWSLETTERSUBSCRIPTION"> NEWSLETTER SUBSCRIPTION</label> </td> </tr> <tr> <td> <label for="txtNewsletter"> Newsletter</label> </td> <td> <asp:DropDownList ID="ddlNewsletter" runat="server" Width="200px"> <asp:ListItem Selected="true" Text="No subscription" Value="None" /> <asp:ListItem Text="Subscribe to newsletter" Value="Html" /> </td> </tr> <tr> <td> <asp:Button ID="btnUpdateProfile" runat="server" OnClick="btnUpdateProfile_Click" OnClientClick="return confirm(''This will Update your Profile information..\n\rClick OK to continue.'')" Text="Save Profile" ValidationGroup="EditProfile" /> <asp:Label ID="lblProfileMessage" runat="server" /> </td> </tr> </caption> </table> </div> <%-- </contenttemplate> --%> </div> <div id="Business" class="tab_content"> <%--<cc1:TabPanel ID="panelBusiness" runat="server" HeaderText="Business"> <contenttemplate> <br /> <br />--%> <table class="contentTemplate" align="center"> <asp:Repeater ID="repeaterBusinessInfo" runat="server"> <HeaderTemplate> <tr> <th> BusinessID </th> <th> BusinessName </th> <th> BusinessAddress </th> </tr> </HeaderTemplate> <itemtemplate> <tr> <td> <asp:Label ID="lblBusinessID" runat="server" Text=''<%#((BusinessInfo)(Container.DataItem)).BusinessID%>''> </td> <td> <a href="../Business/EditBusinessProfile.aspx?BusinessID=<%#((BusinessInfo)(Container.DataItem)).BusinessID%>"> <%#((BusinessInfo)(Container.DataItem)).BusinessID%> <%#((BusinessInfo)(Container.DataItem)).BusinessName%></a> </td> <td> <%#string.Format("{0} {1}, {2} {3} {4} {5}",((BusinessInfo)(Container.DataItem)).Address1, ((BusinessInfo)(Container.DataItem)).Address2,((BusinessInfo)(Container.DataItem)).City,((BusinessInfo)(Container.DataItem)).State,((BusinessInfo)(Container.DataItem)).Zip,((BusinessInfo)(Container.DataItem)).Country)%> </td> </tr> </itemtemplate> <tr> <td align="center"> <asp:Button ID="btnNewBusiness" runat="server" Text="New Business" PostBackUrl="~/Business/EditBusinessProfile.aspx?BusinessID=0" /> </td> </tr> </table> <div align="right" style="margin-removed 40px"> <asp:HyperLink ID="linkPrev" runat="server"><< <asp:Label ID="Label1" runat="server"> <asp:HyperLink ID="linkNext" runat="server">>> </div> <%-- </contenttemplate> --%> </div> <div id="Notifications" class="tab_content"> <%--<cc1:TabPanel ID="panelNotifications" runat="server" HeaderText="Notifications"> <contenttemplate> <br /> <br /> <br />--%> <div align="center"> <table class="contentTemplate" align="center"> <asp:GridView ID="grvNotifications" runat="server" DataKeyNames="NotificationID" AutoGenerateColumns="False" PageSize="2" OnPageIndexChanged="grvNotifications_PageIndexChanged" onpageindexchanging="grvNotifications_PageIndexChanging" AllowPaging="True"> <columns> <asp:TemplateField> <HeaderTemplate> <asp:Label ID="lblHeader" Text="Select BusinessName" runat="server" Width="120px" /> </HeaderTemplate> <itemtemplate> <asp:LinkButton ID="hlkBusinessName" runat="server" Text=''<%#Eval("Header")%>'' CommandName="Select" /> </itemtemplate> <asp:BoundField DataField="NotificationID" HeaderText="NotificationID" /> <asp:BoundField DataField="UserId" HeaderText="UserId" /> <asp:BoundField DataField="NotificationDate" HeaderText="NotificationDate" /> </columns> <footerstyle font-bold="True" /> <pagersettings position="Bottom" mode="NextPreviousFirstLast" firstpagetext="<<"> LastPageText=">>" NextPageText=">" PreviousPageText="<" /> <pagerstyle horizontalalign="Right" font-bold="False" font-overline="False"> Font-Size="Small" ForeColor="Black" Height="5px" /> </pagerstyle></pagersettings></table> </div> <%-- </contenttemplate> --%> </div> </div> </div> </div> </contenttemplate></div>


using System;
using System.Collections.Generic;
using System.Web;
using System.Web.Profile;
using System.Web.Security;
using System.Web.UI.WebControls;
using Vascape.DataLayer;
using TI.Membership.Library;
using Vascape.BusinessLayer;

namespace TI.Membership.Web.members.controls
{
    public partial class BusinessMembershipInfo : System.Web.UI.UserControl
    {
        #region on page load get current profile

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                grvNotifications.PageIndex = 0;
                LoadGrid();
                MembershipUser user = System.Web.Security.Membership.GetUser();
                repeaterBusinessInfo.DataSource = BusinessManager.GetBusinessInfos((Guid)user.ProviderUserKey);
                repeaterBusinessInfo.DataBind();
                if (!Page.IsPostBack)
                {
                    PagedDataSource pds = new PagedDataSource();
                    pds.DataSource = BusinessManager.GetBusinessInfos((Guid)user.ProviderUserKey);
                    pds.AllowPaging = true;
                    pds.PageSize = 10;
                    int currentPage;
                    if (Request.QueryString["page"] != null)
                    {
                        currentPage = Int32.Parse(Request.QueryString["page"]);
                    }
                    else
                    {
                        currentPage = 1;
                    }
                    pds.CurrentPageIndex = currentPage - 1;
                    Label1.Text = currentPage + " / " + pds.PageCount;

                    if (!pds.IsFirstPage)
                    {
                        linkPrev.NavigateUrl = Request.CurrentExecutionFilePath + "?page=" + (currentPage - 1);
                    }
                    if (!pds.IsLastPage)
                    {
                        linkNext.NavigateUrl = Request.CurrentExecutionFilePath + "?page=" + (currentPage + 1);
                    }

                    repeaterBusinessInfo.DataSource = pds;
                    repeaterBusinessInfo.DataBind();
                }
            }
            // Get Profile 
            if (!Page.IsPostBack)
            {
                if (Page.User.Identity.IsAuthenticated)
                {
                    // get country names from app_code folder
                    // bind country names to the dropdown list
                    ddlCountries.DataSource = CountryNames.GetCountries();
                    ddlCountries.DataBind();

                    ddlCountries2.DataSource = CountryNames.GetCountries();
                    ddlCountries2.DataBind();

                    // get state names from app_code folder
                    // bind state names to the dropdown lists in address info and company info section
                    ddlStates1.DataSource = StateNames.GetStates();
                    ddlStates1.DataBind();
                    ddlStates2.DataSource = StateNames.GetStates();
                    ddlStates2.DataBind();

                    // get the selected user's profile based on query string

                    ProfileCommon profile = null;
                    if (HttpContext.Current.Profile != null)
                    {
                        profile = (ProfileCommon)HttpContext.Current.Profile;
                    }
                    // Subscriptions
                    if (profile != null)
                    {
                        ddlNewsletter.SelectedValue = profile.Preferences.Newsletter;

                        // Personal Info
                        txtFirstName.Text = profile.Personal.FirstName;
                        txtLastName.Text = profile.Personal.LastName;
                        ddlGenders.SelectedValue = profile.Personal.Gender;
                        if (profile.Personal.BirthDate != DateTime.MinValue)
                            txtBirthDate.Text = profile.Personal.BirthDate.ToShortDateString();
                        ddlOccupations.SelectedValue = profile.Personal.Occupation;
                        txtWebsite.Text = profile.Personal.Website;

                        // Address Info
                        ddlCountries.SelectedValue = profile.Address.Country;
                        txtAddress.Text = profile.Address.Address;
                        txtAptNumber.Text = profile.Address.AptNumber;
                        txtCity.Text = profile.Address.City;
                        ddlStates1.SelectedValue = profile.Company.State;
                        txtPostalCode.Text = profile.Address.PostalCode;

                        // Contact Info
                        txtDayTimePhone.Text = profile.Contacts.DayPhone;
                        txtDayTimePhoneExt.Text = profile.Contacts.DayPhoneExt;
                        txtEveningPhone.Text = profile.Contacts.EveningPhone;
                        txtEveningPhoneExt.Text = profile.Contacts.EveningPhoneExt;
                        txtCellPhone.Text = profile.Contacts.CellPhone;
                        txtEMail.Text = profile.Contacts.EMail;
                        txtHomeFax.Text = profile.Contacts.Fax;

                        //Company Info
                        txtCompanyName.Text = profile.Company.Company;
                        txtCompanyAddress.Text = profile.Company.Address;
                        txtCompanyCity.Text = profile.Company.City;
                        ddlStates2.SelectedValue = profile.Company.State;
                        txtCompanyZip.Text = profile.Company.PostalCode;
                        txtCompanyPhone.Text = profile.Company.Phone;
                        txtCompanyEMail.Text = profile.Company.EMail;
                        txtCompanyFax.Text = profile.Company.Fax;
                        txtCompanyWebsite.Text = profile.Company.Website;
                        // Subscriptions
                        ddlNewsletter.SelectedValue = profile.Preferences.Newsletter;
                    }
                    
                    //Load Businesses for the user
                    //MembershipUser user = System.Web.Security.Membership.GetUser();
                    //repeaterBusinessInfo.DataSource = BusinessManager.GetBusinessInfos((Guid)user.ProviderUserKey);
                    //repeaterBusinessInfo.DataBind();

                    //grvNotifications.DataSource = BusinessNotificationsManager.GetUserNotifications((Guid)user.ProviderUserKey);
                    //grvNotifications.DataBind();
                }
            }
        }
        protected void grvNotifications_PageIndexChanged(object sender, EventArgs e)
        {
            LoadGrid();

        }
        private void LoadGrid()
        {
            MembershipUser user = System.Web.Security.Membership.GetUser();
            grvNotifications.DataSource = BusinessNotificationsManager.GetUserNotifications((Guid)user.ProviderUserKey);
            grvNotifications.DataBind();
        }
        protected void grvNotifications_PageIndexChanging(Object sender, GridViewPageEventArgs e)
        {
            grvNotifications.PageIndex = e.NewPageIndex;
            LoadGrid();
        }
        #endregion

        #region Update current Profile Sub

        public void SaveProfile()
        {
            if (Page.User.Identity.IsAuthenticated)
            {
                // get the selected user's profile
                ProfileCommon profile = HttpContext.Current.Profile as ProfileCommon ?? new ProfileCommon();

                // Personal Info
                profile.Personal.FirstName = txtFirstName.Text;
                profile.Personal.LastName = txtLastName.Text;
                profile.Personal.Gender = ddlGenders.SelectedValue;
                if (txtBirthDate.Text.Trim().Length > 0)
                    profile.Personal.BirthDate = DateTime.Parse(txtBirthDate.Text);
                profile.Personal.Occupation = ddlOccupations.SelectedValue;
                profile.Personal.Website = txtWebsite.Text;

                // Address Info
                profile.Address.Country = ddlCountries.SelectedValue;
                profile.Address.Address = txtAddress.Text;
                profile.Address.AptNumber = txtAptNumber.Text;
                profile.Address.City = txtCity.Text;
                profile.Address.State = ddlStates1.SelectedValue;
                profile.Address.PostalCode = txtPostalCode.Text;

                // Contact Info
                profile.Contacts.DayPhone = txtDayTimePhone.Text;
                profile.Contacts.DayPhoneExt = txtDayTimePhoneExt.Text;
                profile.Contacts.EveningPhone = txtEveningPhone.Text;
                profile.Contacts.EveningPhoneExt = txtEveningPhoneExt.Text;
                profile.Contacts.CellPhone = txtCellPhone.Text;
                profile.Contacts.Fax = txtHomeFax.Text;

                // Company Info
                profile.Company.Company = txtCompanyName.Text;
                profile.Company.Address = txtCompanyAddress.Text;
                profile.Company.City = txtCompanyCity.Text;
                profile.Company.State = ddlStates2.SelectedValue;
                profile.Company.PostalCode = txtCompanyZip.Text;
                profile.Company.Phone = txtCompanyPhone.Text;
                profile.Company.Fax = txtCompanyFax.Text;
                profile.Company.EMail = txtCompanyEMail.Text;
                profile.Company.Website = txtCompanyWebsite.Text;

                // Subscriptions
                profile.Preferences.Newsletter = ddlNewsletter.SelectedValue;

                // this is what we will call from the button click
                // to save the user's profile
                profile.Save();
            }
        }

        #endregion

        #region update user info in detailsview

        protected void DetailsView1_ItemUpdating(object sender, DetailsViewUpdateEventArgs e)
        {
            //Need to handle the update manually because MembershipUser does not have a
            //parameterless constructor  
            MembershipUser memUser = System.Web.Security.Membership.GetUser();

            memUser.Email = (string)e.NewValues[0];
            //memUser.Comment = (string)e.NewValues[1];
            //memUserIsApproved = (bool)e.NewValues[2];
            try
            {
                System.Web.Security.Membership.UpdateUser(memUser);

                e.Cancel = true;
                DetailsView1.ChangeMode(DetailsViewMode.ReadOnly);
            }
            catch (Exception ex)
            {
                Response.Write("<div>The following error occurred:<font color="red"> " + ex.Message + "</font></div>");
                e.Cancel = true;
            }
        }

        #endregion

        #region delete user account

        protected void btnDeleteCurrentUser_Click(object sender, EventArgs e)
        {
            if (System.Web.Security.Membership.DeleteUser(Page.User.Identity.Name))
            {
                FormsAuthentication.SignOut();
                Roles.DeleteCookie();
                Response.Redirect("~/account-removed.aspx");
            }
            else
            {
                lblResult.Visible = true;
                lblResult.Text = "The Membership user was not deleted.";
            }

        }

        #endregion

        #region Update current Profile Button Click

        protected void btnUpdateProfile_Click(object sender, EventArgs e)
        {
            SaveProfile();
            lblProfileMessage.Text = "Profile saved successfully!";
        }

        #endregion

        #region end all user sessions on logout

        protected void LoginStatus1_LoggingOut(object sender, LoginCancelEventArgs e)
        {
            Session.Clear();
            Session.Abandon();
            Session.RemoveAll();
        }

        #endregion

        #region Get all Notifications


        #endregion

    }

}


Try write Trigger for Update Panel ControlId is your Grid ID it will work,that particular Portion will change
Try write Trigger for Update Panel ControlId is your Grid ID it will work,that particular Portion will change


这篇关于更改gridview索引时加载总页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆