473,748 Members | 8,773 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Hide ASPX Extension

Does anyone know how to hide the ASPX extension of web pages in ASP.Net 2.0?

Thanks,

Matt
May 19 '06 #1
13 4521
You can't hide it. You can, however, configure the ASP.Net ISAPI to use a
different extension, through IIS.

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Numbskull

The man who questions opinions is wise.
The man who quarrels with facts is a fool.

"Matt" <md*****@sorviv e.DONT-SEND-SPAM.com> wrote in message
news:%2******** ********@TK2MSF TNGP02.phx.gbl. ..
Does anyone know how to hide the ASPX extension of web pages in ASP.Net 2.0?

Thanks,

Matt

May 19 '06 #2
configure iis to have all requests ( * ) handled by asp.net
configure the appropriate static resource handlers in your web.config - ..gif , .js , .css etc
in Application_Beg inRequest use url rewriting to send the remaining requests to the proper handler

ie
requests for http://www.mysite.com sent to default.aspx
requests for http://www.mysite.com/products sent to products.aspx
requests for http://www.mysite.com/support sent to support.aspx
....
Gerry

"Matt" <md*****@sorviv e.DONT-SEND-SPAM.com> wrote in message news:%2******** ********@TK2MSF TNGP02.phx.gbl. ..
Does anyone know how to hide the ASPX extension of web pages in ASP.Net 2.0?

Thanks,

Matt
May 20 '06 #3
Gerry,

Here is the problem I am having. I can hide the and manipulate the extension with a HTTPHandler on the post but once the process makes a roundtrip ASP.NET automatically sets the action="page.as px" in a form and on the response the browser now displays the full filename with extension because it expects to post to itself, which it has to.

Am I missing something here with how Request/Response is working with web forms?

Thanks,

Matt
"gerry" <ge**@nospam.no spam> wrote in message news:Oq******** ******@TK2MSFTN GP04.phx.gbl...
configure iis to have all requests ( * ) handled by asp.net
configure the appropriate static resource handlers in your web.config - .gif , .js , .css etc
in Application_Beg inRequest use url rewriting to send the remaining requests to the proper handler

ie
requests for http://www.mysite.com sent to default.aspx
requests for http://www.mysite.com/products sent to products.aspx
requests for http://www.mysite.com/support sent to support.aspx
...
Gerry

"Matt" <md*****@sorviv e.DONT-SEND-SPAM.com> wrote in message news:%2******** ********@TK2MSF TNGP02.phx.gbl. ..
Does anyone know how to hide the ASPX extension of web pages in ASP.Net 2.0?

Thanks,

Matt
May 20 '06 #4
sorry - i forgot about that ,
one way to handle this is via a response filter ( HttpModule ) something along the lines of this :

- in your page's <head> section add :
<FormAction runat="Server" id="FormAction " href="" />

- somewhere during the page processing set the FormAction href value something like this :
FormAction.Attr ibutes["href"] = Request.HttpMet hod=="POST" ? Request.Headers["Referer"] : Request.RawUrl;

- in your response filter :
use regex to pull out the FormAction href value
use regex to delete the FormAction tag
use regex to replace the <form> action value

To see this in action look at www.hgha.ca - you will see that all pages have the .htm extension but in fact there exists only one single .aspx page that handles all .htm requests. Ya I know - it looks kindof rough in spots but thats because the users 'compose' most of the content online themselves

Gerry

"Matt" <md*****@sorviv e.DONT-SEND-SPAM.com> wrote in message news:ug******** ********@TK2MSF TNGP02.phx.gbl. ..
Gerry,

Here is the problem I am having. I can hide the and manipulate the extension with a HTTPHandler on the post but once the process makes a roundtrip ASP.NET automatically sets the action="page.as px" in a form and on the response the browser now displays the full filename with extension because it expects to post to itself, which it has to.

Am I missing something here with how Request/Response is working with web forms?

Thanks,

Matt
"gerry" <ge**@nospam.no spam> wrote in message news:Oq******** ******@TK2MSFTN GP04.phx.gbl...
configure iis to have all requests ( * ) handled by asp.net
configure the appropriate static resource handlers in your web.config - .gif , .js , .css etc
in Application_Beg inRequest use url rewriting to send the remaining requests to the proper handler

ie
requests for http://www.mysite.com sent to default.aspx
requests for http://www.mysite.com/products sent to products.aspx
requests for http://www.mysite.com/support sent to support.aspx
...
Gerry

"Matt" <md*****@sorviv e.DONT-SEND-SPAM.com> wrote in message news:%2******** ********@TK2MSF TNGP02.phx.gbl. ..
Does anyone know how to hide the ASPX extension of web pages in ASP.Net 2.0?

Thanks,

Matt
May 20 '06 #5
If you do that, I fear your site's throughput will sink.

What you are suggesting would increase the site's processing by at least 2-300%
which would reduce your site's throughput to 33% or 25% of what it should handle.

For what ? For an esthetic "hide my extension" consideration ?

Thanks, but no thanks.

I value ASP.NET for its processing capability, which allows me to have much
more throughput than comparable platforms...wit h a lot less programming effort.

Hobbling my web server to satisfy an esthetic desire is pointless, imho.


Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
=============== =============== =====
"gerry" <ge**@nospam.no spam> wrote in message news:Oq******** ******@TK2MSFTN GP04.phx.gbl...
configure iis to have all requests ( * ) handled by asp.net
configure the appropriate static resource handlers in your web.config - .gif , .js , .css etc
in Application_Beg inRequest use url rewriting to send the remaining requests to the proper handler

ie
requests for http://www.mysite.com sent to default.aspx
requests for http://www.mysite.com/products sent to products.aspx
requests for http://www.mysite.com/support sent to support.aspx
....
Gerry

"Matt" <md*****@sorviv e.DONT-SEND-SPAM.com> wrote in message
news:%2******** ********@TK2MSF TNGP02.phx.gbl. ..
Does anyone know how to hide the ASPX extension of web pages in ASP.Net 2.0?

Thanks,

Matt

May 20 '06 #6
"Juan T. Llibre" <no***********@ nowhere.com> wrote in message
news:er******** ********@TK2MSF TNGP02.phx.gbl. ..
Hobbling my web server to satisfy an esthetic desire is pointless, imho.


I couldn't agree more!
May 20 '06 #7
sure - but that wasn't the question being asked.
"Juan T. Llibre" <no***********@ nowhere.com> wrote in message
news:er******** ********@TK2MSF TNGP02.phx.gbl. ..
If you do that, I fear your site's throughput will sink.

What you are suggesting would increase the site's processing by at least 2-300% which would reduce your site's throughput to 33% or 25% of what it should handle.
For what ? For an esthetic "hide my extension" consideration ?

Thanks, but no thanks.

I value ASP.NET for its processing capability, which allows me to have much more throughput than comparable platforms...wit h a lot less programming effort.
Hobbling my web server to satisfy an esthetic desire is pointless, imho.


Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
=============== =============== =====
"gerry" <ge**@nospam.no spam> wrote in message news:Oq******** ******@TK2MSFTN GP04.phx.gbl... configure iis to have all requests ( * ) handled by asp.net
configure the appropriate static resource handlers in your web.config - ..gif , .js , .css etc in Application_Beg inRequest use url rewriting to send the remaining requests to the proper handler
ie
requests for http://www.mysite.com sent to default.aspx
requests for http://www.mysite.com/products sent to products.aspx
requests for http://www.mysite.com/support sent to support.aspx
...
Gerry

"Matt" <md*****@sorviv e.DONT-SEND-SPAM.com> wrote in message
news:%2******** ********@TK2MSF TNGP02.phx.gbl. ..
Does anyone know how to hide the ASPX extension of web pages in ASP.Net 2.0?
Thanks,

Matt

May 21 '06 #8
Gerry,

inherent to *every* question is the underlying metainfo
as to whether the answer sought is convenient or not.

That saves a lot of barking up the wrong trees,
and warns all readers about the pitfalls in proposed code.

In this case, implementing what you proposed would increase the server workload
by a large factor, reducing the throughput for the server where that "solution" is implemented.

Sorry, nothing personal, but the proposed answer,
though technically correct, is worthless as a solution.

In any case, it's much simpler to hide the aspx extension by using a frameset in which
the first frame has zero for its number of rows and all the content is written in the
second frame, with * specified in the default frameset for the number of its rows.

That will, effectively, hide the extension for the default page but won't overload the server.
All other pages are exposed as links which have the 2nd frame as their target.

This is an old HTML trick to hide page extensions, although it has nothing to do with ASP.NET.


Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
=============== =============== =====
"gerry" <ge**@nospam.no spam> wrote in message news:e4******** ******@TK2MSFTN GP02.phx.gbl...
sure - but that wasn't the question being asked.
"Juan T. Llibre" <no***********@ nowhere.com> wrote in message
news:er******** ********@TK2MSF TNGP02.phx.gbl. ..
If you do that, I fear your site's throughput will sink.

What you are suggesting would increase the site's processing by at least

2-300%
which would reduce your site's throughput to 33% or 25% of what it should

handle.

For what ? For an esthetic "hide my extension" consideration ?

Thanks, but no thanks.

I value ASP.NET for its processing capability, which allows me to have

much
more throughput than comparable platforms...wit h a lot less programming

effort.

Hobbling my web server to satisfy an esthetic desire is pointless, imho.
Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
=============== =============== =====
"gerry" <ge**@nospam.no spam> wrote in message

news:Oq******** ******@TK2MSFTN GP04.phx.gbl...
configure iis to have all requests ( * ) handled by asp.net
configure the appropriate static resource handlers in your web.config -

.gif , .js , .css etc
in Application_Beg inRequest use url rewriting to send the remaining

requests to the proper handler

ie
requests for http://www.mysite.com sent to default.aspx
requests for http://www.mysite.com/products sent to products.aspx
requests for http://www.mysite.com/support sent to support.aspx
...
Gerry "Matt" <md*****@sorviv e.DONT-SEND-SPAM.com> wrote in message
news:%2******** ********@TK2MSF TNGP02.phx.gbl. ..
Does anyone know how to hide the ASPX extension of web pages in ASP.Net

2.0?

Thanks,

Matt

May 21 '06 #9
How about this, if I can't do this then I loose a 500K contract, is that underlying issue good enough to require the hiding of an extension!
"gerry" <ge**@nospam.no spam> wrote in message news:Oq******** ******@TK2MSFTN GP04.phx.gbl...
configure iis to have all requests ( * ) handled by asp.net
configure the appropriate static resource handlers in your web.config - .gif , .js , .css etc
in Application_Beg inRequest use url rewriting to send the remaining requests to the proper handler

ie
requests for http://www.mysite.com sent to default.aspx
requests for http://www.mysite.com/products sent to products.aspx
requests for http://www.mysite.com/support sent to support.aspx
...
Gerry

"Matt" <md*****@sorviv e.DONT-SEND-SPAM.com> wrote in message news:%2******** ********@TK2MSF TNGP02.phx.gbl. ..
Does anyone know how to hide the ASPX extension of web pages in ASP.Net 2.0?

Thanks,

Matt
May 21 '06 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
1471
by: Shaul Feldman | last post by:
Hello, the question is how can I masquerade ASPX files behind HTML extension? Thank you in advance. -- With the best wishes, Shaul Feldman
3
2906
by: Christopher Baldwin | last post by:
Hello, Using ASP.NET v2.0.40607.42, I'm attempting to create a new file extension that should be handled exactly like "aspx" pages. For example, I just want to rename an aspx page from "test.aspx" to "test.extx", where .extx extensions are handled in exactly the same way as aspx pages. In pre-2.0 versions of ASP.NET, simply adding a HttpHandler element (below) to web.config, and adding a IIS mapping of "extx" to
9
1716
by: Rena | last post by:
Hi all, I would like to know if there are any way to hide the xxxx.aspx on my URL on server-side to avoid anonymous knowing i am using ASP. Net ? Thanks a lot.
2
3499
by: hn | last post by:
Hi, Is it possible to hide the aspx extension in the URL displayed on the address bar?
5
422
by: Matt | last post by:
I currently have a client that is okay with us using Microsoft development products but do not want their customers to see the aspx extension on any of the web pages. I played around with creating an HTTPHandler that masks the fact that the URL's are not aspx pages. I wonder if anyone else has come across this and would like express a better solution or one that is available to make sure I cover all the bases with doing this. Thanks, ...
24
2754
by: John Rivers | last post by:
ASPX which means ASPX pages, the code-behind concept, User Controls, Web Controls etc. is very poorly designed and makes it extremely hard to develop professional quality web applications. ASPX is Microsoft's attempt to "dumb down" web application development to help unskilled developers such as web design agencies achieve some results. For high quality applications IHttpHandlers are the way to go.
0
8831
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9249
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6796
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6076
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4607
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4876
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3315
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2787
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2215
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.