|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Public Method Logic Question?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 look into indexers
Show quoteHide quote "SouthSpawn" <southsp***@aol.com> wrote in message news:1f2f473cad2bf0287232525750debab8@localhost.talkaboutsoftware.com... >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 >
IE Web Controls - discontinued ???
custom validator and button events Re: At which life cycle should EnsureChildControls() be called? Dynamically resize a DropDownList in a grid when dropped down How to call javascript when click update command(it Edit command c Cant Render Page Control with Visual Studio 2005 Beta Urgent User COntrol set dropdownlist value in datalist Custom Templated Control not rendering asp.net controls correctly Enter Key form with many UserControls |
|||||||||||||||||||||||