Darren
Darren

Reputation: 11011

How to override render for C# asp.net web form?

I am working with a page and basically if my user isn't authenticated I want to show the user the HTML on the Web Form page, otherwise I want the response to be JSON and kill whatever would be on the page... does anyone have any idea of how I could do this? Can you tell me the way to get to the response before the view does?

Thanks

Upvotes: 0

Views: 908

Answers (1)

competent_tech
competent_tech

Reputation: 44941

For the JSON track, you could do Response.Clear(), Response.Write() your json data, then Response.End() to send the json and not process the standard page.

Upvotes: 2

Related Questions