MonoX support board

Start the conversation, ask questions and share tips and solutions with fellow developers.

Non-registered users can only browse through our support boards. Please register now if you want to post your questions. It takes a second and it is completely free. Alternatively, you can log in without registration using your credentials at major sites such as Google, Microsoft Live, OpenId, Facebook, LinkedIn or Yahoo.

Why webparts on homepage keeps the user on homepage ?  (Mono Support )

Viewed 30923 time(s), 19 post(s) 12/5/2012 4:31:51 PMby super
super

super

12/5/2012 4:31:51 PM
I am playing with monox 4.7 version and adding webparts on homepage.

I have noticed one thing that if I add blog container on homepage (by both ways: part catalog or by hardcode in default.aspx). If any user go on the website and click on any blog post. The user remains on the homepage itself when blog post opens up and user can comment on it.

Why user don't get navigated to blog section on clicking the blog post ?

Same flow with any other webpart. User remains on the homepage.

Any way to change this flow ? because this is not a user-friendly since it keeps the user on homepage and user won't get chance to browse other pages etc. Navigating to that section of website (which is clicked on homepage) is good way to show the user your website and other features.

any help ?

This content has not been rated yet. 
6018 Reputation 709 Total posts
denis

denis

12/6/2012 8:53:01 AM
Hi,
Blog parts heavily depend on the URL rewriting mechanism and can automatically detect the page they are working on. The behaviour you describe is by design, as it allows blog parts to be dropped on an arbitrary page and work out of the box, without setting each and every URL in the configuration. At the same time, all URLs are SEO-ready and bookmarkable.
If you would like to change this, you will have to manually set the URL properties in the configuration to reflect the page you would like to be transferred to: UrlSingleBlogPost, UrlAddBlogPost, UrlEditBlogPost, UrlListBlogPosts, UrlSearch, UrlTag, etc. By default, they contain the placeholder {PageName} that gets replaced by the name of the current page in the URL rewriting process. You can put the name of your custom page there.
Rated 5.00, 1 vote(s). 
7207 Reputation 956 Total posts
super

super

1/11/2013 9:45:04 PM
Denis,

Is this a lot of work or customization in code ? if no, I would deeply appreciate if you could please help me with the process here ?
This content has not been rated yet. 
6018 Reputation 709 Total posts
khorvat

khorvat

1/12/2013 8:53:46 AM
Hi, as Denis described you need to set the above properties in the blog page markup to point to your main blog page.
This content has not been rated yet. 
15993 Reputation 2214 Total posts
super

super

1/12/2013 1:31:03 PM
Khorvat, I would DEEPLY appreciate if you could help me with the process, PLEASE ?

In this page: http://monox.mono-software.com/MonoX/Pages/SocialNetworking/Dashboard.aspx - The way blog posts on right column is taking the user on blog page is exactly what I want ? This is how I want my blog container on homepage to work in same pattern. Please help me
This content has not been rated yet. 
6018 Reputation 709 Total posts
khorvat

khorvat

1/14/2013 11:30:57 AM
Hi Super,

you need to configure that control like this:
<%@ Register TagPrefix="MonoX" TagName="BlogPostList" Src="/MonoX/ModuleGallery/Blog/BlogPostList.ascx" %>
<MonoX:BlogPostList ID="ctlBlogPostList" RetainBreaksInDescription="false" CacheDuration="600" RewritePageTitle="false" Template="BlogPostListShort" runat="server" RssEnabled="true" IsHeaderVisible="False" MaxDescriptionChars="90" PageSize="5" MaxTitleChars="40" PagingEnabled="false" />
ctlBlogPostList.UrlSingleBlogPost = UrlUtility.RewritePagePath(ctlBlogPostList.UrlSingleBlogPost, RewrittenPaths.BlogPost.DefaultPage);
NOTE: You have sample pages source code available on the GitHub - Demo Pages, so please use that repository to check how we implemented dashboard.

Regards
This content has not been rated yet. 
15993 Reputation 2214 Total posts
super

super

1/15/2013 4:35:05 AM
Khorvat,

I downloaded the sample code - master page zip - copied the .cs file of default and dashboard.cs (social network) and pasted in my monox project with default.aspx and dashboard.aspx (in social networking).

I looked into code of social networking and following the same process, I did in Default,.aspx page and its .cs

Still the webpart keeps the user on default page and doesn't take the used to blog section (in url) for that specific blog post which is clicked. - PLEASE HELP ME

Here is my Default.aspx code:
<%@ Page
    Language="C#"
    AutoEventWireup="true"
    MasterPageFile="/MonoX/MasterPages/Default.master"
    Inherits="MonoSoftware.MonoX.Pages.Default"
    Title="MonoX - Portal Framework for ASP.NET"
    Codebehind="Default.aspx.cs" %>
      
<%@ MasterType TypeName="MonoSoftware.MonoX.BaseMasterPage" %> 
   
<%@ Register TagPrefix="MonoX" TagName="Editor" Src="/MonoX/ModuleGallery/MonoXHtmlEditor.ascx" %>
<%@ Register TagPrefix="MonoX" TagName="Rss" Src="/MonoX/ModuleGallery/RssReader.ascx" %>
<%@ Register Assembly="MonoX" Namespace="MonoSoftware.MonoX" TagPrefix="portal" %>
<%@ Register Assembly="MonoX" Namespace="MonoSoftware.MonoX.ModuleGallery" TagPrefix="ModuleGallery" %>
<%@ Register TagPrefix="MonoX" TagName="AdModule" Src="/MonoX/ModuleGallery/AdModule.ascx"  %>
<%@ Register TagPrefix="MonoX" TagName="SlideShow" Src="/MonoX/ModuleGallery/SlideShow.ascx"  %>
<%@ Register TagPrefix="MonoX" TagName="NewGroups" Src="/MonoX/ModuleGallery/SocialNetworking/Groups/NewGroupsList.ascx" %>
<%@ Register TagPrefix="MonoX" TagName="DiscussionTopic" Src="/MonoX/ModuleGallery/SocialNetworking/Discussion/DiscussionTopics.ascx" %>
<%@ Register TagPrefix="MonoX" TagName="BlogPostList" Src="/MonoX/ModuleGallery/Blog/BlogPostListH.ascx" %>
<%@ Register TagPrefix="MonoX" TagName="BlogContainer" Src="/MonoX/ModuleGallery/Blog/BlogContainer.ascx" %>
  
  
<%@ Import Namespace="MonoSoftware.MonoX.Resources" %>
<asp:Content ID="Content1" ContentPlaceHolderID="cp" runat="server">
    <div class="main">
        <div class="container">
            <div class="row-fluid">
                  
                  
                 <div class="span8 clearfix">
  
  
                    <portal:PortalWebPartZoneTableless HeaderText='<%$ Code: PageResources.Zone_LeftPartZone %>' ID="leftPartZone" runat="server" Width="100%" ChromeTemplateFile="Standard.htm">
            <ZoneTemplate>
                 <MonoX:BlogPostList ID="MyBlog" RewritePageTitle="false" Template="BlogListHOME" runat="server"  UsePrettyPhoto="true" DateFormatString="d" RelatedContentVisible="true" EnableSyntaxHighlighter="true" GravatarRenderType="NotSet" />
              
            </ZoneTemplate>
        </portal:PortalWebPartZoneTableless>
   
              
                </div>
  
  
                 <div class="span4 clearfix">
                        
                          <portal:PortalWebPartZoneTableless HeaderText='<%$ Code: PageResources.Zone_SocialZone %>' ID="connectPartZone" runat="server" Width="100%" ChromeTemplateFile="RightColumn.htm" ShowChromeForNonAdmins="true">
            <ZoneTemplate>
                      
                       
                    <MonoX:NewGroups runat="server" ID="MyGroups" CacheDuration="600" PagingEnabled="false" MaxDescriptionChars="90" AvatarSize="32" PageSize="5" RewritePageTitle="false"></MonoX:NewGroups>
                      
                </ZoneTemplate>
        </portal:PortalWebPartZoneTableless>
                </div>



Here is my Default.aspx.CS code:
using System;
using System.Linq;
using MonoSoftware.MonoX.Utilities;
using MonoSoftware.Core;
using MonoSoftware.MonoX.Resources;
using MonoSoftware.MonoX.Caching;
  
namespace MonoSoftware.MonoX.Pages
{
    public partial class Default : BasePage
    {
        #region Page Events
        protected override void OnLoad(EventArgs e)
        {
            MyBlog.UrlSingleBlogPost = UrlUtility.RewritePagePath(MyBlog.UrlSingleBlogPost, RewrittenPaths.BlogPost.DefaultPage);
            MyGroups.DefaultPageName = RewrittenPaths.GroupList.DefaultPage;
            base.OnLoad(e);
  
        }
        #endregion
  
    }
}




I am getting WHOOPS error message on my website:
tried running homepage, admin side - Same WHOOPS error...





Log error says this:

2013-01-14 23:30:18,852 [11] ERROR MonoX [BaseHttpApplication] - Application Error
System.Web.HttpParseException (0x80004005): MonoX\ModuleGallery\LoginSocial.ascx(16): error CS0433: The type 'MonoSoftware.MonoX.Paths' exists in both 'c:\Users\Lenovo\AppData\Local\Temp\Temporary ASP.NET Files\root\4e6d49a4\f6e757b7\assembly\dl3\a88d9370\03375ebb_d8f2cd01\ProjectName.Web.DLL' and 'c:\Users\Lenovo\AppData\Local\Temp\Temporary ASP.NET Files\root\4e6d49a4\f6e757b7\assembly\dl3\13358101\a7ed04cd_d1f2cd01\MonoX.DLL' ---> System.Web.HttpCompileException (0x80004005): MonoX\ModuleGallery\LoginSocial.ascx(16): error CS0433: The type 'MonoSoftware.MonoX.Paths' exists in both 'c:\Users\Lenovo\AppData\Local\Temp\Temporary ASP.NET Files\root\4e6d49a4\f6e757b7\assembly\dl3\a88d9370\03375ebb_d8f2cd01\ProjectName.Web.DLL' and 'c:\Users\Lenovo\AppData\Local\Temp\Temporary ASP.NET Files\root\4e6d49a4\f6e757b7\assembly\dl3\13358101\a7ed04cd_d1f2cd01\MonoX.DLL'
   at System.Web.Compilation.BuildManager.PostProcessFoundBuildResult(BuildResult result, Boolean keyFromVPP, VirtualPath virtualPath)
   at System.Web.Compilation.BuildManager.GetBuildResultFromCacheInternal(String cacheKey, Boolean keyFromVPP, VirtualPath virtualPath, Int64 hashCode, Boolean ensureIsUpToDate)
   at System.Web.Compilation.BuildManager.GetVPathBuildResultFromCacheInternal(VirtualPath virtualPath, Boolean ensureIsUpToDate)
   at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate)
   at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate)
   at System.Web.Compilation.BuildManager.GetVPathBuildResult(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean ensureIsUpToDate)
   at System.Web.UI.BaseTemplateParser.GetReferencedType(VirtualPath virtualPath, Boolean allowNoCompile)
   at System.Web.UI.BaseTemplateParser.GetUserControlType(VirtualPath virtualPath)
   at System.Web.UI.MainTagNameToTypeMapper.ProcessUserControlRegistration(UserControlRegisterEntry ucRegisterEntry)
   at System.Web.UI.BaseTemplateParser.ProcessDirective(String directiveName, IDictionary directive)

This content has not been rated yet. 
6018 Reputation 709 Total posts
super

super

1/14/2013 9:19:28 PM
For example:

When I run the project: My blog webpart is on my default.aspx (HOMEPAGE) so the url in my browser is this:

http://MySite/Default.aspx

Now when I click on the blog post, the urll becomes this (based on the above posted code)
http://MySite/Default/post/MonoX/7/Cloud-storage-for-your-data/

Requirement:
I want the url to become like this- when a user clicks on any blog post

http://MySite/blog/posts/MonoX/7/Cloud-storage-for-your-data/
This content has not been rated yet. 
6018 Reputation 709 Total posts
khorvat

khorvat

1/15/2013 8:58:40 AM
Hi Super,

error that you get is related to T4 template, you need to change the T4 template class name in your project to avoid this error. As for the rewritten url you need to define your own or change the existing one to accomplish your requirement. You can find it here in web.config it should look like this:

<rewrite url="^(.*)/(.*)/post/(.*)/(.*)/(.*)/(\?(.+))?$" to="$1/$2.aspx?BlogSlug=$3&BlogPostId=$4&$7" name="BlogPost" defaultPage="/Blog.aspx" urlPattern="/{PageName}/post/{Blog.Slug}/{IdentityId}/{Slug}/" />
So you need to change the "RewrittenPaths.BlogPost.DefaultPage" (the page you want to redirect visitor to read the blog post) of "MyBlog.UrlSingleBlogPost = UrlUtility.RewritePagePath(MyBlog.UrlSingleBlogPost, RewrittenPaths.BlogPost.DefaultPage);"

Let me know if that did the trick.

Regards
This content has not been rated yet. 
15993 Reputation 2214 Total posts
super

super

1/15/2013 3:49:17 PM
Khorvat,

This is what I did in RewrittenPaths.cs - I changed "RewrittenPaths" to "MyRewrittenPaths"
using System;
using System.Xml.XPath;
using System.Web;
 
namespace MonoSoftware.MonoX
{
    /// <summary>
    /// Strongly typed rewriten paths.
    /// </summary>
    public static class MyClassRewrittenPaths
    {
        static readonly XPathNavigator navigator;
     
        static MyClassRewrittenPaths()
        {
            string vRoot = String.Empty;
            if (HttpContext.Current != null && HttpContext.Current.Request != null)
                vRoot = HttpContext.Current.Request.MapPath("~");
            else
                //design mode
                vRoot = "Portal";
     
            XPathDocument document = new XPathDocument(String.Format("{0}\\web.config", vRoot));
            navigator = document.CreateNavigator();
        }
         
        static RewrittenPath GetRewrittenPathValue(string name)
        {
            navigator.MoveToRoot();
            string url = string.Empty;
            string urlPattern = string.Empty;
            string defaultPage = string.Empty;
            XPathNodeIterator iterator = navigator.Select(String.Format("configuration/MonoSoftware.Web/UrlRewriter/rewrite[@name = \"{0}\"]", name));
            if (iterator.MoveNext())
            {
                urlPattern = iterator.Current.GetAttribute("urlPattern", String.Empty);
                url = iterator.Current.GetAttribute("url", String.Empty);
                defaultPage = iterator.Current.GetAttribute("defaultPage", String.Empty);
            }
            if (String.IsNullOrEmpty(urlPattern))
            {
                iterator = navigator.Select(String.Format("configuration/MonoSoftware.Web/UrlRewriter/if/rewrite[@name = \"{0}\"]", name));
                if (iterator.MoveNext())
                {
                    urlPattern = iterator.Current.GetAttribute("urlPattern", String.Empty);
                    url = iterator.Current.GetAttribute("url", String.Empty);
                    defaultPage = iterator.Current.GetAttribute("defaultPage", String.Empty);
                }
            }
            if (String.IsNullOrEmpty(urlPattern))
            {
                throw new ApplicationException(String.Format("Can't find rewritten path where the unique name is '{0}'", name));
            }
            return new RewrittenPath(url, urlPattern, defaultPage);
        }
     
        /// <summary>
        /// 'BlogPostCommentsFiles' rewriten path '/{PageName}/post/{Blog.Slug}/{IdentityId}/{Slug}/'.
        /// </summary>
        public static RewrittenPath BlogPostCommentsFiles { get { return GetRewrittenPathValue("BlogPostCommentsFiles"); } }
        /// <summary>
        /// 'BlogPostFilesComments' rewriten path '/{PageName}/post/{Blog.Slug}/{IdentityId}/{Slug}/'.
        /// </summary>
        public static RewrittenPath BlogPostFilesComments { get { return GetRewrittenPathValue("BlogPostFilesComments"); } }
        /// <summary>
        /// 'BlogPostFiles' rewriten path '/{PageName}/post/{Blog.Slug}/{IdentityId}/{Slug}/'.
        /// </summary>
        public static RewrittenPath BlogPostFiles { get { return GetRewrittenPathValue("BlogPostFiles"); } }
        /// <summary>
        /// 'BlogPostComments' rewriten path '/{PageName}/post/{Blog.Slug}/{IdentityId}/{Slug}/'.
        /// </summary>
        public static RewrittenPath BlogPostComments { get { return GetRewrittenPathValue("BlogPostComments"); } }
        /// <summary>
        /// 'BlogPost' rewriten path '/Blog/post/{Blog.Slug}/{IdentityId}/{Slug}/'.
        /// </summary>
        public static RewrittenPath BlogPost { get { return GetRewrittenPathValue("BlogPost"); } }
        /// <summary>
        /// 'BlogPostsPaged' rewriten path '/{PageName}/posts/{Slug}/BlogPostPage/{PageNo}/'.
        /// </summary>
        public static RewrittenPath BlogPostsPaged { get { return GetRewrittenPathValue("BlogPostsPaged"); } }
        /// <summary>
        /// 'BlogPosts' rewriten path '/{PageName}/posts/{Slug}/'.
        /// </summary>
        public static RewrittenPath BlogPosts { get { return GetRewrittenPathValue("BlogPosts"); } }
        /// <summary>
        /// 'BlogSearch' rewriten path '/{PageName}/search/{Slug}/{SearchAction}/{SearchValue}/'.
        /// </summary>
        public static RewrittenPath BlogSearch { get { return GetRewrittenPathValue("BlogSearch"); } }
        /// <summary>
        /// 'BlogTag' rewriten path '/{PageName}/blog-tag/{Slug}/{Tag}/'.
        /// </summary>
        public static RewrittenPath BlogTag { get { return GetRewrittenPathValue("BlogTag"); } }
        /// <summary>
        /// 'BlogSettings' rewriten path '/{PageName}/settings/{Slug}/'.
        /// </summary>
        public static RewrittenPath BlogSettings { get { return GetRewrittenPathValue("BlogSettings"); } }
        /// <summary>
        /// 'BlogCommentsAdminComments' rewriten path '/{PageName}/comments/{Slug}/'.
        /// </summary>
        public static RewrittenPath BlogCommentsAdminComments { get { return GetRewrittenPathValue("BlogCommentsAdminComments"); } }
        /// <summary>
        /// 'BlogCommentsAdmin' rewriten path '/{PageName}/comments/{Slug}/'.
        /// </summary>
        public static RewrittenPath BlogCommentsAdmin { get { return GetRewrittenPathValue("BlogCommentsAdmin"); } }
        /// <summary>
        /// 'BlogPostEdit' rewriten path '/{PageName}/edit/{Blog.Slug}/{IdentityId}/{Slug}/'.
        /// </summary>
        public static RewrittenPath BlogPostEdit { get { return GetRewrittenPathValue("BlogPostEdit"); } }
        /// <summary>
        /// 'BlogPostInsert' rewriten path '/{PageName}/insert/{Slug}/'.
        /// </summary>
        public static RewrittenPath BlogPostInsert { get { return GetRewrittenPathValue("BlogPostInsert"); } }
        /// <summary>
        /// 'AllBlogPosts' rewriten path '/{PageName}/posts/{Slug}/'.
        /// </summary>
        public static RewrittenPath AllBlogPosts { get { return GetRewrittenPathValue("AllBlogPosts"); } }
        /// <summary>
        /// 'WlwManifest' rewriten path '/wlwmanifest.xml'.
        /// </summary>
        public static RewrittenPath WlwManifest { get { return GetRewrittenPathValue("WlwManifest"); } }
        /// <summary>
        /// 'MobileProfile' rewriten path '/mobile/profile/{UserNameUrlEncoded}/'.
        /// </summary>
        public static RewrittenPath MobileProfile { get { return GetRewrittenPathValue("MobileProfile"); } }
        /// <summary>
        /// 'Profile' rewriten path '/profile/{UserNameUrlEncoded}/'.
        /// </summary>
        public static RewrittenPath Profile { get { return GetRewrittenPathValue("Profile"); } }
        /// <summary>
        /// 'ProfileAbout' rewriten path '/profile-about/{UserNameUrlEncoded}/'.
        /// </summary>
        public static RewrittenPath ProfileAbout { get { return GetRewrittenPathValue("ProfileAbout"); } }
        /// <summary>
        /// 'ProfileFriends' rewriten path '/profile-friends/{UserNameUrlEncoded}/'.
        /// </summary>
        public static RewrittenPath ProfileFriends { get { return GetRewrittenPathValue("ProfileFriends"); } }
        /// <summary>
        /// 'ProfilePhotos' rewriten path '/profile-photos/{UserNameUrlEncoded}/'.
        /// </summary>
        public static RewrittenPath ProfilePhotos { get { return GetRewrittenPathValue("ProfilePhotos"); } }
        /// <summary>
        /// 'FileView' rewriten path '/fileview/{FileId}/{ReturnPageId}/'.
        /// </summary>
        public static RewrittenPath FileView { get { return GetRewrittenPathValue("FileView"); } }
        /// <summary>
        /// 'FileViewStandalone' rewriten path '/fileviewsa/{FileId}/{ReturnPageId}/'.
        /// </summary>
        public static RewrittenPath FileViewStandalone { get { return GetRewrittenPathValue("FileViewStandalone"); } }
        /// <summary>
        /// 'FileListTagFilter' rewriten path '/{PageName}/filelist-tag/{Slug}/'.
        /// </summary>
        public static RewrittenPath FileListTagFilter { get { return GetRewrittenPathValue("FileListTagFilter"); } }
        /// <summary>
        /// 'SiteSearch' rewriten path '/search/{Query}/'.
        /// </summary>
        public static RewrittenPath SiteSearch { get { return GetRewrittenPathValue("SiteSearch"); } }
        /// <summary>
        /// 'GroupView' rewriten path '/{PageName}/GroupView/{ShortId}/{Slug}/'.
        /// </summary>
        public static RewrittenPath GroupView { get { return GetRewrittenPathValue("GroupView"); } }
        /// <summary>
        /// 'GroupEdit' rewriten path '/{PageName}/GroupEdit/{ShortId}/{Slug}/'.
        /// </summary>
        public static RewrittenPath GroupEdit { get { return GetRewrittenPathValue("GroupEdit"); } }
        /// <summary>
        /// 'GroupList' rewriten path '/{PageName}/GroupList/'.
        /// </summary>
        public static RewrittenPath GroupList { get { return GetRewrittenPathValue("GroupList"); } }
        /// <summary>
        /// 'GroupInsert' rewriten path '/{PageName}/GroupInsert/'.
        /// </summary>
        public static RewrittenPath GroupInsert { get { return GetRewrittenPathValue("GroupInsert"); } }
        /// <summary>
        /// 'GroupSearch' rewriten path '/{PageName}/GroupSearch/{SearchValue}/'.
        /// </summary>
        public static RewrittenPath GroupSearch { get { return GetRewrittenPathValue("GroupSearch"); } }
        /// <summary>
        /// 'GroupSearchShowAll' rewriten path '/{PageName}/GroupSearch/'.
        /// </summary>
        public static RewrittenPath GroupSearchShowAll { get { return GetRewrittenPathValue("GroupSearchShowAll"); } }
        /// <summary>
        /// 'GroupCategory' rewriten path '/{PageName}/GroupCategory/{CategorySlug}/'.
        /// </summary>
        public static RewrittenPath GroupCategory { get { return GetRewrittenPathValue("GroupCategory"); } }
        /// <summary>
        /// 'RequestConfirmation' rewriten path '/RequestConfirmation/{RequestType}/{RequestId}/'.
        /// </summary>
        public static RewrittenPath RequestConfirmation { get { return GetRewrittenPathValue("RequestConfirmation"); } }
        /// <summary>
        /// 'PhotoList' rewriten path '/{PageName}/{ActiveControlAction}/{ActiveControlValue}/{AlbumView}/{AlbumId}/'.
        /// </summary>
        public static RewrittenPath PhotoList { get { return GetRewrittenPathValue("PhotoList"); } }
        /// <summary>
        /// 'PhotoView' rewriten path '/{PageName}/{ActiveControlAction}/{ActiveControlValue}/{PhotoView}/{PhotoId}/{AlbumId}/'.
        /// </summary>
        public static RewrittenPath PhotoView { get { return GetRewrittenPathValue("PhotoView"); } }
        /// <summary>
        /// 'Discussion' rewriten path '/{PageName}/dboard/{BoardId}/{Slug}/'.
        /// </summary>
        public static RewrittenPath Discussion { get { return GetRewrittenPathValue("Discussion"); } }
        /// <summary>
        /// 'DiscussionTopic' rewriten path '/{PageName}/dtopic/{TopicId}/{Slug}/'.
        /// </summary>
        public static RewrittenPath DiscussionTopic { get { return GetRewrittenPathValue("DiscussionTopic"); } }
        /// <summary>
        /// 'DiscussionTopicFilter' rewriten path '/{PageName}/dfilter/{FilterType}/{Slug}/'.
        /// </summary>
        public static RewrittenPath DiscussionTopicFilter { get { return GetRewrittenPathValue("DiscussionTopicFilter"); } }
        /// <summary>
        /// 'DiscussionTopicTagFilter' rewriten path '/{PageName}/dfilter-tag/{FilterType}/{Slug}/'.
        /// </summary>
        public static RewrittenPath DiscussionTopicTagFilter { get { return GetRewrittenPathValue("DiscussionTopicTagFilter"); } }
        /// <summary>
        /// 'DiscussionEditMessage' rewriten path '/{PageName}/dmessage/{MessageId}/{Mode}/'.
        /// </summary>
        public static RewrittenPath DiscussionEditMessage { get { return GetRewrittenPathValue("DiscussionEditMessage"); } }
        /// <summary>
        /// 'ContentPage' rewriten path '/ContentPage/{ContentId}/'.
        /// </summary>
        public static RewrittenPath ContentPage { get { return GetRewrittenPathValue("ContentPage"); } }
        /// <summary>
        /// 'MobileContentPage' rewriten path '/Mobile/Content/{ContentId}/'.
        /// </summary>
        public static RewrittenPath MobileContentPage { get { return GetRewrittenPathValue("MobileContentPage"); } }
    }
}


This is my Default.aspx.CS

using System;
using System.Linq;
using MonoSoftware.MonoX.Utilities;
using MonoSoftware.Core;
using MonoSoftware.MonoX.Resources;
using MonoSoftware.MonoX.Caching;
 
namespace MonoSoftware.MonoX.Pages
{
    public partial class Default : BasePage
    {
        #region Page Events
        protected override void OnLoad(EventArgs e)
        {
            MyBlogLK.UrlSingleBlogPost = UrlUtility.RewritePagePath(MyBlogLK.UrlSingleBlogPost, MyClassRewrittenPaths.BlogPost.DefaultPage);
            MyGroupsLK.DefaultPageName = MyClassRewrittenPaths.GroupList.DefaultPage;
            base.OnLoad(e);
 
        }
        #endregion
 
    }
}

I changed this in web.config
<rewrite url="^(.*)/(.*)/post/(.*)/(.*)/(.*)/(\?(.+))?$" to="$1/$2.aspx?BlogSlug=$3&BlogPostId=$4&$7" name="BlogPost" defaultPage="/Blog.aspx" urlPattern="/{PageName}/post/{Blog.Slug}/{IdentityId}/{Slug}/" />

To this
<rewrite url="^(.*)/(.*)/post/(.*)/(.*)/(.*)/(\?(.+))?$" to="$1/$2.aspx?BlogSlug=$3&BlogPostId=$4&$7" name="BlogPost" defaultPage="/Blog.aspx" urlPattern="/Blog/post/{Blog.Slug}/{IdentityId}/{Slug}/" />
As you can see I changed "{PageName}" to "Blog"


Still getting WHOOPS error message and here is the log:
System.Web.HttpParseException (0x80004005): c:\Users\NA\AppData\Local\Temp\Temporary ASP.NET Files\root\4e6d49a4\f6e757b7\App_Web_updatepanel.master.f3b849cc.8fj3gg3j.0.cs(418): error CS0433: The type 'MonoSoftware.MonoX.Paths' exists in both 'c:\Users\NA\AppData\Local\Temp\Temporary ASP.NET Files\root\4e6d49a4\f6e757b7\assembly\dl3\a88d9370\22e07fb2_33f3cd01\ProjectName.Web.DLL' and 'c:\Users\NA\AppData\Local\Temp\Temporary ASP.NET Files\root\4e6d49a4\f6e757b7\assembly\dl3\13358101\a7ed04cd_d1f2cd01\MonoX.DLL' ---> System.Web.HttpCompileException (0x80004005): c:\Users\NA\AppData\Local\Temp\Temporary ASP.NET Files\root\4e6d49a4\f6e757b7\App_Web_updatepanel.master.f3b849cc.8fj3gg3j.0.cs(418): error CS0433: The type 'MonoSoftware.MonoX.Paths' exists in both 'c:\Users\NA\AppData\Local\Temp\Temporary ASP.NET Files\root\4e6d49a4\f6e757b7\assembly\dl3\a88d9370\22e07fb2_33f3cd01\ProjectName.Web.DLL' and 'c:\Users\NA\AppData\Local\Temp\Temporary ASP.NET Files\root\4e6d49a4\f6e757b7\assembly\dl3\13358101\a7ed04cd_d1f2cd01\MonoX.DLL'
   at System.Web.Compilation.BuildManager.PostProcessFoundBuildResult(BuildResult result, Boolean keyFromVPP, VirtualPath virtualPath)
   at System.Web.Compilation.BuildManager.GetBuildResultFromCacheInternal(String cacheKey, Boolean keyFromVPP, VirtualPath virtualPath, Int64 hashCode, Boolean ensureIsUpToDate)
   at System.Web.Compilation.BuildManager.GetVPathBuildResultFromCacheInternal(VirtualPath virtualPath, Boolean ensureIsUpToDate)
   at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate)
   at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate)
   at System.Web.Compilation.BuildManager.GetVPathBuildResult(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean ensureIsUpToDate)
   at System.Web.Compilation.BuildManager.GetVPathBuildResult(VirtualPath virtualPath)
   at System.Web.UI.BaseTemplateParser.GetReferencedType(VirtualPath virtualPath, Boolean allowNoCompile)
   at System.Web.UI.BaseTemplateParser.GetReferencedType(VirtualPath virtualPath)
   at System.Web.UI.BaseTemplateParser.GetReferencedType(String virtualPath)
   at System.Web.UI.MasterPageParser.ProcessMainDirectiveAttribute(String deviceName, String name, String value, IDictionary parseData)
   at System.Web.UI.TemplateParser.ProcessMainDirective(IDictionary mainDirective)
   at System.Web.UI.TemplateParser.ProcessException(Exception ex)
   at System.Web.UI.TemplateParser.ParseStringInternal(String text, Encoding fileEncoding)
   at System.Web.UI.TemplateParser.ParseString(String text, VirtualPath virtualPath, Encoding fileEncoding)
   at System.Web.UI.TemplateParser.ParseReader(StreamReader reader, VirtualPath virtualPath)
   at System.Web.UI.TemplateParser.ParseFile(String physicalPath, VirtualPath virtualPath)
   at System.Web.UI.TemplateParser.ParseFile(String physicalPath, String virtualPath)
   at System.Web.UI.TemplateParser.ParseInternal()
   at System.Web.UI.TemplateParser.Parse()
   at System.Web.UI.TemplateParser.Parse(ICollection referencedAssemblies, VirtualPath virtualPath)
   at System.Web.Compilation.BaseTemplateBuildProvider.get_CodeCompilerType()
   at System.Web.Compilation.BuildProvider.GetCompilerTypeFromBuildProvider(BuildProvider buildProvider)
   at System.Web.Compilation.BuildProvidersCompiler.ProcessBuildProviders()
   at System.Web.Compilation.BuildProvidersCompiler.PerformBuild()
   at System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath)
   at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate)
   at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate)
   at System.Web.Compilation.BuildManager.GetVirtualPathObjectFactory(VirtualPath virtualPath, HttpContext context, Boolean allowCrossApp, Boolean throwIfNotFound)
   at System.Web.Compilation.BuildManager.GetVirtualPathObjectFactory(VirtualPath virtualPath, HttpContext context, Boolean allowCrossApp)
   at System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(VirtualPath virtualPath, Type requiredBaseType, HttpContext context, Boolean allowCrossApp)
   at System.Web.UI.PageHandlerFactory.GetHandlerHelper(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath)
   at System.Web.UI.PageHandlerFactory.System.Web.IHttpHandlerFactory2.GetHandler(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath)
   at System.Web.HttpApplication.MapHttpHandler(HttpContext context, String requestType, VirtualPath path, String pathTranslated, Boolean useAppConfig)
   at System.Web.HttpApplication.MapHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)



I am still struggling with this whole issue - Since I mentioned my requirement above - could you please tell me exactly what to do and where ? As you can see I am trying but still facing having problems ...







This content has not been rated yet. 
6018 Reputation 709 Total posts
1 2