This is a migrated thread and some comments may be shown as answers.

Add new attribute to ajaxmanager And get it ...

3 Answers 64 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
peyman naji
Top achievements
Rank 1
peyman naji asked on 04 Dec 2009, 12:36 PM
hi friends .,

i need to add new attribute to ajax manager ,  i used this code in behind code :
RadAjaxManager1.Attributes.Add("AjaxMode""BlackScreen"); 

Also i used OnRequestStart  clinetside event in java script ... i want when request start , get value of attribute (AjaxMode) of control that make request . how can i do it with java script ? 

thank u very much ,

Regards,
Peyman

3 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 04 Dec 2009, 02:55 PM
Hi Peyman,

I believe you cannot access the custom attributes from client side, which is added from code. Probably you can use one HiddenField to store the value and access the value in the client event instead of setting attribute for the control.

- setting value from code behind:
       HiddenField1.Value = "BlackScreen";

- access value from client side:
      document.getElementById("HiddenField1").value

Hope this helps,
Shinu.
0
peyman naji
Top achievements
Rank 1
answered on 05 Dec 2009, 08:23 AM
Hi Shinu , Thank u so much for Guide ...

Also i use this code for getting Attribute from Control that fire OnRequestStart Event :
    if(eventArgs.get_eventTargetElement().getAttribute('AjaxMode') == 'BlackScreen'
            {  
                GrayBackGroundFadeIn(); 
            } 
        else 
            { 
                SimpleAjaxLoaderFadeIn(); 
            } 
        } 

this code work good for other control , by example : RadCombo  , Button , ...   but does not work with ajaxmanager , and always i have null value in  this code ...
eventArgs.get_eventTargetElement().getAttribute('AjaxMode'

Where is the problem ?!!!


thank u so much

Regards ,
Peyman
0
peyman naji
Top achievements
Rank 1
answered on 13 Dec 2009, 06:50 AM
Friends ! Plz Guide me .

Thanks .

Tags
Ajax
Asked by
peyman naji
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
peyman naji
Top achievements
Rank 1
Share this question
or