I am working on asp.net. There is a page tested on my localhost. This project is transferred to me by previous developer. The page is "localhost:4472/TblQualClients/List.aspx" and it is working fine, but I could not find this aspx file in any of my folders; and in another aspx document, I found there is a pointing to this page, but it is shown as "File 'TblQualClients/List.aspx' was not found".
Can anyone help with this? Thank you very much.
Your project uses Dynamic Data.
ASP.NET Dynamic Data lets you create extensible data-driven Web applications by inferring at run time the appearance and behavior of data entities from the database schema and deriving UI behavior from it.
Dynamic Data supports scaffolding, which is a way to automatically generate Web pages for each table in the database. Scaffolding lets you create a functional Web site for viewing and editing data based on the schema of the data. You can easily customize scaffolding elements or create new ones to override the default behavior.
You can also enable dynamic behavior in existing or new Web applications without using scaffolding. In that case, you specify how and when Dynamic Data should infer UI elements from the data source without using scaffolding for the entire Web site.
Taken from the MSD website:
http://msdn.microsoft.com/en-us/library/ee845452.aspx
Also, refer to this article to understand how it works:
http://blogs.msdn.com/b/scothu/archive/2008/06/23/how-to-add-dynamic-data-to-an-existing-web-site.aspx
Related
I'm creating a new website application in asp.net. The landing page needs to have a button (or something similar) which the user can click to create a new instance of a webpage. Similar to how a Facebook user can create a new group/event or a StackOverflow user create a new question.
My website needs to be able to create multiple "events" from the landing page which can then be accessed from the landing page, each event should be a template populated with user details on creation.
Can someone please tell me how people refer to this technique of creating many instances of a webpage (event) from one template?
With ASP.NET Core MVC (using this as an example as you have an ASP.NET tag and your description doesn't specify a technology), you can create a template using a .cshtml file. If you are not familiar with these types of files (which are used within the ASP.NET framework), then I suggest a read of it here:
https://www.w3schools.com/asp/razor_syntax.asp
Roughly, it's a file with HTML content where you can easily embed .NET types (such as types from your Model) and .NET logic using "Razor syntax", so that your HTML file is modified appropriately (e.g. with queried data specific to your user) before being sent back to the client. The reference above gives good examples, so I'm not going to waste space and repeat them here.
You can have certain .cshtml files as your "template" and embed appropriate model data using Razor syntax. You can then have a hyperlink tag (for example) reference the .cshtml file using the asp-action attribute. This will render the .cshtml file to the client whenever that tag is clicked on. ASP.NET uses types called Controllers to handle such requests (Controllers are types that inherit from the Controller type) appropriately, such as querying the correct database and providing your .cshtml file with the correct data before sending the result back to the client.
ASP.NET Core MVC modularizes the types of actions described above very well (M --> Model, V --> View, C --> Controller). Here is a good reference:
https://learn.microsoft.com/en-us/aspnet/core/mvc/overview?view=aspnetcore-2.2
For other technologies that you wish to use to achieve the same result, you will have to consult the appropriate references.
Stackoverflow is a place to get answer on specific problem with short answer. Your problem is general design and programming question, and requires understanding of basic programming aproaches.
For that you should grab a book and read about designing webapplications in .Net.
Here is the task I'm checking:
1) have a product database, which is managed by another application (it has no relation with sharepoint).
2) now, my boss want to have an application within the sharepoint portal to search this database, plus, audit the searches, i.e. who searched what at what time....
There is no problem if this is a regular asp.net application. But, what's the best way to do this in sharepoint?
My plan is to:
use team site template (or blank template), create a webpart. then have UI, and gridview to show the result.
is this the way to do? I try to find an example of using gridview in webpart, but cannot find it. Is there any limitation of using asp.net control in webpart? what about use ajax toolbox control in webpart? any example?
thanks
Roughly there are 2 approaches you could go for:
The webpart approach, just as your describe it. You can use an ASP.NET gridview with no problems in your webpart. As such, a webpart is nothing more (simplified...) than a user control with some dress up.
Go for BDC/BCS. This will allow you to consume the external database and show the information as be it 'native' SharePoint data. This has the added benefit that the content can be made searchable from within SharePoint. Using this approach you also do not have to create a UI to present the data, as SharePoint will present it using the out of the box view pages, etc.
The downside of the webpart approach (option 1) is that if you have multiple front end servers in your farm you need to handle the session in a way (e.g. by setting up sticky sessions on your loadbalancer, or by sharing your session somewhere centrally (in a db for instance)), as you don't want users to switch between servers in one session while they are using your webpart probably.
The downside of option 2 is that at first it might seem complex, but let that not scare you away :-)
http://msdn.microsoft.com/en-us/magazine/ee819133.aspx
You should code this as one or several web parts. You can use pretty much any asp.net controls in web parts. If you want to use any third party tools like DevExpress you must ensure that the binaries are strongly typed so that you will be able to register them in web.config, note that the registration can be done by the wsp deployment if correctly configured.
Web parts behave as any .net code except for the fact as I mentioned all references assemblies must be "safe".
I have a unique requirement which I need to meet to with sitecore, and I was wondering if it is feasible. The client has an existing .net solution, which is a web project (web site, not web application) that is built on the spring framework and commerce server. They now want to use sitecore to enable content editing on 'some' of their pages. THe requirement is that they do not want to maintain the master pages and any common items in sitecore, but they want sitecore to be able to use the master pages and all the controls they have in their custom solution. I've checked through their project, and they have a LOT of dependencies on many other references and projects, and so it is not a fairly simple application. They do not want to have the master pages specifically in sitecore, and they only want sitecore for the main content editing. They basically want all the layouts in sitecore to use their master pages. I've tried using virtual directories and then using the master pages in sitecore, but there are way too many dependencies in their project. I've tried to make sitecore an application within its own directory, but it doesn't seem to work very well. I can merge the web.configs as much as I can, but that is going to cause headaches down the road when its time to upgrade...My more high level question is, is this doable at all, and if there is a way I can meet this requirement.
Initial thoughts are that using master pages within Sitecore is bit of a non-starter. It seems odd to have such requirements and have Sitecore already prescribed.
Three ideas come to mind.
1) Consider keeping the solutions separate, and host certain Sitecore pages in a clean, standard, Sitecore solution. Use a load balancer to direct which urls point where. There could be many side effects to this approach to do with sessions etc.
2) Migrate the existing solution to Sitecore replacing master pages with Sitecore layouts and sublayouts. At the same time, migrate to a web application project. This is very likely the best long term approach. The main challenge would be mapping existing content to a set of templates in Sitecore, and various bits of refactoring.
3) Use Sitecore as a content repository, but serve content from your existing web site solution. This will have numerous complicating factors due to lack of a typical Sitecore item, site & domain context which would all need to be handled by custom code. The solutions could be entirely separate, and even use web services to retrieve content from Sitecore which is served by the existing solution. It gives full separation, but you loose a large chunk of Sitecore functionality and end up with an expensive rich text editor + database.
I'd opt for #2 where possible.
I think I can see a few options on how to do this. I'm currently doing something similar right now on a large enterprise project where there's an existing ASP.NET MVC application running the bulk of the site. Here are some options I can think of:
Use a sub-domain for the Sitecore-only stuff and <iframe> in the Sitecore content or do an HTTP GET to the Sitecore pages and pull the content into the existing app. E.g. sc.mysite.com is the Sitecore app. I'm currently doing this with MVC now and its fine. From a content management POV, editors can still use Page Edit mode on the Sitecore pages in their stand-alone state but the content is in production in the fed in state on the main MVC site.
Sitecore can use MasterPages, it just defeats the purpose of the presentation layer of Sitecore. Essentially, you can have your Sitecore layout inherit from the MasterPage and it works just like any normal application would with inheritance. I'm not sure of the caching implications though. As long as your app references the Sitecore assemblies, you can use the API as long as its part of the Sitecore context. If you DO use MasterPages with Sitecore, make sure you add a placeholder with the key webedit to allow page editor to work: <sc:placeholder key="webedit" runat="server" />
I'm trying to switch my custom cms written in php into .net c#. I was thinking to use cms as a learning project. I'm going to use C#, NHibernate ORM layer, mssql, mvc3 and jquery.
I'm aware there are plenty of commercials or open source cms, but still I'm going to spend some of my free time trying to learn new technology working on project like this.
So, is there anyone out there who is willing to share some ideas on creating cms domain model, usefull link, ideas, etc.
Thanks
A really basic CMS consist of 3 elements:
one database table to hold your "pages". The table structure is "name" and "content"
a route to transform requests of type /cms/pagename to a fixed controller, the method called cms and pagename as a parameter
a embeddable html editor
Now, there are two ways your "page" can be invoked. It is either create mode or view/edit mode.
In "create" mode, the page is requested but it is not in the database yet (e.g. cms/announcement1). In this mode you create a view consisting of a html editor and upon submit, you persist the page to the database.
In "view" mode, the page is requested and is IS in the database. You perform any necessary rewriting (for example you rewrite internal links of the form [cms/pagename] to a fully routable http address) and render the content.
If the user is authorized to edit the page, you also show a "edit" button which then invokes the html editor with the page loaded and ready to be edited.
And that's it.
There are tons of additional elements (caching, different built-in page types, embedding images, youtubes, preformatted texts) etc. but all of them are optional and you can introduce new features when you have the core already implemented.
Once I wrote a simple CMS following the structure above, it was a part of a bigger solution and till now it's been sucesfully deployed several hundred times. An advantage of a custom CMS is that it can be really simple and easily maintanable.
As part of the development for a website powered by Sitecore 6.3.1, I will need to implement a way to manage data from a couple of external sources in Sitecore.
To accomplish this, the simplest solution appears to be to import the external data into Sitecore as content items with a special workflow that will export them back to the external data source when they reach the final state.
I came across this article which details the code required to import data into Sitecore, but I am uncertain as to the best way to make this functionality accessible.
Considering that this process will probably (but not certainly) only be done once after the site is completed, what approach (page/Sitecore item/shell application/?) could I take to provide a way for a developer user to perform the import?
Interestingly, the Sitecore classes are available even in web forms outside of Sitecore. I created a separate .aspx file and used Sitecore.Data.Database.GetDatabase("master") to interact with Sitecore's database.