Link to home
Start Free TrialLog in
Avatar of curiouswebster
curiouswebsterFlag for United States of America

asked on

"Cannot redirect after HTTP headers have been sent."

I am trying to redirect from an ASP.NET MVC Controller Action to a static domain address. But I get the followinng exception "Cannot redirect after HTTP headers have been sent."

Any suggestions?

newbieweb
public ActionResult DataAdmin()
        {
            return Redirect("http://www.google.com");
        }

Open in new window

SOLUTION
Avatar of Roman Gherman
Roman Gherman
Flag of Moldova, Republic of image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Avatar of Randy Downs
Randy Downs
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of curiouswebster

ASKER

Thanks.