I am trying to make sure I understand all the code .... How does this code specifically operate?
string[] webs = web.Webs.Names;
if (webs != null && Array.IndexOf(webs, childName) >= 0)
{childWeb=site.Webs[childName]; Response.Redirect(siteUrl);
}
I see that the "webs" variable is not null so the first part of this conditional statement returns true. How exactly does the second part of this statement operate? As shown in the screenshot, we can see the "webs" has a total of 9 items (because it is zero-based), but how is the "childName" evaluated?
Does the code check all 9 webs and evaluate them in a single step against the "childName" variable?
If that is the case, it would make more sense to me. Would it then take the "childName" and validate it against the existing "webs"? If it found a match then it would make the statement "true" as 1 >= 0 is true so it executes the code, right?
thanks
No comments:
Post a Comment