Sharepoint site as a subsite under a asp.net site - asp.net

I have asp.net hosted at my domain which i access using a url like 'http://www.xyz.com. I have other web applications which are under the root web application in virtual directories which can be accessed using a url like 'http://www.xyz.com/subsite1 etc.
Now i want to have a sharepoint site as a subsite under my root website which i can access using a url like 'http://www.xyz.com/sharepointsite1.
I have installed sharepoint 2010 server.This installed a new website Sharepoint-80 and The central administration site. I have changed the Sharepoint-80 website setting to point to wwwwroot where my asp.net wesite and its subsite files are located. Now if i make a new site collection in my sharepoint site and it gets successfuly created. But when i browse it i get following error.
HTTP Error 500.19 - Internal Server Error The requested page cannot be accessed because the related configuration data for the page is invalid.
My webserver is also a domain controller. How do i resolve this issue? And how do i achieve the main aim of having a sharepoint site as a subsite under my main website?
Thanx

I don't think that is possible, unless you are using different host headers or you can write an HttpModule which would be complex in my opinion. Although reverse is possible, You can have a sharepoint site at / and then an ASP.NET site at /subsite
The reason is an IIS SharePoint website is different from IIS ASP.NET website. IIS SharePoint Website registers an extra SPRequest module which fetches the data from SharePoint content database. When you request / , it will always try to pull this data from the SharePoint Content database.
In your case, where you have changed the SharePoint-80 website to point to wwwroot, you have essentially removed SPRequest module from the pipeline. That's the reason you get the error, because its not able to pull the content from the database.

You should do the other way around. Change main site to Sharepoint site, and let your other asp.net application/site to be subsite of sharepoint.

You cannot do that. Simply because you're trying to encapsulate a cloud-based system into an internal IIS folder structure.
You can not add Sharepoint online page in an iframe because of the same origin policy that most of the sites on internet adopted this days. This is mainly for security reasons to avoid from web attacks like Clickjacking and XSS.
You can not add Sharepoint online page in an iframe because of the same origin policy that most of the sites on internet adopted this days. This is mainly for security reasons to avoid from web attacks like Clickjacking and XSS.
If you want to display the content of the sharepoint online into different domain, than try to use provider hosted app in windows azure or develop a Napa sharepoint hosted app which can make cross domain requests in REST or ajax

Related

How to get SharePoint Site authentication information to use it in an ASP.NET website which is integrated inside that SharePoint Site?

I have integrated my ASP.NET website into a SharePoint Site by using an IFrame in the SharePoint Page via a Content Editor Web Part. The ASP.NET web application doesn't have any authentication & authorization implemented in it.But the SharePoint site is having some authentication implemented. Now my requirement is how to get and use that SharePoint authentication information in my ASP.NET web application programmatically to do some code manipulations based on the authenticated user level.Any help would be appreciated.Thanks in Advance
The 'Right' way of doing it would be to redevelop your site as a collection of Application pages. This allows you to limit permissions to Site Collection Administrators, or just about any level of SharePoint Authentication.
http://msdn.microsoft.com/en-us/library/Ee231581(v=vs.100).aspx
This allows you to use the SharePoint object model directly in your 'web' application.
It's a bit complicated to shift from a traditional web application to getting all the pieces running under the Sharepoint _layouts folder, but its worth the time spent and pretty easy to update.
It should be noted that your existing IIS website would be removed and the pages re-homed to that layout folder, via a SharePoint Feature containing your application pages.

Difference between creating my asp.net MVC web application ,under the IIS Default web site, or create it as a new web site

I have published my asp.net MVC web application under the “Default web site” inside IIS. I actually added two versions of my web application:-
one directly under the default website and it can be accessed by typing http://servername
one under presaging path , and can be accessed by typing http://servername/prestaging
so I got confused on which approach it is recommend to add my asp.net web application, and what is the difference between adding my web application under the default web site, or creating a whole new web site ?
Thanks
This has more to do with organization within your company's IIS structure than right and wrong. If the site you built truly is the only site on the server, putting it on the Default site is not looked down upon.
But if the application is a sub application of the default site, the latter approach is the more appropriate approach if you only get to access the site from the //servername URL.
If you have a separate domain, myapp.servername.com, you can install it into the default iis site and add a binding or you could create a whole separate web site.
Has more to do with your structure than right or wrong.
Edit
To answer your comment, creating the site under the default web site will make the URL in most cases be: 'http://myservername/MyApp'. Creating your own application would require (in most cases) a separate binding address, 'http://myapp.myservername.com' It is really only affecting the URL you place in your browser and nothing else. More complicated setups are possible, but for most cases, these are your two options.

asp.net website subdomain on fly with IIS url-rewrite-module

I need to implement the sub domains in asp.net web forms (not MVC) for all clients on fly.
Here is the whole scenario I have a General website for every one as http://mydomain.com
and once a client is registered to my website, he will be allocated a subdomain as
client1.mydomain.com
client2.mydomain.com
client3.mydomain.com
and all clients will be served from
http://mydomain.com/clientwebsite/
with their customized contents from DB server On the Client website.
I looked about it and came to know that it can be done by IIS URL re Write but we will have multiple links and options on client sites which postbacks with querystring and data. I dont know how to send that and rewrite on backend. it can be
client1.mydomain.com/mystoreitems
or
client1.mydomain.com/section=mystoreitems
Kindly guide me how to do this.

how to serve all static images on my asp.net website separately

My website (developed in ASP.NET) and has 75 GB of images and those are served along with web application. Meaning there are on the same server.
Now I want to move all the images to an external server and using another domain. This new domain is specifically just to server images.
If I move all my images to another domain, I will lose SEO (Google indexed) results.
Considering this situation, please help me out with the following.
Which web server is better to serve images very fast? Which Operating system and web server combination is better to serve this purpose?
If images are moved to another domain, what is the alternative way that I can still have the same URLs for the existing images? Is there any facility to give alias name that will point out to the new domain?
Since the advent of ASP net MVC MS have Routes helpers
Since MVC it's build on top of ASP.net you can use id to redirect to the url of the images to the another domain
http://msdn.microsoft.com/en-us/library/cc668201.aspx
Using ASP.NET routing to serve static files

How to manage IIS from web page

I have the need to add Host Headers to an existing web site in IIS. I want to be able to add this host header via a Web page, ASPX page. Also, I want to able to create a new web site from file.
Sample code?
How to do I manage security issues, what issues should I be concerned about?
How many host headers can a single web site have?
I am using the ASP.Net membership provider on the site.
Server is running IIS7 and Windows 2008 Server.
WMI is the best way to create website from your pages, I have used it and had referred http://blogs.msdn.com/ramesh_r/archive/2004/03/24/95109.aspx link.
This is really a cool link to understand/ learn WMI programming.
You can download WMI code generator from http://www.microsoft.com/downloads/details.aspx?FamilyID=2cc30a64-ea15-4661-8da4-55bbc145c30e&displaylang=en
IIS 7 Has a managed code API which should allow you to do what you need.
Take a look at the API documentation from Microsoft, here: http://msdn.microsoft.com/en-gb/library/aa347649.aspx
This blog may be useful, too.

Resources