URL without suffix in .Net

B

Bharat Sharma

Just curious to know,

If there is a direcory named Product in the "/" folder then wht will
happen? How would IIS react to this?

Victor said:
Is it implementable in .Net framework?
http://www.test.com/Product?id=7788

If so, How can I do that.

I know it can be done in J2EE environment.

Thanks!

--

Best,
_____________
Bharat Sharma

* TEN Technologies.
* Official Web: _www.ten-technologies.com_
<http://www.ten-technologies.com/>
Personal Web: _www.bharatsharma.net_ <http://www.bharatsharma.net/>
 
V

Victor Yuan

Clarification:
We don't have a Product directory there.

Why we need such kind of URL?
We want to write a protocal via http, it should be platform
independent because we need to implement it in different platforms.

i.e. we can't design a protocal like this:
http://www.test.com/Product.aspx?id=7788
because it will be a weird implementation in J2EE platform.

Thanks.
Victor Yuen

"Bharat Sharma" <[email protected]> ????
Just curious to know,

If there is a direcory named Product in the "/" folder then wht will happen?
How would IIS react to this?

Victor Yuan wrote:
Is it implementable in .Net framework?
http://www.test.com/Product?id=7788

If so, How can I do that.

I know it can be done in J2EE environment.

Thanks!





--

Best,
_____________
Bharat Sharma

TEN Technologies.
Official Web: www.ten-technologies.com
Personal Web: www.bharatsharma.net
 
B

Bharat Sharma

In that case you can take help of HTTP Handlers. They and some
coniguration setting in IIS can be of rescue for you.

this is my idea and have not worked into this i mean HTTP Handlers are
used to handle custom Extensions like "*.aaa"

But an extension less URI... I am not sure of how IIS is going to
respond to that because i "guess" any extensionless URI will result in
the interpretation as the directory's default File (it can be
configured in IIS). But lets say if some how via Custom HTTP Handler we
are able to implement it... then what will happen if there is a product
directory as well there. who will get the call?

I guess i need to put some more time on this... :) Meanwhile if you find
any solution, please let me know.

Victor said:
Clarification:
We don't have a Product directory there.

Why we need such kind of URL?
We want to write a protocal via http, it should be platform
independent because we need to implement it in different platforms.

i.e. we can't design a protocal like this:
http://www.test.com/Product.aspx?id=7788
because it will be a weird implementation in J2EE platform.

Thanks.
Victor Yuen

"Bharat Sharma" <[email protected]> ????
Just curious to know,

If there is a direcory named Product in the "/" folder then wht will happen?
How would IIS react to this?

Victor Yuan wrote:
Is it implementable in .Net framework?
http://www.test.com/Product?id=7788

If so, How can I do that.

I know it can be done in J2EE environment.

Thanks!

--

Best,
_____________
Bharat Sharma

* TEN Technologies.
* Official Web: _www.ten-technologies.com_
<http://www.ten-technologies.com/>
Personal Web: _www.bharatsharma.net_ <http://www.bharatsharma.net/>
 
S

Sylvain Lafontaine

The previous message is the solution to your problem and the « Product »
name for the repertory is just an exemple.

This notation will open the default file for the repertory /Product/
(something like www.test.com/Product/default.asp as an exemple) while
passing along the provided query string to this file.

S. L.
 
D

Dino Chiesa [Microsoft]

For more info on this topic, see

The IHttpHandler interface
http://msdn.microsoft.com/library/en-us/cpref/html/frlrfSystemWebIHttpHandlerClassTopic.asp

URL Mapping in ASP.NET without extensions:
http://scottonwriting.net/sowblog/posts/943.aspx


--
To configure an HTTP Handler, you would specify something like this in the
web.config:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.web>
<httpHandlers>
<add verb="*" path="albums/*" validate="false"
type="nGallery.Lib.AlbumRequestHandler, nGalleryLib" />
</httpHandlers>

within the type="...", you specify the fully-qualified type name that
defines the IHttpHandler, and that type should be on the app's load path,
typically in the bin subdirectory.

Within that handler, you can do what you want. It is not restricted to URLs
that end in particular . The interface is simple, consisting of a single
method, ProcessRequest(), which feels something like the service() method of
the Java Servlet.

public void ProcessRequest(HttpContext context)
{
}

Now, for any request that arrives of the form
http://yourserver/albums/something/something ,
your handler gets called, and you decide what to do with the request:
handle it, rewrite the URL, forward the request, or do something else.
It's up to you. But the key is, your handler layers on ASP.NET, which in
turn depends on IIS. IIS needs to send the incoming request to ASP.NET
before your handler can be activated. By default, IIS sends only requests
with extensions like .aspx and .asmx to ASP.NET, so your handler won't get
activated, by default, for URLs that lack these extensions. In other words
you would need http://yourserver/albums/something/something.aspx . The
second link above discusses how to activate your IHttpHandler for "all
requests" of any extension, and also some of the pitfalls of that technique.


-Dino
 
D

Dino Chiesa [Microsoft]

I think the general solution requires an ISAPI filter, something like a
module for the Apache HTTP Server.
-Dino
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top