문제

I have an ASCX file and I'm doing some validation to the data available.

What I would like to do is say "If the data is invalid, set this.visible to false, and stop processing the ASCX file. I can add a "return" statement to my ASCX in Page_Load which stops processing just fine but I'm running into issues where I'm in 3-4 methods deep, and simply calling "return" just returns from the current method. Unless I bubble it all the way to the top there's no way to use it properly.

Is there a way I can stop the processing of a ASCX file at any point, not just from a top level method (by top level I mean a Page_Load for example).

Thanks!

도움이 되었습니까?

해결책

You could use CompleteRequest to do what you are talking about.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top