473,320 Members | 1,828 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Another MVP pattern question

Hi,

I am new to the MVP pattern and one of the main reasons that we are going
this route is because we are doing Scrum with 30 day sprints - so we have a
continually morphing design. We are using TDD as well to improve our ability
to refactor... you probably all know this approach.

Although the user iterface is supposedly one of the last things that you
need to do, this is a web app and we have multiple nested Repeaters on the
page. Within these repeaters we have a textbox in one column that we need to
retrieve contents from. I have been struggling trying to find examples of
something like this as I can't figure out how to expose this to the view
through the interface. Having a single control on the page is easy to use
through the interface. Retrieving the data in the code behind depends on
using Repeater names and FindControls, etc.

The code for that currently looks something like this:

foreach (RepeaterItem pgItem in ProdGroupRepeater.Items)
{
Repeater prodRepeater = (Repeater)pgItem.FindControl("ProductRepeater");
sProdGroup = ((Label)pgItem.FindControl("ProductGroupName")).Te xt;

foreach (RepeaterItem prodItem in prodRepeater.Items)
{
Repeater tierRepeater =
(Repeater)prodItem.FindControl("TiersRepeater");
sProduct = ((Label)prodItem.FindControl("ProductName")).Text;

foreach (RepeaterItem tierItem in tierRepeater.Items)
{

sRecommendedAPY =
((TextBox)tierItem.FindControl("RecommendedAPY")). Text;
sApprovedAPY =
((TextBox)tierItem.FindControl("ApprovedAPY")).Tex t;
sMinBal = ((HiddenField)tierItem.FindControl("MinBal")).Valu e;
RateChangeDTO rcDTO = new RateChangeDTO();
rcDTO.RecommendedAPY = sRecommendedAPY;
rcDTO.ProductGroup = sProdGroup;
rcDTO.ProductName = sProduct;
rcDTO.DistrictID = sDistrictID;
rcDTO.MinBal = sMinBal;

ListOAPYs.Add(rcDTO);
}
}

Is there some way to retrieve the data from these textboxes in the MVP
pattern? I searched for a couple days and coudn't find any examples similar
enough that I could apply.

If this isn't enough info to help, I could put together a simple example
that uses these same concepts. Maybe I'm totally off base here - like I said,
I'm completely new to all of this.

thanks!!
Bill
Nov 5 '06 #1
6 2027
Your question is confusing. If you're having trouble writing the code
for a repeater I suggest going to www.4guysfromrolla.com. They have a
most excellent article on the subject. Also highly recommend this book:
"ASP.NET Data Web Controls Kick Start." IF the issue is MVC, read on....
This really is not the silver bullet you're looking for. It's going to
take some discussion (from the entire group here!) to get to what you
want.

I assume you mean "MVC" - Model View Controller pattern; not MVP.

Don't confuse the pattern with the implementation.

MVP is a bit different for the web. BTW get this most excellent book
and you will understand patterns. "Head First Design Patterns" by Eric
Freeman & Elisabeth Freeman (OReilly press). this book has a section
on MVC and MVC for web in particular.

We are doing a 3 tier approach for our web application but we are not
implementing MVC per se. I'll tell you what we're doing and maybe that
will help. In particular I used a DataList so I think it's similar to
your problem.

The first tier is the web interface. It has a Datalist and we have
home-made header and footer web controls as standard things on all our
pages. The code-behind simply gets the data on postback, I wrote code
to loop through the DataList just as your code shows, and bundles it
up in a meaningful way. In my case I have an ArrayList of
"activityDescription" objects. Then code-behind for this page
instantiates a "business object" - the second tier and passes the
ArrayList to the business object.

The business layer does our data validation, calling the validation
methods for each item in the ArrayList and building up a string of
error messages. Also this Business object in turn instantiates a "data
layer" object and passes this data to this 3rd tier. The 3rd tier
iterates through the ArrayList, getting the data and storing it to the
database.

Additionally I have a "ActivityDescription" class which of course
"holds one record's worth" of data, and has data validation functions
in it.

So I have the following files:
PS3320.aspx - the UI
PS3320.aspx.cs - Essentially this is the code you are showing us here.

The business object:
PS3320.cs - Holds an arraylist of ActivityDescription objects. runs
validation functions. Passes arraylist to data layer.

The Data Layer
ourDAL.cs (ie. "DAL" = Data Access Layer) - Iterates thru the
arraylist, get's the data and stores it to db. Also fetches data from
DB and bundles it into an arraylist.

The Data Structure
ActivityDescription.cs - Has basic data and all the data valiation functions.

There is nothing magic about interfacing the layers. Sometimes one gets
the impression from reading about patterns that very general interfaces
can throw around data w/o knowing it's specific structure, types, etc.
and like magic it shows up, but fundamentally each layer must
understand what data is being passed; so each field is displayed in the
proper place on the screen, so that the proper data validation checks
are done, and so it's saved in the proper place in the database.
Therefore each tier "knows" the ActivityDescription class so each layer
can "bundle" and "unbundle" the data as needed. Thus *every layer*
knows it's getting an ArrayList of ActivityDescription objects. It's
the "ArrayList part that is "generic." Once passed the other layer must
know about the data in the ArrayList.

And Now On To MVC
"Head Start Design Patterns" says that the adaptation of MVC to the web
is called "Model 2". Note this book uses Java and Java Terms, so I'm
translating as best I understand it. So in summary:
** You make an HTTP request which is received by [the code behind]
** The [code behind] acts as the controller. It will make the request
for data from the database. The book says "the result ... is usually
bundled up in the form of a JavaBean." I would say this is the
functional equivalent of my Arraylist of "ActivityDescription" objects.
** The controller forwards control to the view. The view is what you
see in Visual Studio in the "design" and "HTML" screens. The Repeaters
DataBind() takes care of getting data to the view /screen.
** the view returns a page to the browser via HTTP.

Is My Application using MVC then?
I'd say not in the strict academic sense. MVC is a composite of
"strategy", "observer", and "composite" patterns. We did not
consciously design these composite patterns. But the .NET paradigm of
separation of HTML from code-behind blurs things. So perhaps you could
say .NET partially implements MVC already. I'm not so sure our design
decouples the parts like strict adherience to MVC would. But this would
perhaps just be an academic exercise for us. Because in the final
analysis using patterns, for patterns sake alone, is not a good idea.
Patterns should help create good design; design should not necessarily
evolve into defined patterns. They are "patterns" after all, not
hard-and-fast rules.

On 2006-11-05 09:40:02 -0600, Bill44077
<Bi*******@discussions.microsoft.comsaid:
Hi,

I am new to the MVP pattern and one of the main reasons that we are
going this route is because we are doing Scrum with 30 day sprints - so
we have a continually morphing design. We are using TDD as well to
improve our ability to refactor... you probably all know this approach.

Although the user iterface is supposedly one of the last things that
you need to do, this is a web app and we have multiple nested Repeaters
on the page. Within these repeaters we have a textbox in one column
that we need to retrieve contents from. I have been struggling trying
to find examples of something like this as I can't figure out how to
expose this to the view through the interface. Having a single control
on the page is easy to use through the interface. Retrieving the data
in the code behind depends on using Repeater names and FindControls,
etc.

The code for that currently looks something like this:

foreach (RepeaterItem pgItem in ProdGroupRepeater.Items)
{
Repeater prodRepeater = (Repeater)pgItem.FindControl("ProductRepeater");
sProdGroup = ((Label)pgItem.FindControl("ProductGroupName")).Te xt;

foreach (RepeaterItem prodItem in prodRepeater.Items)
{
Repeater tierRepeater =
(Repeater)prodItem.FindControl("TiersRepeater");
sProduct = ((Label)prodItem.FindControl("ProductName")).Text;

foreach (RepeaterItem tierItem in tierRepeater.Items)
{

sRecommendedAPY =
((TextBox)tierItem.FindControl("RecommendedAPY")). Text;
sApprovedAPY = ((TextBox)tierItem.FindControl("ApprovedAPY")).Tex t;
sMinBal = ((HiddenField)tierItem.FindControl("MinBal")).Valu e;
RateChangeDTO rcDTO = new RateChangeDTO();
rcDTO.RecommendedAPY = sRecommendedAPY;
rcDTO.ProductGroup = sProdGroup;
rcDTO.ProductName = sProduct;
rcDTO.DistrictID = sDistrictID;
rcDTO.MinBal = sMinBal;

ListOAPYs.Add(rcDTO);
}
}

Is there some way to retrieve the data from these textboxes in the MVP
pattern? I searched for a couple days and coudn't find any examples
similar enough that I could apply.

If this isn't enough info to help, I could put together a simple
example that uses these same concepts. Maybe I'm totally off base here
- like I said, I'm completely new to all of this.

thanks!!
Bill

Nov 5 '06 #2
Jeremy Miller has a post that addresses part of this issue with MVP:
http://codebetter.com/blogs/jeremy.m...01/137457.aspx

Hope that helps.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Bill44077" wrote:
Hi,

I am new to the MVP pattern and one of the main reasons that we are going
this route is because we are doing Scrum with 30 day sprints - so we have a
continually morphing design. We are using TDD as well to improve our ability
to refactor... you probably all know this approach.

Although the user iterface is supposedly one of the last things that you
need to do, this is a web app and we have multiple nested Repeaters on the
page. Within these repeaters we have a textbox in one column that we need to
retrieve contents from. I have been struggling trying to find examples of
something like this as I can't figure out how to expose this to the view
through the interface. Having a single control on the page is easy to use
through the interface. Retrieving the data in the code behind depends on
using Repeater names and FindControls, etc.

The code for that currently looks something like this:

foreach (RepeaterItem pgItem in ProdGroupRepeater.Items)
{
Repeater prodRepeater = (Repeater)pgItem.FindControl("ProductRepeater");
sProdGroup = ((Label)pgItem.FindControl("ProductGroupName")).Te xt;

foreach (RepeaterItem prodItem in prodRepeater.Items)
{
Repeater tierRepeater =
(Repeater)prodItem.FindControl("TiersRepeater");
sProduct = ((Label)prodItem.FindControl("ProductName")).Text;

foreach (RepeaterItem tierItem in tierRepeater.Items)
{

sRecommendedAPY =
((TextBox)tierItem.FindControl("RecommendedAPY")). Text;
sApprovedAPY =
((TextBox)tierItem.FindControl("ApprovedAPY")).Tex t;
sMinBal = ((HiddenField)tierItem.FindControl("MinBal")).Valu e;
RateChangeDTO rcDTO = new RateChangeDTO();
rcDTO.RecommendedAPY = sRecommendedAPY;
rcDTO.ProductGroup = sProdGroup;
rcDTO.ProductName = sProduct;
rcDTO.DistrictID = sDistrictID;
rcDTO.MinBal = sMinBal;

ListOAPYs.Add(rcDTO);
}
}

Is there some way to retrieve the data from these textboxes in the MVP
pattern? I searched for a couple days and coudn't find any examples similar
enough that I could apply.

If this isn't enough info to help, I could put together a simple example
that uses these same concepts. Maybe I'm totally off base here - like I said,
I'm completely new to all of this.

thanks!!
Bill
Nov 5 '06 #3
sHi Bob.

Thanks so much for the detailed explaination. I do mean Model View
Presenter.. in fact, in Fowler's description would be the Passive model vs
the Supervising Controller.

http://martinfowler.com/eaaDev/PassiveScreen.html

I do have the Head's Up Design book as well (and it's great!). But, my
trouble has to do with the view interface and figuring out how to get data
from textboxes that are embedded in multiply nested repeater controls. I know
it's best to keep the interface elements as simple types if possible, but I
think that I might need to make a List as a getter and populate it from the
code behind.

thanks!
Bill

"Bob Jones" wrote:
Your question is confusing. If you're having trouble writing the code
for a repeater I suggest going to www.4guysfromrolla.com. They have a
most excellent article on the subject. Also highly recommend this book:
"ASP.NET Data Web Controls Kick Start." IF the issue is MVC, read on....
This really is not the silver bullet you're looking for. It's going to
take some discussion (from the entire group here!) to get to what you
want.

I assume you mean "MVC" - Model View Controller pattern; not MVP.

Don't confuse the pattern with the implementation.

MVP is a bit different for the web. BTW get this most excellent book
and you will understand patterns. "Head First Design Patterns" by Eric
Freeman & Elisabeth Freeman (OReilly press). this book has a section
on MVC and MVC for web in particular.

We are doing a 3 tier approach for our web application but we are not
implementing MVC per se. I'll tell you what we're doing and maybe that
will help. In particular I used a DataList so I think it's similar to
your problem.

The first tier is the web interface. It has a Datalist and we have
home-made header and footer web controls as standard things on all our
pages. The code-behind simply gets the data on postback, I wrote code
to loop through the DataList just as your code shows, and bundles it
up in a meaningful way. In my case I have an ArrayList of
"activityDescription" objects. Then code-behind for this page
instantiates a "business object" - the second tier and passes the
ArrayList to the business object.

The business layer does our data validation, calling the validation
methods for each item in the ArrayList and building up a string of
error messages. Also this Business object in turn instantiates a "data
layer" object and passes this data to this 3rd tier. The 3rd tier
iterates through the ArrayList, getting the data and storing it to the
database.

Additionally I have a "ActivityDescription" class which of course
"holds one record's worth" of data, and has data validation functions
in it.

So I have the following files:
PS3320.aspx - the UI
PS3320.aspx.cs - Essentially this is the code you are showing us here.

The business object:
PS3320.cs - Holds an arraylist of ActivityDescription objects. runs
validation functions. Passes arraylist to data layer.

The Data Layer
ourDAL.cs (ie. "DAL" = Data Access Layer) - Iterates thru the
arraylist, get's the data and stores it to db. Also fetches data from
DB and bundles it into an arraylist.

The Data Structure
ActivityDescription.cs - Has basic data and all the data valiation functions.

There is nothing magic about interfacing the layers. Sometimes one gets
the impression from reading about patterns that very general interfaces
can throw around data w/o knowing it's specific structure, types, etc.
and like magic it shows up, but fundamentally each layer must
understand what data is being passed; so each field is displayed in the
proper place on the screen, so that the proper data validation checks
are done, and so it's saved in the proper place in the database.
Therefore each tier "knows" the ActivityDescription class so each layer
can "bundle" and "unbundle" the data as needed. Thus *every layer*
knows it's getting an ArrayList of ActivityDescription objects. It's
the "ArrayList part that is "generic." Once passed the other layer must
know about the data in the ArrayList.

And Now On To MVC
"Head Start Design Patterns" says that the adaptation of MVC to the web
is called "Model 2". Note this book uses Java and Java Terms, so I'm
translating as best I understand it. So in summary:
** You make an HTTP request which is received by [the code behind]
** The [code behind] acts as the controller. It will make the request
for data from the database. The book says "the result ... is usually
bundled up in the form of a JavaBean." I would say this is the
functional equivalent of my Arraylist of "ActivityDescription" objects.
** The controller forwards control to the view. The view is what you
see in Visual Studio in the "design" and "HTML" screens. The Repeaters
DataBind() takes care of getting data to the view /screen.
** the view returns a page to the browser via HTTP.

Is My Application using MVC then?
I'd say not in the strict academic sense. MVC is a composite of
"strategy", "observer", and "composite" patterns. We did not
consciously design these composite patterns. But the .NET paradigm of
separation of HTML from code-behind blurs things. So perhaps you could
say .NET partially implements MVC already. I'm not so sure our design
decouples the parts like strict adherience to MVC would. But this would
perhaps just be an academic exercise for us. Because in the final
analysis using patterns, for patterns sake alone, is not a good idea.
Patterns should help create good design; design should not necessarily
evolve into defined patterns. They are "patterns" after all, not
hard-and-fast rules.

On 2006-11-05 09:40:02 -0600, Bill44077
<Bi*******@discussions.microsoft.comsaid:
Hi,

I am new to the MVP pattern and one of the main reasons that we are
going this route is because we are doing Scrum with 30 day sprints - so
we have a continually morphing design. We are using TDD as well to
improve our ability to refactor... you probably all know this approach.

Although the user iterface is supposedly one of the last things that
you need to do, this is a web app and we have multiple nested Repeaters
on the page. Within these repeaters we have a textbox in one column
that we need to retrieve contents from. I have been struggling trying
to find examples of something like this as I can't figure out how to
expose this to the view through the interface. Having a single control
on the page is easy to use through the interface. Retrieving the data
in the code behind depends on using Repeater names and FindControls,
etc.

The code for that currently looks something like this:

foreach (RepeaterItem pgItem in ProdGroupRepeater.Items)
{
Repeater prodRepeater = (Repeater)pgItem.FindControl("ProductRepeater");
sProdGroup = ((Label)pgItem.FindControl("ProductGroupName")).Te xt;

foreach (RepeaterItem prodItem in prodRepeater.Items)
{
Repeater tierRepeater =
(Repeater)prodItem.FindControl("TiersRepeater");
sProduct = ((Label)prodItem.FindControl("ProductName")).Text;

foreach (RepeaterItem tierItem in tierRepeater.Items)
{

sRecommendedAPY =
((TextBox)tierItem.FindControl("RecommendedAPY")). Text;
sApprovedAPY = ((TextBox)tierItem.FindControl("ApprovedAPY")).Tex t;
sMinBal = ((HiddenField)tierItem.FindControl("MinBal")).Valu e;
RateChangeDTO rcDTO = new RateChangeDTO();
rcDTO.RecommendedAPY = sRecommendedAPY;
rcDTO.ProductGroup = sProdGroup;
rcDTO.ProductName = sProduct;
rcDTO.DistrictID = sDistrictID;
rcDTO.MinBal = sMinBal;

ListOAPYs.Add(rcDTO);
}
}

Is there some way to retrieve the data from these textboxes in the MVP
pattern? I searched for a couple days and coudn't find any examples
similar enough that I could apply.

If this isn't enough info to help, I could put together a simple
example that uses these same concepts. Maybe I'm totally off base here
- like I said, I'm completely new to all of this.

thanks!!
Bill


Nov 5 '06 #4
Hey Peter,

Thanks - I'd read some of Jeremy's articles but hadn't seen this one. This
does help. My other favorites are Jean-Paul Boodhoo and Billy McCafferty.

Now - if there was only some good intro book on Rhinomocks! :)

regards,
Bill

"Peter Bromberg [C# MVP]" wrote:
Jeremy Miller has a post that addresses part of this issue with MVP:
http://codebetter.com/blogs/jeremy.m...01/137457.aspx

Hope that helps.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Bill44077" wrote:
Hi,

I am new to the MVP pattern and one of the main reasons that we are going
this route is because we are doing Scrum with 30 day sprints - so we have a
continually morphing design. We are using TDD as well to improve our ability
to refactor... you probably all know this approach.

Although the user iterface is supposedly one of the last things that you
need to do, this is a web app and we have multiple nested Repeaters on the
page. Within these repeaters we have a textbox in one column that we need to
retrieve contents from. I have been struggling trying to find examples of
something like this as I can't figure out how to expose this to the view
through the interface. Having a single control on the page is easy to use
through the interface. Retrieving the data in the code behind depends on
using Repeater names and FindControls, etc.

The code for that currently looks something like this:

foreach (RepeaterItem pgItem in ProdGroupRepeater.Items)
{
Repeater prodRepeater = (Repeater)pgItem.FindControl("ProductRepeater");
sProdGroup = ((Label)pgItem.FindControl("ProductGroupName")).Te xt;

foreach (RepeaterItem prodItem in prodRepeater.Items)
{
Repeater tierRepeater =
(Repeater)prodItem.FindControl("TiersRepeater");
sProduct = ((Label)prodItem.FindControl("ProductName")).Text;

foreach (RepeaterItem tierItem in tierRepeater.Items)
{

sRecommendedAPY =
((TextBox)tierItem.FindControl("RecommendedAPY")). Text;
sApprovedAPY =
((TextBox)tierItem.FindControl("ApprovedAPY")).Tex t;
sMinBal = ((HiddenField)tierItem.FindControl("MinBal")).Valu e;
RateChangeDTO rcDTO = new RateChangeDTO();
rcDTO.RecommendedAPY = sRecommendedAPY;
rcDTO.ProductGroup = sProdGroup;
rcDTO.ProductName = sProduct;
rcDTO.DistrictID = sDistrictID;
rcDTO.MinBal = sMinBal;

ListOAPYs.Add(rcDTO);
}
}

Is there some way to retrieve the data from these textboxes in the MVP
pattern? I searched for a couple days and coudn't find any examples similar
enough that I could apply.

If this isn't enough info to help, I could put together a simple example
that uses these same concepts. Maybe I'm totally off base here - like I said,
I'm completely new to all of this.

thanks!!
Bill
Nov 5 '06 #5
Hey Peter,

Thanks - I've seen some of Jeremy's articles, but not this one. My other
fav's are Jean-Paul Boodhoo and Billy McCafferty.

Now, if there was just a great into book on Rhinomocks!

regards,
Bill

"Peter Bromberg [C# MVP]" wrote:
Jeremy Miller has a post that addresses part of this issue with MVP:
http://codebetter.com/blogs/jeremy.m...01/137457.aspx

Hope that helps.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Bill44077" wrote:
Hi,

I am new to the MVP pattern and one of the main reasons that we are going
this route is because we are doing Scrum with 30 day sprints - so we have a
continually morphing design. We are using TDD as well to improve our ability
to refactor... you probably all know this approach.

Although the user iterface is supposedly one of the last things that you
need to do, this is a web app and we have multiple nested Repeaters on the
page. Within these repeaters we have a textbox in one column that we need to
retrieve contents from. I have been struggling trying to find examples of
something like this as I can't figure out how to expose this to the view
through the interface. Having a single control on the page is easy to use
through the interface. Retrieving the data in the code behind depends on
using Repeater names and FindControls, etc.

The code for that currently looks something like this:

foreach (RepeaterItem pgItem in ProdGroupRepeater.Items)
{
Repeater prodRepeater = (Repeater)pgItem.FindControl("ProductRepeater");
sProdGroup = ((Label)pgItem.FindControl("ProductGroupName")).Te xt;

foreach (RepeaterItem prodItem in prodRepeater.Items)
{
Repeater tierRepeater =
(Repeater)prodItem.FindControl("TiersRepeater");
sProduct = ((Label)prodItem.FindControl("ProductName")).Text;

foreach (RepeaterItem tierItem in tierRepeater.Items)
{

sRecommendedAPY =
((TextBox)tierItem.FindControl("RecommendedAPY")). Text;
sApprovedAPY =
((TextBox)tierItem.FindControl("ApprovedAPY")).Tex t;
sMinBal = ((HiddenField)tierItem.FindControl("MinBal")).Valu e;
RateChangeDTO rcDTO = new RateChangeDTO();
rcDTO.RecommendedAPY = sRecommendedAPY;
rcDTO.ProductGroup = sProdGroup;
rcDTO.ProductName = sProduct;
rcDTO.DistrictID = sDistrictID;
rcDTO.MinBal = sMinBal;

ListOAPYs.Add(rcDTO);
}
}

Is there some way to retrieve the data from these textboxes in the MVP
pattern? I searched for a couple days and coudn't find any examples similar
enough that I could apply.

If this isn't enough info to help, I could put together a simple example
that uses these same concepts. Maybe I'm totally off base here - like I said,
I'm completely new to all of this.

thanks!!
Bill
Nov 5 '06 #6
Hey Peter,

Thanks - I've seen some of Jeremy's articles, but not this one. My other
fav's are Jean-Paul Boodhoo and Billy McCafferty.

Now, if there was just a great into book on Rhinomocks!

regards,
Bill
"Peter Bromberg [C# MVP]" wrote:
Jeremy Miller has a post that addresses part of this issue with MVP:
http://codebetter.com/blogs/jeremy.m...01/137457.aspx

Hope that helps.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Bill44077" wrote:
Hi,

I am new to the MVP pattern and one of the main reasons that we are going
this route is because we are doing Scrum with 30 day sprints - so we have a
continually morphing design. We are using TDD as well to improve our ability
to refactor... you probably all know this approach.

Although the user iterface is supposedly one of the last things that you
need to do, this is a web app and we have multiple nested Repeaters on the
page. Within these repeaters we have a textbox in one column that we need to
retrieve contents from. I have been struggling trying to find examples of
something like this as I can't figure out how to expose this to the view
through the interface. Having a single control on the page is easy to use
through the interface. Retrieving the data in the code behind depends on
using Repeater names and FindControls, etc.

The code for that currently looks something like this:

foreach (RepeaterItem pgItem in ProdGroupRepeater.Items)
{
Repeater prodRepeater = (Repeater)pgItem.FindControl("ProductRepeater");
sProdGroup = ((Label)pgItem.FindControl("ProductGroupName")).Te xt;

foreach (RepeaterItem prodItem in prodRepeater.Items)
{
Repeater tierRepeater =
(Repeater)prodItem.FindControl("TiersRepeater");
sProduct = ((Label)prodItem.FindControl("ProductName")).Text;

foreach (RepeaterItem tierItem in tierRepeater.Items)
{

sRecommendedAPY =
((TextBox)tierItem.FindControl("RecommendedAPY")). Text;
sApprovedAPY =
((TextBox)tierItem.FindControl("ApprovedAPY")).Tex t;
sMinBal = ((HiddenField)tierItem.FindControl("MinBal")).Valu e;
RateChangeDTO rcDTO = new RateChangeDTO();
rcDTO.RecommendedAPY = sRecommendedAPY;
rcDTO.ProductGroup = sProdGroup;
rcDTO.ProductName = sProduct;
rcDTO.DistrictID = sDistrictID;
rcDTO.MinBal = sMinBal;

ListOAPYs.Add(rcDTO);
}
}

Is there some way to retrieve the data from these textboxes in the MVP
pattern? I searched for a couple days and coudn't find any examples similar
enough that I could apply.

If this isn't enough info to help, I could put together a simple example
that uses these same concepts. Maybe I'm totally off base here - like I said,
I'm completely new to all of this.

thanks!!
Bill
Nov 5 '06 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: lawrence | last post by:
When users enter urls or other long strings it can destroy the formatting of a page. A long url, posted in a comment, can cause page distortions that make the page unreadable, till the website...
4
by: Nicolla MacPherson | last post by:
Hi I'm a newbie and want to display a pattern that will increment with each line of display. I thought i might be able to count the rows and use that info to increment my display. I've got my...
3
by: Matthet | last post by:
Hello I've got simpleType restricted by pattern one element uses this simpleType and I would like another element to use this SimpleType but with one extra pattern. How to do it?
2
by: Sathyaish | last post by:
How does a constructor of one class call another of the same class? When would this mechanism make sense or be required? PS: Two instances I saw are: (a) While using the Singleton pattern...
8
by: Paul Cochrane | last post by:
Hi all, I've got an application that I'm writing that autogenerates python code which I then execute with exec(). I know that this is not the best way to run things, and I'm not 100% sure as to...
3
by: jason | last post by:
is there a way to set up an array of bits of generic size, cycle through all the possible bit patterns, and detect a sub-pattern within the bit pattern? for cycling through possible patterns: i...
4
by: jaYPee | last post by:
I know how to open a form from another form. Say open form2 from form1 using a command button. But my problem is everytime I clicked the button it open again another instance of that form. ...
3
by: gsb58 | last post by:
Hi! A mainform is being used to show records from a table in an sql database. A button on the main form will load a new form that allows the user to add, delete, update and search certain...
3
by: =?Utf-8?B?bWFnZ2ll?= | last post by:
hi, I've been working getting a file parsed out using Regex. There's something I don't understand. When I define the pattern for my fields in my file, I am telling regex to grab those fields (...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.