Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Beginning ASP.NET 2.0 AJAX ISBN: 978-0-470-11283-0
This is the forum to discuss the Wrox book Beginning ASP.NET 2.0 AJAX by Wallace B. McClure, Paul Glavich, Steve C. Orr, Craig Shoemaker, Steven A. Smith, Jim Zimmerman; ISBN: 9780470112830
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 2.0 AJAX ISBN: 978-0-470-11283-0 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Display Modes
  #1 (permalink)  
Old July 29th, 2008, 01:37 PM
Registered User
 
Join Date: Jul 2008
Location: , , .
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default Adding AJAX to CSK2 - Problems

I have been having issues adding AJAX to the CSK2. I have followed everything step by step, but at the completion of updating the web.config, site.master, and Basket.aspx, the AJAX does not work.

Here is the updated code so far. Maybe someone can spot something I missed.
web.config:
Code:
<?xml version="1.0"?>
<!-- 
    Note: As an alternative to hand editing this file you can use the 
    web admin tool to configure settings for your application. Use
    the Website->Asp.Net Configuration option in Visual Studio.
    A full list of settings and comments can be found in 
    machine.config.comments usually located in 
    \Windows\Microsoft.Net\Framework\v2.x\Config 
-->
<configuration>
    <configSections>
        <section name="loggingConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.LoggingSettings, Microsoft.Practices.EnterpriseLibrary.Logging, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null" requirePermission="false"/>
        <section name="exceptionHandling" type="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Configuration.ExceptionHandlingSettings, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null" requirePermission="false"/>
        <section name="dataConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings, Microsoft.Practices.EnterpriseLibrary.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null" requirePermission="false"/>
        <section name="securityCryptographyConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Security.Cryptography.Configuration.CryptographySettings, Microsoft.Practices.EnterpriseLibrary.Security.Cryptography, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null" requirePermission="false"/>
        <section name="TaxService" type="Commerce.Providers.TaxServiceSection" allowDefinition="MachineToApplication" restartOnExternalChanges="true" requirePermission="false"/>
        <section name="FulfillmentService" type="Commerce.Providers.FulfillmentServiceSection" allowDefinition="MachineToApplication" restartOnExternalChanges="true" requirePermission="false"/>
        <section name="PaymentService" type="Commerce.Providers.PaymentServiceSection" allowDefinition="MachineToApplication" restartOnExternalChanges="true" requirePermission="false"/>
        <section name="GeneralSettings" type="GeneralSettings" allowDefinition="MachineToApplication" restartOnExternalChanges="true" requirePermission="false"/>
        <section name="PayPalProSettings" type="PayPalProSettings" allowDefinition="MachineToApplication" restartOnExternalChanges="true" requirePermission="false"/>
        <section name="PayPalStandardSettings" type="PayPalStandardSettings" allowDefinition="MachineToApplication" restartOnExternalChanges="true" requirePermission="false"/>
        <section name="SubSonicService" type="SubSonic.SubSonicSection, SubSonic" allowDefinition="MachineToApplication" restartOnExternalChanges="true" requirePermission="false"/>


        <sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
            <sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
                <section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication"/>
                <sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
                    <section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="Everywhere" />
                    <section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication" />
                    <section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication" />
                </sectionGroup>
            </sectionGroup>
        </sectionGroup>


    </configSections>
    <appSettings>
        <add key="discountTitle" value="Our Price"/>
        <add key="discountDescription" value="Everyday Low Price"/>
        <add key="tagLine" value="The Commerce Starter Kit: Sell Your Bits, Not Your Soul."/>
        <add key="companyOrderIdentifier" value="CSK"/>
        <add key="defaultCurrency" value="USD"/>
        <add key="StrikeIron.taxdatabasic" value="http://ws.strikeiron.com/StrikeIron/taxdatabasic"/>
    </appSettings>
    <!--
  templateDirectory   - you can override the generated code template by creating your own. See the 
                        samples in the Dev directory. This needs to be an absolute link.

  generatedNamespance - if you don't want to use the Global, specify it here
  spClassName         - use your own class name for SPs. The defaul is "SPs"
  fixPluralClassNames - If you have pluralized tables and you want singular, set this here.
  -->
    <SubSonicService defaultProvider="ELib2DataProvider">
        <providers>
            <add name="ELib2DataProvider" type="SubSonic.ELib2DataProvider, SubSonic" connectionStringName="CommerceTemplate"/>
        </providers>
    </SubSonicService>
    <loggingConfiguration name="Logging Application Block" tracingEnabled="true" defaultCategory="General" logWarningsWhenNoCategoriesMatch="true">
        <listeners>
            <add databaseInstanceName="CommerceTemplate" writeLogStoredProcName="WriteLog" addCategoryStoredProcName="AddCategory" formatter="Text Formatter" listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Database.Configuration.FormattedDatabaseTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging.Database, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null" traceOutputOptions="None" type="Microsoft.Practices.EnterpriseLibrary.Logging.Database.FormattedDatabaseTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging.Database, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null" name="Database Trace Listener"/>
        </listeners>
        <formatters>
            <add template="Timestamp: {timestamp}#xA;Message: {message}#xA;Category: {category}#xA;Priority: {priority}#xA;EventId: {eventid}#xA;Severity: {severity}#xA;Title:{title}#xA;Machine: {machine}#xA;Application Domain: {appDomain}#xA;Process Id: {processId}#xA;Process Name: {processName}#xA;Win32 Thread Id: {win32ThreadId}#xA;Thread Name: {threadName}#xA;Extended Properties: {dictionary({key} - {value}#xA;)}" type="Microsoft.Practices.EnterpriseLibrary.Logging.Formatters.TextFormatter, Microsoft.Practices.EnterpriseLibrary.Logging, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null" name="Text Formatter"/>
        </formatters>
        <categorySources>
            <add switchValue="All" name="General">
                <listeners>
                    <add name="Database Trace Listener"/>
                </listeners>
            </add>
            <add switchValue="Warning" name="Exception">
                <listeners>
                    <add name="Database Trace Listener"/>
                </listeners>
            </add>
        </categorySources>
        <specialSources>
            <allEvents switchValue="All" name="All Events"/>
            <notProcessed switchValue="All" name="Unprocessed Category"/>
            <errors switchValue="All" name="Logging Errors &amp; Warnings">
                <listeners>
                    <add name="Database Trace Listener"/>
                </listeners>
            </errors>
        </specialSources>
    </loggingConfiguration>
    <exceptionHandling>
        <exceptionPolicies>
            <add name="Application Exception">
                <exceptionTypes>
                    <add type="System.Exception, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" postHandlingAction="NotifyRethrow" name="Exception">
                        <exceptionHandlers>
                            <add logCategory="Exception" eventId="100" severity="Warning" title="Enterprise Library Exception Handling" formatterType="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.TextExceptionFormatter, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null" priority="1" type="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging.LoggingExceptionHandler, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null" name="Logging Handler"/>
                        </exceptionHandlers>
                    </add>
                </exceptionTypes>
            </add>
        </exceptionPolicies>
    </exceptionHandling>
    <dataConfiguration defaultDatabase="CommerceTemplate"/>


    <connectionStrings>
        <clear/>


        <add name="CommerceTemplate" connectionString="STOREDATASOURCEUNSET" providerName="System.Data.SqlClient"/>


        <add name="LocalSqlServer" connectionString="MEMBERSHIPDATASOURCEUNSET" providerName="System.Data.SqlClient"/>

    </connectionStrings>


    <securityCryptographyConfiguration>
        <hashProviders>
            <add algorithmType="System.Security.Cryptography.SHA1Managed, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" saltEnabled="true" type="Microsoft.Practices.EnterpriseLibrary.Security.Cryptography.HashAlgorithmProvider, Microsoft.Practices.EnterpriseLibrary.Security.Cryptography, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null" name="SHA1Managed"/>
        </hashProviders>
        <symmetricCryptoProviders>
            <add scope="CurrentUser" type="Microsoft.Practices.EnterpriseLibrary.Security.Cryptography.DpapiSymmetricCryptoProvider, Microsoft.Practices.EnterpriseLibrary.Security.Cryptography, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null" name="DPAPI Symmetric Cryptography Provider"/>
        </symmetricCryptoProviders>
    </securityCryptographyConfiguration>
    <!--
  test key (Thanks Dave!)
  you can get a free key for testing by registering at
  strike iron. You can put you user/pass here, or a registration key
  -->
    <TaxService defaultProvider="FlatRateTaxProvider">
        <providers>
            <clear />
            <add connectionStringName="CommerceTemplate" name="FlatRateTaxProvider"
             type="Commerce.Providers.FlatRateTaxProvider" />
        </providers>
    </TaxService>
    <GeneralSettings currencyCode="USD" loginRequirement="checkout"/>
    <PayPalProSettings isActive="true" useSandbox="true" APIUserName="business_api1.csk.com"
  APIPassword="commerce" certificateName="csk.pfx" certificatePassword="commerce" />
    <PayPalStandardSettings isActive="true" useSandbox="true" businessEmail="business@csk.com"
    PDTID="4wscjERBD3ik_E7hmrqVaXHilJTCegrJ5FJogluERPo8H9ixPskOmFXuQK8"/>
    <FulfillmentService defaultProvider="SimpleShippingProvider" useShipping="true" dimensionUnit="inches" shipFromZip="75010" shipFromCountryCode="US" shipPackagingBuffer="1">
        <providers>
            <clear/>
            <add connectionStringName="CommerceTemplate" name="SimpleShippingProvider" type="Commerce.Providers.SimpleShippingProvider"/>
        </providers>
    </FulfillmentService>
    <PaymentService acceptCreditCards="true" defaultProvider="PayPalPaymentProvider">
        <providers>
            <clear />
            <add serviceUserName="business_api1.csk.com" servicePassword="commerce"
             sslCertFile="csk.pfx" sslCertPassword="commerce" merchantID="business@csk.com"
             currencyCode="USD" name="PayPalPaymentProvider" type="Commerce.Providers.PayPalPaymentProvider" />
        </providers>
    </PaymentService>
    <!--
  <PaymentService defaultProvider="AuthorizeNetPaymentProvider">
    <providers>
      <clear />
      <add name="AuthorizeNetPaymentProvider" type="Commerce.Providers.AuthorizeNetPaymentProvider, Commerce.PaymentProvider" 
      serviceUserName="cnpdev1799" 
      servicePassword="authnet101" 
      transactionKey="COAd7pinhMc5Jgs9" 
      currencyCode="USD" 
      serverURL="https://test.authorize.net/gateway/transact.dll"
      />
    </providers>
  </PaymentService>
 -->
    <system.web>
        <!--
        <trust level="CSK_Medium_Trust" originUrl=".*"  />
        -->
        <httpHandlers>
            <remove verb="*" path="*.asmx"/>
            <add verb="*" path="*.asmx" type="Microsoft.Web.Services.ScriptHandlerFactory" validate="false"/>
            <!--
          The MultiRequestHandler enables multiple requests to be handled in one
          roundtrip to the server. Its use requires Full Trust.
      -->
            <add verb="*" path="atlasbatchcall.axd" type="Microsoft.Web.Services.MultiRequestHandler" validate="false"/>
            <add verb="*" path="atlasglob.axd" type="Microsoft.Web.Globalization.GlobalizationHandler" validate="false"/>
            <!--
          The IFrameHandler enables a limited form of cross-domain calls to 'Atlas' web services.
          This should only be enabled if you need this functionality and you're willing to expose
          the data publicly on the Internet.
          To use it, you will also need to add the attribute [WebOperation(true, ResponseFormatMode.Json, true)]
          on the methods that you want to be called cross-domain.
          This attribute is by default on any DataService's GetData method.

      <add verb="*" path="iframecall.axd" type="Microsoft.Web.Services.IFrameHandler" validate="false"/>
      -->
            <add verb="*" path="*.asbx" type="Microsoft.Web.Services.ScriptHandlerFactory" validate="false"/>


            <remove verb="*" path="*.asmx"/>
            <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
            <add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
            <add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/>

        </httpHandlers>
        <httpModules>
            <add name="MagicAjax" type="MagicAjax.MagicAjaxModule, MagicAjax"/>
            <!-- Module removed
            <add name="ScriptModule" type="Microsoft.Web.Services.ScriptModule"/>
                     -->
            <add name="BridgeModule" type="Microsoft.Web.Services.BridgeModule"/>
            <add name="WebResourceCompression" type="Microsoft.Web.Services.WebResourceCompressionModule"/>


            <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>

        </httpModules>
        <globalization requestEncoding="utf-8" responseEncoding="utf-8" fileEncoding="utf-8" culture="auto:en-US" uiCulture="auto:en"/>
        <roleManager enabled="true">
            <providers>
                <clear/>
                <add name="AspNetSqlRoleProvider" connectionStringName="LocalSqlServer" applicationName="CSK" type="System.Web.Security.SqlRoleProvider"/>
            </providers>
        </roleManager>
        <membership defaultProvider="AspNetSqlMembershipProvider" userIsOnlineTimeWindow="15" hashAlgorithmType="">
            <providers>
                <clear/>
                <add connectionStringName="LocalSqlServer" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="true" applicationName="CSK" requiresUniqueEmail="false" passwordFormat="Hashed" maxInvalidPasswordAttempts="5" passwordAttemptWindow="10" passwordStrengthRegularExpression="" minRequiredPasswordLength="4" minRequiredNonalphanumericCharacters="0" name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
            </providers>
        </membership>
        <anonymousIdentification enabled="true"/>
        <authentication mode="Forms">
            <forms name=".ASPNET" loginUrl="login.aspx" protection="All" timeout="30" path="/"/>
        </authentication>
        <authorization>
            <allow users="?"/>
        </authorization>
        <profile automaticSaveEnabled="true" defaultProvider="SqlProvider">
            <providers>
                <clear/>
                <add name="SqlProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="LocalSqlServer" applicationName="CSK"/>
            </providers>
            <properties>
                <add name="LastShippingAddress" type="Commerce.Common.Address" allowAnonymous="true"/>
                <add name="LastBillingAddress" type="Commerce.Common.Address" allowAnonymous="true"/>
                <add name="FullName" type="System.String" allowAnonymous="true"/>
                <add name="CurrentOrderTax" type="System.Decimal" allowAnonymous="true"/>
                <add name="CurrentOrderShipping" type="System.Decimal" allowAnonymous="true"/>
                <add name="CurrentOrderShippingMethod" type="System.String" allowAnonymous="true"/>
            </properties>
        </profile>
        <!-- 
            Set compilation debug="true" to insert debugging 
            symbols into the compiled page. Because this 
            affects performance, set this value to true only 
            during development.
        -->
        <compilation debug="true">
            <buildProviders>
                <add extension=".asbx" type="Microsoft.Web.Services.BridgeBuildProvider"/>
            </buildProviders>
            <assemblies>
                <add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
                <add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
                <add assembly="System.Management, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
                <add assembly="System.Configuration.Install, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
                <add assembly="System.Data.OracleClient, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
                <add assembly="System.Messaging, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
                <add assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
            </assemblies>
        </compilation>
        <!--
            The <authentication> section enables configuration 
            of the security authentication mode used by 
            ASP.NET to identify an incoming user. 
        -->
        <!--
            The <customErrors> section enables configuration 
            of what to do if/when an unhandled error occurs 
            during the execution of a request. Specifically, 
            it enables developers to configure html error pages 
            to be displayed in place of a error stack trace.
        -->
        <customErrors mode="Off">
            <!--
            <error statusCode="500" redirect="ExceptionPage.aspx"/>
      -->
        </customErrors>
        <pages styleSheetTheme="Default">
            <controls>
                <add namespace="Microsoft.Web.UI" assembly="Microsoft.Web.Atlas" tagPrefix="atlas"/>
                <add namespace="Microsoft.Web.UI.Controls" assembly="Microsoft.Web.Atlas" tagPrefix="atlas"/>
                <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
            </controls>
        </pages>
    </system.web>
    <system.net>
        <mailSettings>
            <smtp from="me@mystore.com">
                <network host="localhost" password="" userName=""/>
            </smtp>
        </mailSettings>
    </system.net>


    <system.webServer>
        <validation validateIntegratedModeConfiguration="false"/>
        <modules>
            <add name="ScriptModule" preCondition="integratedMode" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
        </modules>
        <handlers>
            <remove name="WebServiceHandlerFactory-Integrated" />
            <add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode"
                 type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
            <add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode"
                 type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
            <add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
        </handlers>
    </system.webServer>

    <system.web.extensions>
        <scripting>
            <webServices>

                <!--
      <jsonSerialization maxJsonLength="500">
        <converters>
          <add name="ConvertMe" type="Acme.SubAcme.ConvertMeTypeConverter"/>
        </converters>
      </jsonSerialization>
      -->

                <!--
        <authenticationService enabled="true" requireSSL = "true|false"/>
      -->

                <!-- Uncomment these lines to enable the profile service. To allow profile properties to be retrieved
           and modified in ASP.NET AJAX applications, you need to add each property name to the readAccessProperties and
           writeAccessProperties attributes. -->
                <!--
      <profileService enabled="true"
                      readAccessProperties="propertyname1,propertyname2"
                      writeAccessProperties="propertyname1,propertyname2" />
      -->
            </webServices>
            <!--
      <scriptResourceHandler enableCompression="true" enableCaching="true" />
      -->
        </scripting>
    </system.web.extensions>

</configuration>
site.master:
Code:
<%@ Master Language="C#" AutoEventWireup="true" CodeFile="site.master.cs" Inherits="site" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head id="Head1" runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <link id="Link1" rel="stylesheet" type="text/css" href='~/js/modal/subModal.css' runat="server" />
    <meta name="description" content="Description here" />
    <meta name="keywords" content="Keywords here"  />
    <title></title>
 </head>
<body>
<form id="elForm" runat="server" defaultbutton="btnSearch">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <div id="header">
        <div id="logo">
            <a href="<%=Page.ResolveUrl("~/default.aspx")%>"><img src="<%=Page.ResolveUrl("~/images/csklogo.gif")%>" alt="Your Logo Here"/></a>
        </div>
        <div id="menu1">

            <asp:LoginView ID="LoginView1" runat="server">
                <AnonymousTemplate>
                    [list]
                        <li class="first"><a href="<%=Page.ResolveUrl("~/basket.aspx")%>"><img src="<%=Page.ResolveUrl("~/images/icons/cart.gif")%>"  align="absmiddle" alt=""/> My Cart <%if(ShowBasket()){%>(<%=this.GetItemCount()%>)<%} %></a></li>
                        <li><a href="<%=Page.ResolveUrl("~/login.aspx") %>">Log In</a></li>
                        <li><a href="<%=Page.ResolveUrl("~/register.aspx") %>">Register</a></li>
                    </ul>                
                </AnonymousTemplate>
                <LoggedInTemplate>

                [list]
                    <li class="first">Welcome Back <%=Page.User.Identity.Name %>!</li>
                    <li><a href="<%=Page.ResolveUrl("~/basket.aspx")%>"><img src="<%=Page.ResolveUrl("~/images/icons/cart.gif")%>" align="absmiddle" alt=""/> My Cart <%if (ShowBasket())
                                                                                                                                                        {%>(<%=this.GetItemCount()%>)<%} %></a></li>
                    <li><a href="<%=Page.ResolveUrl("~/myorders.aspx")%>">My Orders</a></li>
                    <li><asp:LinkButton ID="lnkLogout" CausesValidation="false" runat="server" Text="Log out" OnClick="lnkLogout_Click"></asp:LinkButton></li>
                </ul>             
                </LoggedInTemplate>

            </asp:LoginView>
        </div>
        <div id="mainmenu">
            [list]
                <li><a href="<%=Page.ResolveUrl("~/default.aspx")%>" class="selected">Home</a></li>
                <li><a href="#">Services</a></li>
                <li><a href="#">Contact</a></li>
                <%if(Page.User.IsInRole("Administrator")){ %>
                <li><a href="<%=Page.ResolveUrl("~/admin") %>">Admin</a></li>
                <%} %>
            </ul>
        </div>
    </div>
    <div id="bar">
        <div id="searchbar">

            Search:
            <asp:TextBox ID="txtSearch" runat="server"></asp:TextBox>
            <asp:ImageButton ID="btnSearch" runat="server" SkinID="doSearch" ImageAlign="AbsMiddle" OnClick="btnSearch_Click" />
        </div>
    </div>

    <asp:contentplaceholder  id="ContentPlaceHolder1" runat="server">
    </asp:contentplaceholder>


</form>
</body>
</html>
<script type="text/javascript">
function popItScroll(theLink){ 
    window.open(theLink,null,'height=800,width=700,scrollbars=yes,resizable=yes'); 

}
function showIt(theBox){
    if(theBox.style.display==""){
        theBox.style.display="none";
    }else{
        theBox.style.display="";

    }
}
function toggleIt(theBox){
    if(theBox.style.display=="none"){
        new Effect.Appear(theBox);
    }else{
        new Effect.Fade(theBox);

    }
}
</script>
Basket.aspx:
Code:
<%@ Page Language="C#" MasterPageFile="~/site.master" AutoEventWireup="true" CodeFile="Basket.aspx.cs" Inherits="Basket" Title="Your Shopping Cart" %>

<%@ Register Src="Modules/MainNavigation.ascx" TagName="MainNavigation" TagPrefix="uc4" %>
<%@ Register Src="Modules/CatalogList.ascx" TagName="CatalogList" TagPrefix="uc2" %>
<%@ Register Assembly="eWorld.UI" Namespace="eWorld.UI" TagPrefix="ew" %>
<%@ Register Src="Modules/AdContainer.ascx" TagName="AdContainer" TagPrefix="uc1" %>
<%@ Register Src="Modules/RecentCategories.ascx" TagName="RecentCategories" TagPrefix="uc2" %>
<%@ Register Src="Modules/RecentProductsViewed.ascx" TagName="RecentProductsViewed"
    TagPrefix="uc3" %>
<%@ Register Src="Modules/Products/ProductSummaryDisplay.ascx" TagName="ProductSummaryDisplay" TagPrefix="uc1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<div id="leftcontent">
    <uc4:MainNavigation ID="MainNavigation1" runat="server" />
    <uc1:AdContainer id="AdContainer2" runat="server" BoxPlacement="Left" BoxCssClass="">
    </uc1:AdContainer>
</div>

<div id="centercontent">
        <asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="UpdatePanel1">
            <ProgressTemplate>
                Updating...<img src="18-1.gif" />
            </ProgressTemplate>
        </asp:UpdateProgress>
        <br />
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
<h4>Your Shopping Cart: <asp:Label ID="lblSubtotal" runat="server"></asp:Label></h4>
<br />
<div>
    <asp:Button ID="btnAdjust" runat="server" Text="Update Basket" OnClick="AdjustBasket"/>
</div>
<br />
<table width="650" >
<asp:Repeater ID="rptBasket" runat="server" OnItemCommand="DeleteItem" >
    <ItemTemplate>
            <tr>
                <td  colspan="2" style="background-color:whitesmoke;" align="right"><asp:LinkButton ID="lnkRemove" runat="server" ><img src="images/icons/delete.gif" /></asp:LinkButton></td>
            </tr>
            <tr>
                <td colspan="2">
                    <h5><a href="product.aspx?id=<%#Eval("productID") %>"><%#Eval("productName") %></a></h5>
                </td>
                </tr>
            <tr>
                <td>
                    <img src='<%#Eval("imageFile")%>' height="80" width="90"/><br />
                     <div class="smalltext">Added on <%#DateTime.Parse(Eval("createdOn").ToString()).ToShortDateString() %></div>

                </td>                
                <td>
                    <div>
                        <ew:NumericBox ID="txtQuantity" runat="server" Width="20px" Text='<%#Eval("quantity") %>'></ew:NumericBox>
                        @ <%#decimal.Parse(Eval("pricePaid").ToString()).ToString("C") %> = <%#decimal.Parse(Eval("lineTotal").ToString()).ToString("C") %></div>
                        <div class="usuallyships">Usually ships in <%#Eval("shippingEstimate") %></div>

                        <asp:Label ID="lblProductID" runat="server" Visible="false" Text='<%#Eval("productID") %>'></asp:Label>
                        <asp:Label ID="lblSelectedAtts" runat="server" Text='<%#Eval("attributes") %>'></asp:Label>

                    </div>
                </td>
            </tr>
            <tr><td><div class="tenpixspacer"></div></td></tr>
    </ItemTemplate>
</asp:Repeater>
</table>
        </ContentTemplate>    
    </asp:UpdatePanel>    
<asp:Panel ID="pnlCheckout" runat="server">
    <div id="rightcontent">
        <div class="coreboxtop"></div>
        <div class="coreboxheader">Ready To Buy?</div>
        <div class="coreboxbody">
                Checkout is quick and simple!

            <asp:HyperLink ID="lnkCheckout" runat="server" NavigateUrl="~/Checkout.aspx" SkinID="Checkout">[lnkCheckout]</asp:HyperLink>
        </div>
        <div class="coreboxbottom"></div>
    <br class="clear" />
    </div>
</asp:Panel>

<asp:Panel ID="pnlNada" runat="server">
    <h4>There's nothing in your cart !</h4>
    <h5>We have lots of cool things you might be interested in checking out though....</h5>
    <asp:DataList ID="dtProducts" runat="server"  RepeatColumns="3" RepeatDirection="Horizontal">
    <ItemTemplate>
    <uc1:ProductSummaryDisplay ID="ProductSummaryDisplay1" runat="server" 
        ProductName='<%#Eval("ProductName") %>'
        ImageFile='<%#Eval("ImageFile") %>'
        ProductID='<%#Eval("ProductID") %>'
        OurPrice='<%#Eval("OurPrice") %>'
        RetailPrice='<%#Eval("RetailPrice") %>'
        ShippingEstimate='<%#Eval("ShippingEstimate") %>'
        Rating='<%#Eval("Rating") %>'
        SKU='<%#Eval("SKU") %>'
        ProductGUID='<%#Eval("ProductGUID")%>'
   />
    </ItemTemplate>
    </asp:DataList>
</asp:Panel>

</div>
</asp:Content>
Was wondering if anyone had any problems with this?
 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Problems with AJAX 2.0 ilegend .NET Framework 2.0 13 August 25th, 2008 05:27 AM
Adding AJAX functionality to TBH gujju BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 1 January 5th, 2008 01:35 AM
Ajax Problems ch. 27 gigs BOOK: Professional ASP.NET 2.0 Server Control and Component Development ISBN: 978-0-471-79350-2 0 September 24th, 2007 06:50 AM
Adding AJAX to existing ASP.NET application lols BOOK: Beginning Ajax with ASP.NET 1 January 29th, 2007 10:25 PM
Problems with AJAX Function hugh@kmcnetwork.com Javascript 4 December 14th, 2005 12:29 AM



All times are GMT -4. The time now is 03:36 AM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.