kateL
asked on
MVP design pattern question
Hi experts,
I have events that get fired from my View and get handled in my Presenter
for example i might have in my View:
this.radioButtonList.Selec tedIndexCh anged += delegate
{
OnClassSelected(this.radio Button, EventArgs.Empty);
};
and OnClassSelected gets handled in my presenter:
void _view_OnClassSelected(obje ct sender, EventArgs)
{
{
My problem is how can i use the sender parameter to for example get the selected value if I don't have access to System.Web.UI.WebControls to cast the sender object to a RadioButtonList?
Thanks
I have events that get fired from my View and get handled in my Presenter
for example i might have in my View:
this.radioButtonList.Selec
{
OnClassSelected(this.radio
};
and OnClassSelected gets handled in my presenter:
void _view_OnClassSelected(obje
{
{
My problem is how can i use the sender parameter to for example get the selected value if I don't have access to System.Web.UI.WebControls to cast the sender object to a RadioButtonList?
Thanks
ASKER
what if my presenter is in a different project which does not have a reference to System.Web. That is the problem I mean.
What is the best practice in this case when using the MVP?
one solution would be to expose the SelectValue property though the interface but is this the best way?
I can see that it would get very cumbersome doing this if you had loads of controls to deal with
What is the best practice in this case when using the MVP?
one solution would be to expose the SelectValue property though the interface but is this the best way?
I can see that it would get very cumbersome doing this if you had loads of controls to deal with
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
no its not the best way to expose the selectedValue alone...
check this - may be you will get some idea...
http://www.codeproject.com/useritems/mvp_asp_net_net_remoting.asp
http://forums.asp.net/t/1036676.aspx
check this - may be you will get some idea...
http://www.codeproject.com/useritems/mvp_asp_net_net_remoting.asp
http://forums.asp.net/t/1036676.aspx
like
(RadioButton)sender