Question

I'm not sure the title makes best sense.

I'm trying to call a method which would usually be only accessible by direct clicks from the front page itself. However in one very particular instance I need to call this method the once, but as this method uses a Buttons CommandArgument to determine what it should do I need to get the CommandArgument of this fake button call.

I would usually call a method like so

Make_Profile(this, new EventArgs());

or

Make_Profile(null, null);

I have tried calling a method like so:

AddressPage(this, new EventArgs("CommandArgument", "1");

But I don't think I understood this piece of code well.

Within the Method I call:

argument = ((Button)sender).CommandArgument;

    if (string.IsNullOrWhiteSpace(argument))
    {
        numba = 0;
    }
    else
    {
        numba = Convert.ToInt32(argument);
    }

So hopefully you can see what I'm trying to get from Button.

No correct solution

OTHER TIPS

Make_Profile(null, null);

work fine.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top