Anjana
Anjana

Reputation: 1453

Identifying a usercontrol in the same page in ASP.net

Am using a user control say C in a page say A. So also while doing a submit / or action in the user control ( It contains a grid with edit delete functionality) , control goes to parent page A then only enters to the edit or delete function.

How can i identify that the control has been directed from the user control? Please help me out.

Thanks in Advance

Upvotes: 0

Views: 114

Answers (2)

Anjana
Anjana

Reputation: 1453

I got a work around . I would like to share it over here.

We can use this.Parent.FindControl("x").Visible = false; here x is the div in the parent page which incorporates the user control. Using this i solved my problem instead of tracking the flow.

My problem was like while the user control pops up, one control inside the parent page also get popped up even if its visibility is set to false. I needed to truncate this. Thanks .

Upvotes: 0

Nikhil Agrawal
Nikhil Agrawal

Reputation: 48568

How about

if (sender is C) // You said your usercontrol is say C
{
    //Your Code Here
}

Upvotes: 1

Related Questions