Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi
I have some child node, like:
parent
--child1
--child2
--child3
etc
So how can i apply loop in .net user control for get child node.
Touhid
Hi Touhid
In your codebehind for the user control you need to write some C# to do it.
Here is some information about foreach loops in C# http://msdn.microsoft.com/en-us/library/ttw7t8t6%28v=vs.71%29.aspx and http://dotnetperls.com/foreach
With the above in combination with the API stuff you can see on the wiki pages in here I think you have a good starting point.
Happy coding
/Jan
Also have a look at the ASP Repeater control: http://articles.sitepoint.com/article/asp-net-repeater-control
Thnks for reply and i have done it following this way :
umbraco.presentation.nodeFactory.Node node = new umbraco.presentation.nodeFactory.Node(1243);umbraco.presentation.nodeFactory.Nodes childrenNodes = node.Children; foreach (Node doc in childrenNodes){MomentumLabel.Text = doc.GetProperty("vesselName").Value;momentumPositionTextBox.Text = doc.GetProperty("position").Value;momentumDateTextBox.Text = doc.GetProperty("date").Value;momentumDirTextBox.Text = doc.GetProperty("dir").Value;}
umbraco.presentation.nodeFactory.
Node node = new umbraco.presentation.nodeFactory.Node(1243);
Nodes childrenNodes = node.Children;
foreach (Node doc in childrenNodes)
{
MomentumLabel.Text = doc.GetProperty(
"vesselName").Value;
momentumPositionTextBox.Text = doc.GetProperty(
"position").Value;
momentumDateTextBox.Text = doc.GetProperty(
"date").Value;
momentumDirTextBox.Text = doc.GetProperty(
"dir").Value;
}
I have an another problem when i was used gridview:
umbraco.presentation.nodeFactory.Node node = new umbraco.presentation.nodeFactory.Node(1243);umbraco.presentation.nodeFactory.Nodes childrenNodes = node.Children; foreach (Node doc in childrenNodes){ GridView gvRow = new GridView(); foreach (GridViewRow row in childrenNodes){row.Cells[0].Text = doc.GetProperty("vesselName").Value;row.Cells[1].Text = doc.GetProperty("position").Value;row.Cells[2].Text = doc.GetProperty("date").Value;row.Cells[3].Text = doc.GetProperty("dir").Value;} }
GridView gvRow = new GridView();
foreach (GridViewRow row in childrenNodes)
row.Cells[0].Text = doc.GetProperty(
row.Cells[1].Text = doc.GetProperty(
row.Cells[2].Text = doc.GetProperty(
row.Cells[3].Text = doc.GetProperty(
Errror:Unable to cast object of type 'umbraco.presentation.nodeFactory.Node' to type 'System.Web.UI.WebControls.GridViewRow'.
Where is my problem? i cant understood it.
Pls help me.
This is impossible ;-)
So How can i solve it?
pls help me.
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
for each loop in .net user control
Hi
I have some child node, like:
parent
--child1
--child2
--child3
etc
So how can i apply loop in .net user control for get child node.
Touhid
Hi Touhid
In your codebehind for the user control you need to write some C# to do it.
Here is some information about foreach loops in C# http://msdn.microsoft.com/en-us/library/ttw7t8t6%28v=vs.71%29.aspx and http://dotnetperls.com/foreach
With the above in combination with the API stuff you can see on the wiki pages in here I think you have a good starting point.
Happy coding
/Jan
Also have a look at the ASP Repeater control: http://articles.sitepoint.com/article/asp-net-repeater-control
Hi
Thnks for reply and i have done it following this way :
Touhid
Hi
I have an another problem when i was used gridview:
Where is my problem? i cant understood it.
Pls help me.
Touhid
This is impossible ;-)
So How can i solve it?
pls help me.
is working on a reply...