Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to clean the whole asp.net page in code behind?

Tags:

asp.net

Suppose I have a aspx page with UI and code behind.

I have code in event Page_Load like:

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
   Me.Response.Write("Clean the page")
   '.....
End Sub

but the page still render out with whole thing in aspx(all those markup).

What I want is the only display "Clean the page" in browser for user. How to do it?

like image 828
KentZhou Avatar asked Jan 11 '23 08:01

KentZhou


1 Answers

Like this:

Response.Clear();
Response.ClearHeaders();

Probably you will want to combine it with a:

Response.End(); 
like image 91
Dalorzo Avatar answered Jan 19 '23 07:01

Dalorzo