Tag pages with information to scrape into a database - asp.net

I want to build a summary of my pages to create a site map, for purposes of displaying which functionality is available on which pages. For example, I would like to tag a page with the following functionality:
[CreateNewRoute]
[DeleteRoute]
[EditRoute]
I want to put this information into a database, so I can search for which pages are allowed to create routes, outside of when the application is running.
Is there a good way to automate this? Running it periodically to update the database would be fine, as long as it need not be manually entered.
The application is in Visual Studio, specifically VB.NET, if that matters.

Related

Update multiple Umbraco sites through windows application

We are using umbraco 7.1.3
As per client's requirement we need to create more then 550 Umbraco CMS sites for different cities with same template and asp.net user control which access data from one master database.
So we created one windows application that will create 550+ sites as per city name under one Non-Umbraco root site.
We also managed to create different Umbraco database for each site is created and moved published code under to Non-Umbraco root site and convert to application and also updated Web.config file for each site dynamically.
After that when-ever we found that our logic or UI was not correct we also update DLL, ASCX user controls and CSS to all sites through same window application.
Till now everything was going smooth, but now we have one major change and that contains new document type, template, macro and new menu needs to be added dynamically. Updating published code through windows application was easy but we don't found any way to make update Umbraco database of 500+ sites through another application.
Some websites are already updated through respective sites owners, so without affected any existing changes we need to add new macro, content, document type and menu for each site and we don't know in which Umbraco database we need to enter records?
Had already posted the same in umbraco issue tracker #U4-7105
Also in Umbraco forums #71443
Thanks & Regard
Sounds like an interesting case!
If you want to migrate items that are in the database such as document types, templates and macros you would most likely need to get a product like Courier. I can see that due to license costs this could be an issue for you with 500+ sites.
Another option could be to take a look at uSync to see if it does what you need. I don't have much experience with this package but from the looks of it, it seems like it is handling all the database bits - and everything else (files on the file system) would be handled by your application just as it is right now.

Disable output caching on individual web part (MOSS 2007)

We run our external website on Sharepoint 2007, and all the content is pulled from list data and generated using C# web parts.
Here is my problem: I have a web part on the home page that displays a random header banner on every page load. Unfortunately, Sharepoint seems to be caching this header and showing the same image every time, rather than randomizing it. I know this because the web part works properly for logged in users, and we've told SP to disable output caching for logged in users.
I would like to keep output caching enabled for anonymous users, but somehow tell sharepoint not to cache this particular web part. I know there's a way to do this, but it seems like there are so many different ways to approach caching and I don't know which one will work. I should note, I've tried using the PartCacheInvalidate method within the web part code, with no luck. Any ideas?

ASP.NET MVC full offline website

I made an ASP.NET MVC application which allows user to create dynamic websites. I need to add feature which will allow to download from server off-line version of choosen website as static html files with menu, hyperlinks, images, documents etc. It should work similar to applications such as Teleport Pro, but I have to choose from Admin Panel which content should be export.
Client wants to burn static website on CD, save on pendrive.
Do you have any ideas how to begin? Please help.
I currently have implemented that in a current project...
User is able to change anything in the frontend and at the end he can publish and download the offline files... the site subscribe users and show all prizes, winners and more information about that campaign.
All was done in ASP.NET MVC3 under .NET4 and hosted in AppHarbor.
It's composed at several applications but for what you want, you develop the Backend and the Frontend, and to generate the static files, simple use the Frontend to grab the full HTML
As an example, I can show what 2 users did...
Callme.dk did http://callme.julekal.info and
Sony Nordic did http://sony.julekal.info
plus, you can simply point custom domains to it as well like http://sonynordicxmas.net/
To publish and generate all files:
one part of the editing:
So I give the users, offline access (through the .zip file), online access (through the frontend application) and the ability of using custom domains...
I think the only way this might be possible is if you go to every single page and then use your browser to "Save" the web page script and all.
However this causes several issues;
You never quite get everything and you need to massage the HTML produced, dowload all the images etc to get the page to look right
Each html file now has an associated folder with the same name and each time you do this you will get another html file with a folder. You can combine all the folders into a single one but that leads me to item 3.
You will need to edit each html file to clear up any pathing issues if you want to share a single source folder.
Data is no longer dynamic!
You need to, if you want to link all the pages to each other, edit every single html file and resolver the anchor tags.
This is too much work and I think it actually breaks the true requirement.
Don't do it! :)

Is there anyway to load up a asp.net page object and render its contents to string from a console application?

I am trying to use aspx pages as an email templates. There will likely be a bunch of objects on the page which will be used as replacements in the html. Because it's an aspx page I'll be able to use databinding, repeaters, etc. At run time, I want to be able to instantiate the aspx page from its path, pass in a bunch of properties, and then get the rendered result of the page and email it. This seems pretty straightforward from a asp.net website (maybe using BuildManager or Server.Execute.) However, I want to be able to use the same templates via a console application by just loading up a page object from its filepath. Is this possible?
You could host your own webserver. Like the Cassini webserver.
In my own application (a Windows-based Desktop-CMS), I include a web server, too (non-Cassini). It works very well, also it does not serve ASP.NET but plain, HTML.
As I did some research back then, I first wanted to use the Cassini, too, but at some point, I found out that too much user privileges were required to run it successfully; this may not be an issue to you, but keeping this in mind and try to run it early with the permissions of the later user, might be a good idea.

What are some ways to support multiple websites with a single code base?

I'm writing a pretty straight forward ASP.NET MVC web app: only a couple of CRUD pages, some folders where clients can browse documents and just 3 or 4 roles. The website will be used in a B2B scenario, where every client will have their "own" website.
At this point, the only thing that will change in the website, from client to client is the content (ie. the documents, and the rows of data they'll see). If this is the case, what's the best way to manage roles across all of my clients? I'm looking for the simplest possible solution because this is a proof of concept and I don't want to invest a lot of time right now.
What if it's not just the content that changes? Maybe some clients will want a few custom static pages. At this point, is my only option replicating the entire website? I'm leery of this because it'll become hard to maintain if I get a lot of clients.
I'd appreciate any help... I just don't want to shoot myself in the foot; I'm sure someone has done this before.
I create Virtual Directories in IIS for each client, all pointed back to the same folder where my ASP.NET code resides.
This allows me to support several dozen nearly-identical "web sites," each with their own database that is basically identical in form, only differs in data.
So, my site URLs look like:
http://mysite.com/clientacme/
http://mysite.com/clientbill/
http://mysite.com/clientcharlie/
There are two key implementation details I worked out for this:
I use the Virtual Directory folder name to determine which DSN my code reads from. This is accomplished by creating a simple static method that injects the folder name into a DSN string template. If you want to use the same database to store everyone's data, you can use the folder name as a default filter in your queries.
I store the settings for each web site (headers and footers, options, links to custom reports, etc.) in a simple "settings" table in each database (key, value) rather than in the web.config (which is shared). This allows me to extend the code base over time to customize the experience for each client without forking the code.
For user authentication, I use Basic authentication, and I keep usernames, passwords, and roles in a table in each database.
The important thing is that if you use different SQL Server databases for each client's content, you need to script any changes to your database tables, indexes, etc. and apply them across all databases at the same time (after testing of course). One simple way to do this is to maintain an Excel sheet with a table of database names and a big "SQL" cell at the top. Beside each database name, create a formula to "USE databasename;" and then concat the SQL code at the top.
I'm not sure if this answers your question completely, but as far as maintaining custom "static" pages I found myself implementing a system on a client's MVC website where the client can create "Pages" from their admin control panel and each Page has a collection of "PageContent" entities which consist of a Title and and HTML content field (populated using a WYISWYG editor). Upon creating a page the MVC application maps http://yoursite.com/Page/Page-Url-Specified-By-The-User to that page and renders its content there. Obviously, the pages are dynamic, but as far as the client can tell they have created a brand new custom page with little or no effort.

Resources