Error Message with some pages of Classified Starter kit -- somme pages work and or are viewable

Discussion in 'ASP.NET Starter Kits' started by JRADVERTISING, Sep 17, 2007.

  1. Line 25 appears to be the issue because not all pages are working -- the same error message:

    Server Error in '/' Application.
    --------------------------------------------------------------------------------

    Object reference not set to an instance of an object.
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

    Source Error:


    Line 23: Protected Sub PasswordRecovery_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles PasswordRecovery.Init
    Line 24: Dim s As SiteSettings = SiteSettings.GetSharedSettings()
    Line 25: PasswordRecovery.MailDefinition.From = s.SiteEmailFromField
    Line 26: End Sub
    Line 27:


    Source File: E:\web\localsalesm\htdocs\Login.aspx.vb Line: 25

    Stack Trace:


    [NullReferenceException: Object reference not set to an instance of an object.]
    Login_aspx.PasswordRecovery_Init(Object sender, EventArgs e) in E:\web\localsalesm\htdocs\Login.aspx.vb:25
    System.Web.UI.Control.OnInit(EventArgs e) +2072044
    System.Web.UI.WebControls.PasswordRecovery.OnInit(EventArgs e) +11
    System.Web.UI.Control.InitRecursive(Control namingContainer) +321
    System.Web.UI.Control.InitRecursive(Control namingContainer) +198
    System.Web.UI.Control.InitRecursive(Control namingContainer) +198
    System.Web.UI.Control.InitRecursive(Control namingContainer) +198
    System.Web.UI.Control.InitRecursive(Control namingContainer) +198
    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +692

    Your help is appreciated

    Jack R
     
  2. Vikram:


    Where do I specifically make that change....



    <%@ Page Language="VB" MasterPageFile="~/MasterPage.master" CodeFile="Settings.aspx.vb"


    Inherits="Settings_aspx" Title="Site Setttings" %>


    <asp:Content ID="MainContent" ContentPlaceHolderID="Main" runat="server">


    <div id="body">


    <div id="col_main_left">


    <div id="user_assistance">


    <a id="content_start"></a>


    <h3>


    Actions</h3>


    <p>


    <asp:HyperLink ID="BackToAdminLink" runat="server" NavigateUrl="~/Admin/Default.aspx">back to Administration</asp:HyperLink>&amp;nbsp;</p>


    <asp:panel ID="UpdateErrorPanel" runat="server" Visible="False" EnableViewState="False">


    <p>


    <strong>There was an error writing to the Settings file


    App_Data\site-config.xml.</strong>


    Please make sure that the ASP.NET process has write-access to the file.</p>


    <p>


    The textbox below contains the XML equivalent of the Site Settings you saved. You


    can copy it and update the file manually.</p>


    <asp:TextBox ID="SettingsXmlTextBox" runat="server" TextMode="multiLine" Rows="20"


    Width="100%"></asp:TextBox>


    </asp:panel>


    </div>


    </div>


    <div id="col_main_right">


    <h2 class="section">


    Site Settings</h2>


    <div class="content_right">


    <fieldset>


    <asp:FormView ID="SettingsFormView" runat="server" DataSourceID="SettingsDataSource"


    DefaultMode="Edit">


    <EditItemTemplate>


    <legend>Ads require activation before appearing on the site:</legend>


    <asp:CheckBox Checked='<%# Bind("AdActivationRequired") %>' runat="server" ID="AdApprovalRequiredCheckBox"


    Text="Yes" />


    <p class="new_section">


    </p>


    <legend>Maximum Number of Days for which an Ad is active:</legend><span>


    <asp:TextBox Text='<%# Bind("MaxAdRunningDays") %>' runat="server" ID="MaxAdRunningDaysTextBox"


    Width="30px"></asp:TextBox>


    <p class="new_section">


    </p>


    <legend>Allow Users to edit their Ads:</legend>


    <asp:CheckBox Checked='<%# Bind("AllowUsersToEditAds") %>' runat="server" ID="AllowUsersToEditAdsCheckBox"


    Text="Yes" />


    <p class="new_section">


    </p>


    <legend>When Users remove inactive Ads:</legend>


    <asp:RadioButtonList ID="AllowUsersToRemoveAdsChoice" runat="server" SelectedValue='<%# Bind("AllowUsersToDeleteAdsInDB") %>'>


    <asp:ListItem Value="True">Remove them from the Database</asp:ListItem>


    <asp:ListItem Value="False">Keep in Database, but mark as Deleted</asp:ListItem>


    </asp:RadioButtonList>


    <p class="new_section">


    </p>


    <legend>Maximum Number of Photos to Upload:</legend><span>


    <asp:TextBox Text='<%# Bind("MaxPhotosPerAd") %>' runat="server" ID="MaxPhotosPerAdTextBox"


    Width="30px"></asp:TextBox>


    (0 to disable uploads)


    <p class="new_section">


    </p>


    <legend>Uploaded Photo:</legend>


    <asp:RadioButtonList ID="StoringPhotosChoice" runat="server" SelectedValue='<%# Bind("StorePhotosInDatabase") %>'>


    <asp:ListItem Value="True">Store Photos in Database.</asp:ListItem>


    <asp:ListItem Value="False">Store Photos in this Directory:</asp:ListItem>


    </asp:RadioButtonList>


    <asp:TextBox Text='<%# Bind("ServerPhotoUploadDirectory") %>' runat="server" ID="ServerPhotoUploadDirectory"


    CssClass="post_title" /></span> <span class="small_text">





    (must be within your web application directory and writable for the ASP.NET process)</span>


    <p class="new_section">


    </p>


    <legend>For new postings, send notifications to Administrators:</legend>


    <asp:DropDownList ID="AdminNotificationDropDown" runat="server" SelectedIndex='<%# Bind("AdminNotification") %>'


    CssClass="post_title">


    <asp:ListItem Value="0">None</asp:ListItem>


    <asp:ListItem Value="1">for each Ad</asp:ListItem>


    <asp:ListItem Value="2">Hourly</asp:ListItem>


    <asp:ListItem Value="3">Daily</asp:ListItem>


    </asp:DropDownList>


    <p class="new_section">


    </p>


    <legend>Name of this Site:</legend>


    <asp:TextBox Text='<%# Bind("SiteName") %>' runat="server" ID="SiteNameTextBox" CssClass="post_title"></asp:TextBox>


    <p>


    </p>


    <legend>Contact Email Address:</legend><span>


    <asp:TextBox Text='<%# Bind("SiteEmailAddress") %>' runat="server" ID="SiteEmailAddressTextBox"


    CssClass="post_title"></asp:TextBox></span>


    <p class="new_section">


    </p>


    <p>


    <asp:Button ID="UpdateButton" runat="server" Text="Update" CommandName="Update" />


    <asp:Button ID="Cancel" runat="server" Text="Cancel" OnClick="Cancel_Click" />


    </p>


    </EditItemTemplate>


    </asp:FormView>


    <asp:ObjectDataSource ID="SettingsDataSource" runat="server" TypeName="AspNet.StarterKits.Classifieds.BusinessLogicLayer.SiteSettings"


    SelectMethod="GetSharedSettings" UpdateMethod="UpdateSettings" DataObjectTypeName="AspNet.StarterKits.Classifieds.BusinessLogicLayer.SiteSettings"


    OnUpdated="SettingsDataSource_Updated">


    <UpdateParameters>


    <asp:parameter Type="Boolean" Name="AdActivationRequired"></asp:parameter>


    <asp:parameter Type="Int32" Name="MaxAdRunningDays"></asp:parameter>


    <asp:parameter Type="Int32" Name="MaxPhotosPerAd"></asp:parameter>


    <asp:parameter Type="Boolean" Name="StorePhotosInDatabase"></asp:parameter>


    <asp:parameter Type="Boolean" Name="AllowUsersToEditAds"></asp:parameter>


    <asp:parameter Type="Boolean" Name="AllowUsersToDeleteAdsInDB"></asp:parameter>


    <asp:parameter Type="String" Name="ServerPhotoUploadDirectory"></asp:parameter>


    <asp:parameter Name="AdminNotification"></asp:parameter>


    <asp:parameter Type="String" Name="SiteName"></asp:parameter>


    <asp:parameter Type="String" Name="SiteEmailAddress"></asp:parameter>


    </UpdateParameters>


    </asp:ObjectDataSource>


    </fieldset>


    </div>


    </div>


    </div>


    </asp:Content>
     
  3. Your SiteSettings's SiteEmailFromField is set to null or nothing[i.e. s.SiteEmailFromField (line 25)].

    You can log into your site as admin ,go to Site Administration>Site Settings and set the contact email address there.This should resolve this issue.

    Vikram

    DiscountASP.NET
    www.DiscountASP.NET
     

Share This Page