Saturday, March 24, 2012

Wizard and text/xml-script question

I am using a wizard control.

At the bottom of the page I have this:

<script type="text/xml-script">
<page xmlns:script="http://schemas.microsoft.com/xml-script/2005">
<components>
<control id="divSample" visibilityMode="Collapse"/>
</components>
</page>
</script>

I get an error saying that divSample does not exist - but there is a div named divSample on this page.

Can you provide the complete repro?

It's sensitive data - so I created a mock up of what is occurring:

Note - because the control is on 'step 2' it doesn't see the control.

<

asp:ContentID="Content1"ContentPlaceHolderID="ContentPlaceHolder1"Runat="Server"><atlas:ScriptManagerID="ScriptManager1"runat="server"EnablePartialRendering="True"></atlas:ScriptManager><asp:WizardID="Wizard1"runat="server"ActiveStepIndex="0"><WizardSteps><asp:WizardSteprunat="server"Title="Step 1"> Welcome, click next to continue...</asp:WizardStep><asp:WizardSteprunat="server"Title="Step 2"><inputid="Text1"type="text"/><inputid="Button1"type="button"value="button"/></asp:WizardStep></WizardSteps></asp:Wizard><scripttype="text/javascript">function pageLoad()

{

$(

'Text1').control.set_visible(false);

}

function Button1_Click()

{

$(

'Text1').control.set_visible(true);

$(

'Text1').control.set_text('Hello World');

}

</script><scripttype="text/xml-script">

<page xmlns:script=

"http://schemas.microsoft.com/xml-script/2005">

<components>

<textBox id=

"Text1" />

<checkBox id=

"Button1" click="Button1_Click"/>

</components>

</page>

</script>

</

asp:Content>

Bumping for a follow up please.

Thank you


checking back in - thank you

Good day.

Checking back - any clues? Is this a bug?

I'd greatly appreciate some response - using xml-script in a wizard seems to be a senario that would be common?

I'll keep checking back everyday :)


I haven't played with this but I'll bet if you look closely at the generated HTML you'll see that the wizard doesn't generate HTML for Step 2 when you're on Step 1. The XML Script doesn't know that, so it goes looking for TextBox1 which, isn't there.

As far as how to deal with this...

What happens if you move the XMLScript inside of the Wizard two step?

What happens if you move the step contents into a UserControl?

The toolkit may be able to help you here since you can locate your extenders (they generate XML script) in the same naming scope as the extendee.


I will give that a try and report back - I appreciate the response.

It worked moving the xml-script to the wizard step.

Thanks for thinking outside of the box for me :)

No comments:

Post a Comment