How to create profile links - c#

I've been looking on how to create profile links like in Facebook "www.facebook.com/profile_name"?
Anyone knows how what is the term for that or links for that tutorial in ASP .Net C#?
EDIT:
What I'm trying to achieve here is to create a link for each member that could redirect to their profile page.
Here is an example of the link: www.mywebsite.com/Member_Name
I'm using ASP .Net Framework 3.5
Thanks

I think you're looking for mod_rewrite.
Search the web for apache mod_rewrite or friendly URLS to get up to speed on this topic.
http://en.wikipedia.org/wiki/Rewrite_engine

So it seems you are talking about Url rewriting or routing.
I would suggest using Asp.net Url routing, which is supported Asp.net 3.5 SP1 onward.It's what asp.net mvc uses.
Rewriting:
See this SO answer and this article on the difference between routing and rewriting. (This is to do with IIS/aspnet)
Url Rewrite is at the IIS level, for newer versions of IIS there is a URl rewrite module. See this. For older versions of IIS there is this open source module.
Routing:
Asp.net 3.5 SP1 onward supports routing, which is at the application code level. It can do what you want, something like www.mysite.com/username instead of www.mysite.com/User.aspx?id=1234. See this article and this MSDN article for more info on this.

Related

Using OAuth with OData

Looking for any recent examples using OAuth with OData pref. from a WPF client without AppFabric or other dependencies
found this year+ old article
http://blogs.msdn.com/b/astoriateam/archive/2011/01/20/oauth-2-0-and-odata-protecting-an-odata-service-using-oauth-2-0.aspx
which requires AppFabric
another from DevEx also a year+ old but the sample doesn't compile
http://community.devexpress.com/blogs/theonewith/archive/2011/02/24/odata-and-oauth-part-1-introduction.aspx
all the other search results refer to these 2 sites
wondering if there's been any new developments over the past year to build upon
ASP.NET 4.5 WebAPI will support both oData as well as oAuth out of the box. If you are starting a new project I would recommend looking into that one.
Scott Gu's last info is that the ASP.NET WebAPI beta oData is already supported and oAuth will be shipped with the RTM.
Based on past experiences with ASP.NET versions, the availability of the RTM is not for too long.
You can read about the ASP.NET WebAPI (also see comments):
http://weblogs.asp.net/scottgu/archive/2012/02/23/asp-net-web-api-part-1.aspx

URL rewriting in .NET 4?

I heard that in Visual Studio 2010 give built-in functionality for URL rewriting using its URL Routing engine.
I did URL rewriting in earlier version of visual studio by using plug in like intelligencia urlrewrite.
Can any one explain me or guide me to understand that?
Want to implement dynamic and custom url rewriting in my website.
Are you refering to .net 4.0 URL Routing ?
URL routing was a capability we first
introduced with ASP.NET 3.5 SP1, and
which is already used within ASP.NET
MVC applications to expose clean,
SEO-friendly “web 2.0” URLs. URL
routing lets you configure an
application to accept request URLs
that do not map to physical files.
Instead, you can use routing to define
URLs that are semantically meaningful
to users and that can help with
search-engine optimization (SEO).

How to deployed Mvc Application on shared-hosting Server?

I My Web site on a HELM Control Panel. I developed my web site on MVC.But My Hosting Provider having a Following components installed on That Hosting Account framework 3.5 and IIS6. But I am Unable to Run My site it display me Page not found error.
The problem will be that you're running under IIS6 and if its on shared hosting you're unlikely to have sufficient control to make MVC run without "cheating" a bit.
Under IIS6 requests are only routed to the ASP.NET handlers (I don't promise to get the terminology right) if they have the right extension (.aspx, .asmx, .ashx, etc) with a nice MVC URL there's no extension at all so it doesn't get see by ASP.NET and hence the request won't hit the routing within your MVC app and so you get page not found.
Under IIS7 everything (ish) goes through the ASP.NET handler and so it just works.
So a couple of links to help, here's a stackoverflow question:
ASP.NET MVC on IIS6
and here's Phil Haack on the subject:
http://haacked.com/archive/2008/11/26/asp.net-mvc-on-iis-6-walkthrough.aspx
Hope this helps.
http://haacked.com/archive/2008/11/26/asp.net-mvc-on-iis-6-walkthrough.aspx

How do you handle RESTful-type URLs with an IHttpHandler

This question has two related parts.
First, I'm looking for a a small example of how to handle a series of RESTful URLs, such as /Account/{userName} and /Account/{userName}/Profile with a single HttpHandler.
At this time, I'm not interested in embracing MVC or using the REST Starter Kit.
Should I place the HttpHandler class in a Class Library? Should I publish to the root of the RESTful URL?
My second issue stems from the fact that my ASP.NET hosting is done through a web-hosting company. Will I need to ask their tech team to configure IIS for me? Is that normal practice?
This is already built into ASP.NET 3.5 SP1 with the UrlRoutingModule. For details check out this article. If a hosting company supports ASP.NET 3.5 SP1, it will support this.

Using SEO friendly URLs in ASP.NET

I am in a situation where I want to restructure my site's urls. That is I have a page that lists the article names (with each article name as a link). As shown below:
ARTICLE1
ARTICLE2
ARTICLE3
Now if I click on an article I want the url to be as follows:
www.domain.com/ArticleID/name-of-the-Article
The term your looking for is "url rewriting" or "routing".
I think the easy way will be to use the ASP.NET MVC routing, it works with Webforms too:
Using Routing With WebForms
Routing with ASP.NET Web Forms
I think you're looking for URL Rewriting, I'd also recomend UrlRewritingNet.
Other possibilities that have worked well:
If your site is hosted on Windows Server 2008, you can use the Microsoft URL Rewrite Module for IIS 7.0.
A nice tool for older servers is Isapi Rewrite (look here - there's a free light version), very similar to Apache style mod_rewrite. May be a problem in shared hosting environments unless the provider is willing to install an Isapi dll.

Categories

Resources