Click here to Skip to main content
15,179,246 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
How to create sub domain using and c#, when user create his data or create his information page , they will get a subdomian like and on this link they can access their page or their information on a page.
I don't have any idea to create a sub domain with username using c# and asp.
hop u'll help me....

Subdomain control is not the part of your application and is out of control of ASP.NET (unless you have access to some DNS control application exposed to you as ASP.NET, but it's hardly your ASP.NET application :-)). This is a matter of hosting and DNS data. You need to address to your hosting provider.

For some background:,

Aarti Yadav 26-Mar-15 12:07pm
u mean to say its not possible to create sub domain in
Sergey Alexandrovich Kryukov 26-Mar-15 12:19pm
Of course, it's not possible; I explained.
(Well, unless you it uses some hypothetical domain administration application, but the you would not ask this question.)

If you read on DNS background, you would understand it yourself. The sub-domain either exist or not, it is prescribed in the DNS data. If it is done, you just have you Web pages in this domain; if not, it simply does not exist, and no HTTP request could possibly point to your page, because all textual URLs became IP addresses only through DNS system. In ASP.NET you can only handle HTTP requests which are already sent to your server. Again, please read the referenced articles to understand how DNS works. If it is not clear, perhaps you need to learn how Web works in general.

Will you accept my answer formally?

Aarti Yadav 26-Mar-15 12:34pm
okey but atlist can i do something with url means can i create a particular url like, and this url redirect to another url
Sergey Alexandrovich Kryukov 26-Mar-15 12:37pm
Forget it. No "ABC."...
Please see Solution 2.
As I can guess, you wanted to create a new sub-domain each time the new user is registered. This is what Web service providers sometimes do, to serve up the users no having and not purchasing their own domains. But you don't have control over the domain system and server DNS.

Here is the alternative approach:

You need to use some alternative naming of the URLs, not based on subdomains. Consider using, for example, URL rewrite:[^],[^],
An Example of URL Rewriting With ASP.NET[^].

Aarti Yadav 26-Mar-15 13:01pm
yes i look at that.. :(

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900