I can add an existing item to the solution explorer manually. But is there a way to do this programmatically (i.e., at run time)?

Recommended Answers

All 3 Replies

can you post an example of what you want?

Are you referring to adding an existing item to the project in the VS IDE? And you want to do that programmatically when the project is running? Because that would be the same as uploading a file or image and saving it. Is that what you want to do?

Yes, that is exactly what I want. Actually, I want to create a page, then write its contents, and then redirect to the newly created page. And all these has to be done dynamically.

I have tried both File.CreateText() and FileUpload.SaveAs() methods. These procedures were able to create the files, which can be seen in the corresponding folders as per the codes I have used.

But the problem is, they are not shown in the solution explorer, even if I refresh it. That is the reason I am not able redirect to the newly created page once it is created.

Any suggestion to solve it??????

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.