I'm new to ASP.NET MVC 4.
I'm able to create a folder with a hardcoded name using Directory.CreateDirectory(@"C:/") in my controller, but what I need to do is have the user type the desired folder name into a textbox, and pass that information to the CreateFolder method in the Controller.
Here's the method:
public ActionResult CreateFolder(String newFolderName)
{
Directory.CreateDirectory(@"C:\..." + newFolderName);
return View();
}
In my view I need a textbox for the user to define the desired folder name, and a button that creates the folder with the selected name. How should I handle this?
I've tried some suggestions from the web, but can't seem to get it going.