Method Question?

Tech-Archive recommends: Fix windows errors by optimizing your registry



I have the following situation.

I am creating my own user control.
This asp.net user control will have a method called "Read". When this
method is being called from the page. It will read line by line threw a
list dictionary. While reading line by line
it will be setting public properties that my page can access. So my user
control will look like this.

Usercontrol.ascx

public class clsUserControl
{
private string strMyPropertyValue;

public bool Read()
{
foreach(ListDictionary MyListRow in MyListDictionary)
{
strMyPropertyValue = (string)MyListRow.Value;
}
}

public string MyReturnedValue
{
set
{
MyReturnedValue = strMyPropertyValue;
}
}
}

Now, my webpage called webpage.aspx.
Will do the following.

public class clsMyWebPage
{
//This will reference my usercontrol on the webpage.
protected clsUserControl MyUserControl;

private void DoSomething()
{
string strGetValue;
while(MyUserControl.Read())
{
strGetValue = MyUserControl.MyReturnedValue;
}
}
}

My question is this. How do I get my ".Read" method to loop through each
row setting the public property for each new value it retrieves
from the ListDictionary? Also, meanwhile setting the .Read method to
"true" so the calling page while loop will keep looping? I hope this makes
sense.

Thanks,
Mark

.



Relevant Pages

  • Public Method Logic Question?
    ... This asp.net user control will have a method called "Read". ... it will be setting public properties that my page can access. ... public class clsUserControl ... How do I get my ".Read" method to loop through each ...
    (microsoft.public.dotnet.framework.aspnet.webcontrols)
  • Logic Question about Public Method I created.
    ... This asp.net user control will have a method called "Read". ... it will be setting public properties that my page can access. ... public class clsUserControl ... How do I get my ".Read" method to loop through each ...
    (microsoft.public.dotnet.framework.windowsforms)
  • My Method Logic Question
    ... This asp.net user control will have a method called "Read". ... it will be setting public properties that my page can access. ... public class clsUserControl ... How do I get my ".Read" method to loop through each ...
    (microsoft.public.dotnet.general)
  • Re: User control
    ... is expose public properties in your user control, ... Public Class test ... > I'd like to create a user control and modify every ...
    (microsoft.public.dotnet.framework.aspnet)
  • How to create an object of a partial class user control in a seperate public class?
    ... I am upgrading an older site which used ASP .NET 1.1 and VB ... object of a user control for use in a public class. ... objects from user controls which cannot be in the App_Code folder. ... They also have the public class "Policy", as stated before, placed into ...
    (microsoft.public.dotnet.framework.aspnet.webcontrols)