Showing posts with label words. Show all posts
Showing posts with label words. Show all posts

Wednesday, March 28, 2012

Accordian - How to refer to contained controls in code behind?

Hi,

If i put regular asp.net controls into an accordian pane they are not visible in the code behind file. In other words i cant get mydropdown.selectedvalue if mydropdown is contained in an accordian pane because the compiler will complain that mydropdown doesn't exist? My work around has been to put content into user controls and put the ascx's into the content panes but is this standard practise?

Thanks

Richard

Hi Richard,

Since the AccordionPanes can be databound, they implement theINamingContainer interface and you're unable to access them directly in your code behind. You can work around this withDropDownList list = MyAccordion.FindControl("MyDropDown") as DropDownList;.

Thanks,
Ted

Saturday, March 24, 2012

Accentuation problem

I've an UpdatePanel that has textbox and dropdownlist inside it.
In the textbox I put words with accent, for example: á é í, and the dropdownlist has a AutoPostback = True.
When the SelectedIndex event happens, these controls are reloades but the words that a put with accent shows wrong, ex: ?? ?? ?-

How I correct this?

How about letting the dropdownlist have its own updatepanel?

WS


'Cause all the controls are in the same table, will stay complicated to separate the <td> tags to all the dropdownlist that exists.
But I'll try to do this.


I did your suggestion but the problem happens in the grid now.
I put the words in the text box, select all the dropdownlists and click on a button.
This click save the resulto to a DataGrid, when the resuts go to DataGrid, the words are wrong (accent).