Skip to main content
July 8, 2009
Question

asp.Net and Spry

  • July 8, 2009
  • 1 reply
  • 2396 views

I'm working on a project where I'm forced to use asp.net.  I'm currently converting a web application from PHP over to .Net and running into issues when I try to preserve my use of spry

For example, My option boxes here can be populated here by an external .XML source.  It works wonderful.

<div spry:region="ds4">

<select name="issuez" id="issuez" spry:repeatchildren="ds4" onchange="ds4.setCurrentRowNumber(this.selectedIndex);" onclick="hpload();">

    <option spry:if="{ds_RowNumber} == {ds_CurrentRowNumber}" value="{data}" selected="selected">{ID}</option>
    <option spry:if="{ds_RowNumber} != {ds_CurrentRowNumber}" value="{data}">{ID}</option>
</select>

</div>

But in order to send these options as variables in asp.net.  I change my <Select> to <asp:DropDownList>, etc.:

<div spry:region="ds4">

<asp:DropDownList runat="server" name="issuez" id="issuez" spry:repeatchildren="ds4" onchange="ds4.setCurrentRowNumber(this.selectedIndex);" onclick="hpload();">

     <asp:ListItem spry:if="{ds_RowNumber} == {ds_CurrentRowNumber}" value="{data}" selected="selected">{ID}</asp:ListItem>

     <asp:ListItem spry:if="{ds_RowNumber} != {ds_CurrentRowNumber}" value="{data}">{ID}</asp:ListItem>

</asp:DropDownList>

</div> 

This causes the Spry to stop working.   Does anyone know of a work around?

This topic has been closed for replies.

1 reply

_V11
Participating Frequently
July 9, 2009

alloyking wrote:

I'm working on a project where I'm forced to use asp.net.  I'm currently converting a web application from PHP over to .Net and running into issues when I try to preserve my use of spry

For example, My option boxes here can be populated here by an external .XML source.  It works wonderful.

<div spry:region="ds4">

<select name="issuez" id="issuez" spry:repeatchildren="ds4" onchange="ds4.setCurrentRowNumber(this.selectedIndex);" onclick="hpload();">

    <option spry:if="{ds_RowNumber} == {ds_CurrentRowNumber}" value="{data}" selected="selected">{ID}</option>
    <option spry:if="{ds_RowNumber} != {ds_CurrentRowNumber}" value="{data}">{ID}</option>
</select>

</div>

But in order to send these options as variables in asp.net.  I change my <Select> to <asp:DropDownList>, etc.:

<div spry:region="ds4">

<asp:DropDownList runat="server" name="issuez" id="issuez" spry:repeatchildren="ds4" onchange="ds4.setCurrentRowNumber(this.selectedIndex);" onclick="hpload();">

     <asp:ListItem spry:if="{ds_RowNumber} == {ds_CurrentRowNumber}" value="{data}" selected="selected">{ID}</asp:ListItem>

     <asp:ListItem spry:if="{ds_RowNumber} != {ds_CurrentRowNumber}" value="{data}">{ID}</asp:ListItem>

</asp:DropDownList>

</div> 

This causes the Spry to stop working.   Does anyone know of a work around?

Hello,

My asp.net skills are where i want them to be, so I have no clue why it fails, but I think its because asp might delete the foreign spry attributes on the <select>. But what I would suggest is making your page unobstructive.

If you have DW CS4 your can just go to Commands > Externalize JavaScript. Or you would have to do it manually.

Examples of this technique in action: http://labs.adobe.com/technologies/spry/samples/dom_utils/unobtrusive_spry_data.html

Relevant SpryDOMUtils.js information can be found here: http://labs.adobe.com/technologies/spry/articles/element_selector/index.html

(SpryDOMUtils.js is required for this technique and can be found in the Spry download. available on labs.adobe.com)

Hopes this helps,

Arnout Kazemier | Adobe Spry Community Expert | Speaker Adobe MAX 2009

July 15, 2009

Hey Guys - Thank you for your tips.

I have begun using Asp.Net along with Microsofts latest Ajax Toolbox (aka Atlas).

And In some ways it's a real pain to use.

But better than nothing at all!

Alloy

Date: Thu, 9 Jul 2009 07:21:59 -0600

From: forums@adobe.com

To: shultis_tim@hotmail.com

Subject: asp.Net and Spry