2

I am trying to create a dynamic web page from a template.Then i want to create a menu item from it.

I am creating the page(testtest.aspx for example) and everything works fine but the created page doesn't include in project so i can't reach it because the page is not compiling.How can i do this programmatically ?

This is the code that generates the page

http://imgur.com/oljO41v

When i try to access the testest.aspx page i get this error:

http://imgur.com/SX6lJWh

How can i solve this ? Thank you very much

1

1 Answer 1

2

You are looking for loading aspx pages from a location other than file-system. ASP.Net has built-in mechanism for doing that using providers: VirtualPathProvider.

Details are here: http://msdn.microsoft.com/en-us/library/system.web.hosting.virtualpathprovider.aspx

This will point you in the right direction: http://support.microsoft.com/kb/910441

Sign up to request clarification or add additional context in comments.

2 Comments

Actually i am creating the page inside of the project.I am not trying to access from another location.Everything is in the file system.When i open a new web page in visual studio the code is working properly but when i try to use this code in project section in visual studio the code is not working.
It seems that your project is a WAP instead of Website. You will have to change the @Page directive: instead of CodeBehind=, it will be CodeFile. And also you will have to remove the namespace from Inherits=.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.