Important Notice from AspDotNetStorefront
It is with dismay that we report that we have been forced, through the action of hackers, to shut off write-access to this forum. We are keen to leave the wealth of material available to you for research. We have opened a new forum from which our community of users can seek help, support and advice from us and from each other. To post a new question to our community, please visit: http://forums.vortx.com
Results 1 to 2 of 2

Thread: Topic not found

  1. #1
    jimmidude is offline Junior Member
    Join Date
    Nov 2009
    Posts
    11

    Default Topic not found

    Is there a redirect for content topic not found?

    If I delete topic and there is an old link somewhere or, mistyped topic link, or someone tries to change a topic URL they get a blank page.

  2. #2
    George the Great is offline Senior Member
    Join Date
    Nov 2006
    Location
    Cleveland, OH
    Posts
    1,792

    Default

    Not built in, but it's a very easy modification. Open up the driver.aspx.cs file and find the Page_Load method. In it you'll find an if statement checking the topicID
    Code:
    if (topicID > 0)
    Just add an else to the statement and redirect the user if there is no topicID or the topicID is 0
    Code:
    if (topicID > 0)
    {
        Topic1.TopicID = topicID;
        using (SqlConnection conn = DB.dbConn())
        {
            conn.Open();
            using (IDataReader rs = DB.GetRS("select Name from Topic with (NOLOCK) where Deleted=0 and TopicID=" + topicID, conn))
            {
                if (rs.Read())
                {
                    Topic1.TopicName = DB.RSFieldByLocale(rs, "Name", ThisCustomer.LocaleSetting);
                }
            }
        }
    }
    else
    {
        Response.Redirect("~/PageNotFound.aspx");
    }
    <a href="http://www.aspdotnetstorefront.com">Shopping Cart Software</a>