Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to fire OnTextChanged in Submit method?
Message
 
 
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
C# 2.0
Miscellaneous
Thread ID:
01370003
Message ID:
01370009
Views:
15
>>I have a textbox that fires when user changes the entry. The OnTextChanged method calls database and validates that the entry exist in the database. However, the user may not change the default entry in this text box (the text box gets a default entry from a cookie) and simply click on Submit. I need to call this OnTextChanged method in the Submit method. The following is the top line of the method:
>>
>>
>>public void txtCostCenter_TextChanged(object sender, System.EventArgs e)
>>
>>
>>In order to call this method in the Submit I need to pass the parameters (that I don't even use). How can I pass some dummy parameters that would satisfy the compiler in terms of type of parameters?
>
txtCostCenter_TextChanged(new object(),new EventArgs());
Thank you very much! It works. But let me ask you a follow up question (if you are not yet tired of me too much {g}). Do you think it is better to break my method txtCostCenter_TextChanged into 2 methods? That is, to have a separate method that only validates the entry. Then I can call just the Validate method from the Submit method. I am just thinking of the best practice of maintaining the code.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform