.ascx file as index page?

H

Henry Sun

Hi all,

New to ASP.NET and this Newsgroup. recently I saw some major websites
use ascx page as their index page (e.g. index.ascx?ProductId=blah). I
did a little bit rearch but I still couldn't find any word about this...
My question is How does it work? What's benefit of this? Was that some
kind of templet?

Thank you in advance

Henry
 
K

Karl Seguin

There are 2 guesses:

1-
if you goto:
C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\CONFIG
(winnt on 2000, and possible a different version number)

and open up machine.config (don't mess with it unless you know what are you
are doing), do a search for PageHandlerFactory and you'll see how asp.net
internally maps an extension to an HttpHandler.

There'd be no advantage to this method other thanbeing cool. Their ascx
would still need to inherit from Page and be like your normal Page

2-
They are using UrlRewriting, so while it looks like it's going to
index.ascx?asds=asd it's really going to another page(say index.aspx). For
this to work, they'd again need to remove .ascx as a "HttpForbiddenHandler"
in the web.config and really wouldn't be how I'd recommend they do whatever
they are trying to do..

Karl
 
H

Henry Sun

Hi Karl,

Thank you very much for your explanation! I am learning how to build
enterprise website using asp.net, so I thought I might just found a
standard way (or some sort of templet) while I saw it... so there isn't
much benefit by using .ascx file as a index page at all :(

Thank you again for clarify that :)

Henry
 

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

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,682
Members
48,796
Latest member
Greg L.

Latest Threads

Top