Buy My Account


Basics
Overview
Video Demos
Pricing & Ordering
Sample Applications
Customers
Free Training
What's New in V10.0
Download Now!

Product Tour
Product Tour
Web Applications
Mobile Applications
SharePoint Applications
Charts and Reports
Security
Architecture & Code
Team Development

Technical Materials
Training Courses
Online Help
Technical Forums
White Papers
One Day Web Apps E-book
System Requirements
Product Roadmap
Version History
Iron Speed Technical Forums

Register New Posts Chat
 
 
 


Reply
 
Author Comment
 
mjgardne

Registered: 01/22/07
Posts: 120
Reply with quote #1 
Hello,

In the mobile version of one of our pages, I have create an accordian and it is working great.  However, all examples for creating an accordian always use embedded static text for the text that is displayed to the user.  I need to pull the text from resources and display that value, from the code behind, to the user for each of the labels in an accordian.  Here is one accordianpane that display's "Contact".  What do I have to replace "Contact" with in order to be able to change what is displayed at runtime?

Thank you for your help and suggestions!

Mike


  <asp:accordionpane id="ContactAccordionPane" runat="server">
   <header>
    <br /><table border="0" cellpadding="0" cellspacing="0" style="width: 100%;"><tr><td class="mobileAccordionHeader"><span class="mobileAccordionHeaderTitle">&nbsp;&nbsp;Contact</span></td></tr></table>
   </header>
   <content>
  <GENANEL NAME="ContactPanel" />
   </content>
  </asp:accordionpane>
miles

Avatar / Picture

MVP Consultant
Registered: 10/15/03
Posts: 3,218
Reply with quote #2 
Use FindControlRecursively to find the control, and update accordingly. You could probably put this in the PreRender event.

HTH,

__________________
Miles Gibson, I.S.P., ITCP
Iron Speed MVP
Senior Consultant, Principal,
Milestone Software
http://www.ironspeedmvp.com
Email: miles@milestone.ca
Coming Soon: Full Localization for your Iron Speed Applications!
mjgardne

Registered: 01/22/07
Posts: 120
Reply with quote #3 
Hi Miles,

Thank you for your response.

The issue is that the name that is displayed for the AccordianPane is not a part of the control.  It is in some HTML code in the AccordianPane where text is displayed.  My thought was that I could replace "Contact" with an aspx control like "Literal" and then use FindControlRecursively, but when I tried it, I always received a null.  This is why I was asking how others are dealing with it.  I'm going to work on this issue more today and will report my solution (hopefully).

Thanks,

Mike 
mjgardne

Registered: 01/22/07
Posts: 120
Reply with quote #4 

Hmmm... That was simple enough...  I replaced "Contact" with an ASPX Literal.  In the code behind, I did a FindControlRecursively(), and set its value.  For some reason, when I tried it last night, I kept getting null, but today it is working.  Most likely, fatigue was my enemy last night!  Anyway, here is an example that may help others...

// ACCORDIAN CELL IN ISD
  <asp:accordionpane id="ContactAccordionPane" runat="server">
   <header>
    <br /><table border="0" cellpadding="0" cellspacing="0" style="width: 100%;">
    <tr>
    <td class="mobileAccordionHeader"><span class="mobileAccordionHeaderTitle">&nbsp;&nbsp;<asp:literal id="AccordianContactLiteral" runat="server"></asp:literal></span>
</td></tr></table>
   </header>
   <content>
  <GENANEL NAME="ContactPanel" />
   </content>
  </asp:accordionpane>

 

// CODE BEHIND
Literal literal =
    BaseClasses.Utils.MiscUtils.FindControlRecursively(this, "AccordianContactLiteral") as Literal;
if literal != null)
{
    literal.Text = GetResourceValue("Aboh_Txt_NotifyByEmail", "XXXAppName");
   
}
else
{
    // Failed to find the literal control.
    throw new NullReferenceException("");
}



 

// CODE BEHIND

 

 

Previous Topic | Next Topic
Print
Reply

Quick Navigation:

Download Iron Speed Designer
  Support   Company Info  
 

Privacy Statement
Powered by Website Toolbox - Create a Website Forum Hosting, Guestbook Hosting, or Website Chat Room for your website.