sharing menu between main site and sub site in asp.net - asp.net

I have a site "mysite.com" that is an asp.net MVC 5.2 application. To maintain separation of concerns I have implemented "blog.mysite.com" as a virtual application. It is the very cool MiniBlog by Mads Kristenson; a Razor Web Pages application in a virtual directory.
Correction: I'm actually employing an IIS virtual folder/application using "blog". So URL is "mysite.com/blog" as opposed to a sub-domain scenario using "blog.mysite.com".
I want to reuse/embed my html header section from the root site, (the menu from "mysite.com", which is uses bootstrap 3 navbar), into the
blog web site at "blog.mysite.com". Is this possible? Is there a relatively clean or slick way of doing this sort of thing? I'm trying to avoid having to maintain a copy of my root menu system in the virtual app.
The main site uses a partial view in the _Layout.cshtml to render the the menu/navbar, (html header section) and uses both server and client-side dynamics.
There is an administration menu that is only sent to the browser if the user is authenticated. This is controlled server-side, in the partial view, by checking Request.IsAuthenticated.
Also, on the client-side, there are triggers that dynamically show/hide portions of the menu. I have a "Demo" sub-menu that can be toggled. The same button controls the visibility of a viewport size monitor to help demonstrate responsive design. The state of this "demo mode" is all controlled by a simple cookie via jquery.cookie.js.

Related

Creating SPA (single page app) using .net Core (without JavaScript frameworks)

I want to develop a music streaming website that is single page app and the page does not refresh as shown in the image below with .NET Core Partial views. It means that part of the elements should always be fixed and the content of the pages should change like SPA website, for example, on this website, the music player in the bottom is always fixed and it is not refreshed when the URL is changed, and the music is not interrupted. And only by changing the URL address of the section, the pages will change and the page will not be refreshed, and elements such as sidebar, header, music player and playlist while playing will not be refreshed.
I want to do this without using javascript frameworks such as React and Angular and implement it in .NET Core using the partial views or view component feature.
-- Now my question is that this type of implementation:
Is it correct in terms of development logic?
Is it correct in terms of performance and optimization?
How about SEO and optimization for search engines?
Is it possible to implement the good experience of using the online player without refreshing and continuously playing music?
-- My goals for this work:
Developing a music website similar to Single page app with the ability to stream music without interruption when changing the address and changing the content of pages (exactly similar to SPA website)
Not refreshing the page when changing the URL address similar to SPA website
Having high performance and speed in loading pages
Having excellent SEO for search engines and optimal page loading speed

only content part of master page in asp.net will change

I am using Bootstrap for the website designing and while designing the master page
I just want only content part of master page should be reloaded,header and leftside bar remains same.(should not reload with content).Can any one suggest what to do in this case. and also the leftside bar of my web changes according to user and admin login.If user login then only limited option to be and when admin login all the option in left sidebar to be .So to do this dynamically .with latest technology.i am using dotnet fromework 4.5 and i am using web forms .My application is not in MVC.

How CMS handles postback for integrated web applications?

Currently I am working on a project to integrate legacy application (ASP.NET) with a content management system. There are two web servers, one act as cms server which is public facing and other the legacy application website behind the firewall. CMS drive the show to render header, footer, left and right info pans and menu.
My requirement is to show the legacy application aspx pages inside a content area of cms. Everything works fine except postback. The form submits to cms website whereas I want it to postback to legacy application.
How CMS or SharePoint achieve this? For example if a webpart is having a submit button which postbacks,
how SharePoint submit the form to webpart? What is the architecture behind this?
I'm not sure what you are asking. You're talking about a legacy application hosted in some kind of Iframe and it not being able to post back? Well of course?!
In SharePoint when you build a WebPart you can just use any server side method and it automatically posts back - just regular ASP.NET there, nothing special.
Sometimes a PostBack is called via Javascript for which the _doPostBack() Javascript method is used.

Open Sharepoint Application Page inside ASP.Net web app

I have the unusual situation to solve... There is a application page that runs inside SharePoint 2010 with a form to upload some file to a Document Library.
The thing is that this application page needs to be showed on a modal inside my ASPX web app.
I got this running using simplemodal jquery plugin running inside a iframe.
My question is... how can I achieve this functionality considering security questions like a controlled access to this application page? My SharePoint site does not allow anonymous access so I need to figure out how to allow public access only on this page.
I would re-create the page in this asp.net application and then communicate with sharepoint using the client object model or perhaps another approach such a custom webservice (but client model should be ok). I would say that this is the only clean way to achieve your goal.

How to open a silverlight web application as light window?

I created simple Silverlight Application using the web site host of the VS2010 ( default ) feature.
Now, I want to make the Silverlight Application to be shown as light window in the front of the default web site.
How can i do it ?
You can go OoB.
If you just wanted to show a modal dialog, then use the ChildWindow or MessageBox.
I think you could also remove the website from your solution and the Silverlight project will still open in the browser.
I am not so sure about what you mean by "Light Window", but I am sure these links will help you a lot:
Integrating Silverlight with a Web Page
How to: Add Silverlight to a Web Page by Using HTML
Update
If you checkout the web-host project, you'll see, that there is a test page that actually hosts the Silverlight project.
You can modify this page and move the Silverlight content around wherever necessary, or you might even embed it in a master page and/or use an external ASP.NET UserControl that will be used to load/host the Silverlight object dynamically.

Resources