Click here to Skip to main content
15,890,527 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have a masterpage and if user login the site menu and logout usercontrol fill dynamically.(masterpage code side loading usercontrols)

logout menu has profile image.

there is x.aspx page derived from masterpage.
x.aspx has image upload usercontrol(not dynamic)if I want to change my profile image I use this usercontrol but logout image not changing.

if I click button twice when upload image logout image changing or if I visit menu logout image changing ?

how can fix this problem????
Posted

1 solution

There is no such concept, "to call an event". Events are invoked, and this is very different from calling. Now, the thing is: in .NET, it is impossible to invoke any event from anywhere except the declaring type of the event instance. This is an important fool-proof feature of events, in contrast to "normal" delegate instances. If the type is not yours (say, you don't have source code but have to use some type from a library, presumably .NET FCL), and the type does not provide a method or a property which indirectly invokes that events, you cannot programmatically invoke it at all; you can only do it during runtime by operating a mouse or a keyboard.

But this is never needed. You can always write a method which you can call in two or more places: from some event handler and directly. You never really need to invoke an event, but you need to programmatically create the same effect as in case of event. In your case, it's even simpler: you just need to add a property used to change some image.

—SA
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900