0

A Form is posted to a SurfaceController 'Submit' action. After saving to the database, it redirects to another action 'LeadContact', in the same controller (using RedirectToAction()), passing in 'Id' as a paramter. The model is then populated and passed to the 'LeadContact' view.

Not sure if I'm doing this correctly, but when 'LeadContact' renders in the browser, the URL shows as

http://localhost:50656/umbraco/Surface/HealthInsurance/LeadContact?leadOptionId=70` 

while I'm expecting it to be

http://localhost:50656/HealthInsurance/LeadContact?leadOptionId=70

In short it adds /umbraco/SurfaceContact' into url.

Can you please advise how I can correct it and what I'm doing wrong ?

 public ActionResult Submit(FormCollection form)
        {

            //Some logic and later redirect to another action 'LeadContact'             

return RedirectToAction("LeadContact", new { leadOptionId = _id}); 
         }



   public ActionResult LeadContact(int leadOptionId)

    {
       MyViewModel model = new MyViewModel();         

       //Lines of code to populate data into model   

        return View("LeadContact", model);
    }

Thanks for your help and sharing.

Hywel Rees
  • 884
  • 1
  • 15
  • 22
user576510
  • 5,777
  • 20
  • 81
  • 144
  • This is the same question as the one you asked two hours ago: [RedirectToAction is not working correctly in SurfaceController?](http://stackoverflow.com/questions/27357230/redirecttoaction-is-not-working-correctly-in-surfacecontroller). – CodeCaster Dec 08 '14 at 14:03

1 Answers1

0

Check your project properties, under Web you most likely have a virtual path specified.

Brian from state farm
  • 2,825
  • 12
  • 17
  • This is not related to virtual paths. By default, Umbraco surface controller URLs contain /Umbraco/Surface/. The answer here suggests custom routes: http://stackoverflow.com/questions/27369101/how-to-remove-umbraco-surface-from-url/27382372#27382372 – Hywel Rees Dec 09 '14 at 15:58