开发者

Method in WebUserControl is called many times

开发者 https://www.devze.com 2023-03-28 11:50 出处:网络
I have a method in WebUserControl which is called twice in my code once from the Page_loadevent of WebUsercontrol (Inside !isPostback) and second in the page_Load event of Page where this WebUserContr

I have a method in WebUserControl which is called twice in my code once from the Page_load event of WebUsercontrol (Inside !isPostback) and second in the page_Load event of Page where this WebUserControl is u开发者_StackOverflow社区sed (again in !ispostback).

But I kept a breakpoint on this method and observe that this is called around 8 times.

This method is called even when I log-In into the application.

I understand that if you AutoEventWireup = "true" then the page_Load method is called twice.

But why this method is called 8 times?

Why this method is called on Login Page?

Please suggest

Thanks


May be your WebUserControl renders again and again like your page is creating postbacks so that method runs many time.

0

精彩评论

暂无评论...
验证码 换一张
取 消