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

javascript in usercontrol is not recognizing

3 Answers 108 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Priya
Top achievements
Rank 1
Priya asked on 13 Aug 2008, 07:42 AM
Sir
I wrote some javascript fns in usercontrol.In aspx page I added radajaxmanager and this usercontrol.then the javascript fn is not recognizing.When i remove the radajaxmanager,its working.The radajaxmanager in my page is necessary too..
Any way to solve this prbm
Plz help me..
thanks

3 Answers, 1 is accepted

Sort by
0
Maria Ilieva
Telerik team
answered on 13 Aug 2008, 08:31 AM
Hello Priya,

Please wrap the script into RadScriptBlock control and verify if the scripts will be properly registered.
RadScriptBlock is used where you have JavaScript that evaluates after an AJAX request.RadScriptBlock wraps JavaScript where the JavaScript is located in an updating area.

Test this approach and let us know if this helps.


Best wishes,
Maria Ilieva
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Priya
Top achievements
Rank 1
answered on 13 Aug 2008, 09:19 AM
Sir
it is within the RadScriptBlock itself and  was working.

The problem is,

When I added telerik:RadAjaxManager,it is not working

plz help
Thanks

0
Priya
Top achievements
Rank 1
answered on 13 Aug 2008, 09:26 AM
Sir

the ascx code is


<

telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">

<script type="text/javascript" language="javascript">

function SetTextColor (colorPicker, eventArgs)

{

var textContainer = $get("textContent");

textContainer.style.color = (eventArgs.get_color) ? eventArgs.get_color() : colorPicker.get_selectedColor();

}

function SetBckgColor (colorPicker, eventArgs)

{

var textContainer = $get("textContent");

textContainer.style.backgroundColor = (eventArgs.get_color) ? eventArgs.get_color() : colorPicker.get_selectedColor();

}

</script>

</telerik:RadScriptBlock> 

<tr><td style="height: 34px">

Text color:<telerik:RadColorPicker runat="server" ID="RadColorPickerForecolor" OnClientColorChange="SetTextColor"

OnClientColorSelecting="SetTextColor" ShowIcon="true" Preset="Standard" ShowEmptyColor="false"

SelectedColor="#000000" />

</td></tr>

<tr><td style="height: 41px">

Background color:<telerik:RadColorPicker runat="server" ID="RadColorPickerBackcolor" OnClientColorChange="SetBckgColor" Preset="Standard"

OnClientColorSelecting="SetBckgColor" ShowIcon="true" ShowEmptyColor="false" SelectedColor="#FFFFFF"> </telerik:RadColorPicker>

</td></tr>


in aspx page
<%@ Register TagPrefix="uc1" TagName="UserNotes" Src="UserNotes.ascx" %>

<

telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">

<AjaxSettings>

<telerik:AjaxSetting AjaxControlID="lnkAll">

<UpdatedControls>

<telerik:AjaxUpdatedControl ControlID="WorkDetailsGrid" LoadingPanelID="LoadingPanel1" />

</UpdatedControls>

</telerik:AjaxSetting>
</AjaxSettings>

</telerik:RadAjaxManager>

<

telerik:RadGrid ID="WorkDetailsGrid" runat="server" AllowPaging="True" AllowSorting="True"

GridLines="Vertical" Skin="Vista" AutoGenerateColumns="False" CssClass="gridnew">

-----

----

<uc1:UserNotes ID="ucUsernotes" runat="server" Visible="false" />

</

telerik:RadGrid>

Thanks

Tags
General Discussions
Asked by
Priya
Top achievements
Rank 1
Answers by
Maria Ilieva
Telerik team
Priya
Top achievements
Rank 1
Share this question
or