Background: I'm trying to make an extremely light news sort of...thing that relies entirely on hard code ASPX documents (not my decision). What I would like to do is create a bit of dynamic updating by having the main news page pull the latest ASPX file from a folder and get its "TopContent" section on the main page. How would I best be able to do that? I'm stuck with ASP.NET 2.0 on this project as well.
So I didn't quite transclude ASPX documents, but I found a way to get this to work by having XML files with the data pieces I needed and just using that. No problem.
In detailed: An XML file containing the title, the top content and the main content and then using a URL argument to figure out which file to open.
Related
I got an ASPX file on my Sharepoint. It's supposed to display some simple tables after clicking on it, but instead of it, it's being downloaded to my PC.
There is another file like that in my other folder and it works perfectly fine.
Could anyone give me some advice, how could I fix this problem, please?
Best regards
If the Aspx file is located in Site Pages or Pages library, it should display data directly rather than download if clicking it.
For this issue I suggest you can create a new site page and insert your custom JavaScript logic into the new created page, it should be able to display directly.
I have some pre-compiled html content which I want to include in my View like:
#*View Start*#
Some precompiled html
Some view content
Some precompiled html
Some view content
Some precompiled html
#*View End*#
I have already thought of some ways but each of them has some GREAT downsides that I don't want to use it. these are the ways I have thought of:
Although these html codes are pre-compiled with fixed content they may change time to time (let say weekly) so can not be included in view itself
They're rather big in size so I don't think having them in database would be wise (would increase database size and data-bandwith)
Having them in html files and writing them into view using C# functions something like #File.ReadAllText("page-customized-head.html") and this would be slow and would make hard disk busier than it should.
I want to know if anybody can suggest a better solution or a way to improve the above solutions.
Edit:
I had put aside solutions like ajax, as in this situation was not suitable for my design. After #Hadee's comment I noticed that my description is not complete, so I'm adding some more description.
These content files can be unique for different pages of different users as user can customize css, js. add - edit remove html elements. So each user may have several pages that each page may have several different "Pre-Compiled" section.
As these content may be the head section of the page, may contain css, js (that following content may rely on it), ... ajax is not suitable in here.
And as for partial views, I don't see any different between them and having the content written into html file. Actually I think html file and #File.ReadAllText("page-customized-head.html") would be faster, as unlike .cshtml it does not need compiling.
There are plenty of Wordpress template out there, most of them are well designed.
I like to know, is there a way to easy to use Wordpress template in c# project.
Is there any out-of-the-box solution?
Just grab a copy of the output HTML and the CSS of the WP site and apply/build your ASP.NET site around it. This is straightforward in itself. Where most people get confused is when there's a master page in the mix in ASPNET; however, this is not a problem. Just start (with the HTML produced by the WP site) by creating the main divs working from the outside-in, using the master page and then content areas in your pages. Master page(s) will generally contain display elements common to all or a subset of pages.
No, there is nothing "out-of-the-box".
You will need to write your own converter if you wish to do this, though translating a single page shouldn't be too difficult.
how we can create the dynamic page ex. help.aspx and write the code in sitefinity. Because i facing a problem I create a page but i unable to know in which directory the page is lived. If any one help me Suggest.
http://abc.com/sitefinity/admin/pages.aspx
I'm not exactly sure I understand your question correctly. When you create a page in Sitefinity, it doesn't create an ASPX file. The data for the page is kept in the database and served from there. There are no physical files involved.
If you want to write some code that executes when a page loads, you have two options:
Put the code into a control and drop the control on a page created from within Sitefinity
Create a regular ASPX page from Visual Studio and include it as an external page in Sitefinity.
I would recommend the first option, as this would provide you with all the Sitefinity goodness that all pages use - templates, editing through the browser, etc.
If you wanted something else and I misunderstood, please be more specific.
Slavo, The Sitefinity Team
Ok, so here is my situation. I am creating a web application using ASP.NET MVC 2 using the C# language. I have programmed in HTML, CSS, and PHP for several years and I am very new to ASP.NET. The part that I am having trouble with is the image gallery.
The setup: I have a link on the navigation bar that goes to a "Galleries" page. This page will show a list of galleries. Each gallery has a title, an image, and a description. All of this information is pulled from an XML file. I'm using the XML file like a database. I wanted to use this method so that i could easily update the list of galleries and have the updated XML file automatically be reflected by the website. Now, the galleries should link to an "Images" page. This page will display a list of images within the gallery based on what gallery was selected. This page will also pull from an XML file.
The problem: I cannot seem to attach a dynamic link to the image? I am also stuck and not sure how to get the correct View to display. I know I need to do something with the controllers and models, right? I have some code if needed? I would greatly appreciate any help or direction for this! Thanks!
For the image, as long as you have the collection of images in the Model for the page, you can loop through each element and do something like:
<a href="<%= Html.Encode(image.Url) %>" />
When it comes to the Views, there's some auto-magic that happens behind the scenes to map you Controller to the View.
Scott Guthrie has a good post on the inner workings of the ASP.NET MVC Framework and the different methods that it uses to go from your Controller to your Views:
ASP.NET MVC Framework (Part 1) - ScottGu's Blog
I would much rather create an Html Helper for that. That way you can write something more along the lines of this:
<%= Html.ImageLink("<url to image">) %>
Feels like a cleaner solution to me then having to write out an anchor tag. Either way will work, though.
For more info on writing custom Html Helpers:
http://www.asp.net/Learn/MVC/tutorial-09-cs.aspx