Showing posts with label click. Show all posts
Showing posts with label click. Show all posts

Wednesday, March 28, 2012

change image on accordion click

I have an image on my accordion header.

I want to change that image when somebody expands the header and show the original image when the header is collapsed.

Can somebody help me ?

Take a look at bug8730 and let us know if the fix helps you. You can download the latest non-release version from thesource code tab on the codeplex site.

Change element on click

Hi,

I'm trying to create an AJAX-enabled control thas has the following functionality:

it's a Label that, when clicked, changes into a TextBox. The user can enter some text into the textbox en when he clicks outside the box (onblur) the textbox changes to a label again (now containing the entered text).

For this I created a server control inheriting from Label and a corresponding client control

The question is: can I change the displayed control in the _onClick event of the client control.

It should be something like:

_onClick : function(e){
this.element = $create(TextBox);
},

Does anyone know the right methods for this?

Thanks,

Thomas

Hmmm... I don't know if you can replace a control like that really. In that case, you would have to go to the parent element in the DOM tree, remove the label element and then add the text element. But that's very cumbersome.

What if you create both Label and TextBox and you toggle visibility on the two? Try changing the css attribute "display". Set it to block to show the element and none to hide it. Could help you with code in case you get stuck, just let me know. Good luck!

Monday, March 26, 2012

Center div when using AnimationExtender

 I'm trying to center a div that pops up when I click on a button. It works fine and fades in/out but I need to center it on the screen. Can anyone point me in the right direction. Here is a snippet of my code. 
 <ajaxToolkit:AnimationExtender id="OpenHelp" runat="server" TargetControlID="btnHelp"> <Animations> <OnClick> <Sequence> <StyleAction Attribute="display" Value="" AnimationTarget="divScanHelp" /> <FadeIn AnimationTarget="divScanHelp" Duration=".3"/> </Sequence> </OnClick> </Animations> </ajaxToolkit:AnimationExtender> <ajaxToolkit:AnimationExtender id="CloseHelp" runat="server" TargetControlID="btnClose2"> <Animations> <OnClick> <Sequence> <FadeOut AnimationTarget="divScanHelp" Duration=".3"/> </Sequence> </OnClick> </Animations> </ajaxToolkit:AnimationExtender> <div id="divScanHelp" class="ScannerHelp" style="width: 330px; height: 224px; display: none;"> <table border="0" width="100%" cellpadding="2" cellspacing="1"> <tr><td align="right"><asp:ImageButton ID="btnClose2" runat="server" OnClientClick="return false;" CausesValidation="false" ImageUrl="./graphics/Icon_Close_Small.gif" ToolTip="Close" /></td></tr> <tr><td valign="middle" align="center" style="margin-top: 8px;"><img src="./graphics/scan-label.gif" border="0" width="300" height="194" style="border: 1px solid #c0c0c0;"></td></tr> </table> </div>

Add a Script animation to your OnClick sequence to invoke a javascript function that centers the div.

Use the _layout method of the ModalPopupBehavior class (ModalPopupBehavior.js in the toolkit) as a guide for developing your own center function. If you have relatively-positioned containers in your div's ancestry, look at my other post titled "For those having trouble with relatively-positioned ModalPopupExtenders."

Hope this helps.

Saturday, March 24, 2012

CascadingDropDown send to database

Hello, hi have 3 cascadingdropdown..

Every thibk works fine but when i click in the button to save the form( or another postback) i cant pick the selected values..

For data returned form the database i do:

AtlasControlToolkit.CascadingDropDownProperties propDist = cascDrpDist.GetTargetProperties(DropDownDist);

propDist.SelectedValue = dt.Rows[0].Table.Rows[0].ItemArray[15].ToString();

AtlasControlToolkit.CascadingDropDownProperties propConc = cascDrpDist.GetTargetProperties(DropDownConc);

propConc.SelectedValue = dt.Rows[0].Table.Rows[0].ItemArray[14].ToString();

AtlasControlToolkit.CascadingDropDownProperties propFreg = cascDrpDist.GetTargetProperties(DropDownFreg);

propFreg.SelectedValue = dt.Rows[0].Table.Rows[0].ItemArray[13].ToString();

to save values for the postbacks

hfCDISTRITO.Text = cascDrpDist.TargetProperties[0].SelectedValue;

hfCCONCELHO.Text = cascDrpDist.TargetProperties[1].SelectedValue;

hfCFREGUESIA.Text = cascDrpDist.TargetProperties[2].SelectedValue;

but if im inserting a new data how can i do so pick the selectedvalues?

Thanks

MArcos ALves

but if im inserting a new data how can i do so pick the selectedvalues?

sorry i want to say:

but if im inserting a new data how can i pick the selectedvalues?

Please help!! im trying this about 3 weeks!!!!Tongue Tied[:'(]

Thanks a lot!


I'm afraid I don't understand the scenario. Could you please describe it a little more?

Wednesday, March 21, 2012

CascadingDropDown require EventVlidation=false?

I turned on event validation (=true) of the Atlas Control Toolkit sample -> CascadingDropDown .

When I click the , Error message suggest turn event validation off.

Is this a must?

I saw some thread showing that they can add an attribute "SuppressEventValidation", but I can't see smart tag/ code hints in my version? Is it a new feature in later built of atlas?

Please advice how to keep EventValidated ?

This thread explains why I believe EnableEventValidation needs to be false:http://forums.asp.net/thread/1281139.aspx

Thanks for your kindly reference, It's really a time for me to choose between SECURITY , USABLITILY

I need to sacrifice security , choose usablitiliy

CascadingDropDown persistent Values

Hi,i have 3 dropdownlist, using atlas cascadingdropdown. Every think works fine, but when i click in a button( this button only set the enable=true to all control in the page) occurs an postback, then when the page is load the dropdown loser the previos selected values..

the method to populate the dropdown are in the if(!Ispostback)...how can i fix that??

Try setting the SelectedValue property of the CDDs in the button handler.

hi, thanks for the reply but i have already tryied that and dont work...

bye,

marcos


Please reply with acomplete, self-contained sample page that demonstrates the problem so that we can investigate the specific behavior you're seeing. Thank you!

CascadingDropDown options is null or not an object

I have a couple of dropdown CascadingDropDown and the user is required to select an option from the first and then the second, and then click add. However, if they press add to fast, I get the error "'options' is null or not an object"

It's as if the the second dropdown is not full before the event is posted?!?!? Anyone know how I can prevent this?

Hi Poidda,

Based on my experience, to resolve this kind of issue we should make sure whether the problem is occurred on the client side or on the server side. Based on your description, I think your problem is likely occurred on the server side.

If it is a client issue, we suggest that you should keep the Button to be disabled until the last essential CascadingDropDown is selected. For example:

function pageLoad(){
$find("myCDEState").add_selectionChanged(onCCDSelected)
}
function onCCDSelected(){
//your other javascript code here.

$get("<%=Button.ClientID%>").disabled = false;
}

Otherwise , you should do some checking work on the server side. If it's null, return to the orignal page.

Best regards,

Jonathan