c# - How to call method defined in Default.aspx.cs from another class -
I'm quite new to ASP.NET and I'm trying to build a website. I have a class in AppCode / GSA that requires access to declared event handlers in default aspx.cs. Can anyone help with it? I tried to search about it but all I got is standard method call like classname.methodname () after making an example of that class. Please help me here.
What do I want to do here and why I need to say the method in default. Espx.cs
I'm calling to do GSA operations, the HTML string I'm using to display search results in the placeholder. It works perfectly well now I am adding buttons in front of every search I show. When a user clicks on this button, the button must be replaced with the textfield and it will contain a small URL for that search result.
Now I am getting the button to display every result, I have to assign the event handler to that button. I tried to put myself in that GSACS event handler, but the function was not called because it is not defined by default, so I defalut.aspx.cs P>
Generally speaking, the event handler is not something that should be shared between classes. If you need to use the same functionality in two places, then drag that functionality to your own method and open that method in your event handlers:
Private Zero MyEventHandler (Object) Sender, EventArgs e) {// Some complex functionality} should be: :
Public Zero DoComplex functionality () {// some complex functionality} private Zero MyEventHandler (Object Sender, EventAggles e) {DopPllex F Nkshnsiliti (); } "Where do I put DoComplexFunctionality () ?" He is the one who can only be answered meaningfully by a person who ensures that what he does. You can make it a member of a static class, which will make it accessible for any code that can see that class. Or, if you are responsible for converting a particular value, you can make it an example member of a class that captures those values, and can provide an example of that class, which this method Need to be used. In any case, there is no way to try to call an event handler directly.
Comments
Post a Comment