Web User Control

  • Thread starter Thread starter Angel
  • Start date Start date
A

Angel

When i try to run the web page that contains a custom web
user control '.ascx.' file i get the following error:

The type of page you have requested is not served because
it has been explicitly forbidden. The extension '.ascx'
may be incorrect.

What is wrong?

Thanks
 
Ascx controls aren't meant to be served, as the message indicates, they are
meant to be consumed by aspx pages. How are you including this in your page?
 
I just dragged the user control onto my aspx page. I also
tried 'View in Browser' the .ascx file and got the same
error. I am wondering if its a configuration error on my
IIS. That it is a file restricted from being served.

Thanks for the quick response
 
I would...

Start a new project
create a webform
create a usercontrol with simple text/html
save them
drop the user control on the webform
make the webform "Set as start page"
run the project and see if you get the same error

--
Jerry Boone
Analytical Technologies, Inc.
http://www.antech.biz
Secure Hosting and Development Solutions for ASP, ASP.NET, SQL Server, and
Access
 
Back
Top