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

The validations in User Control is not getting fired from aspx page

1 Answer 34 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Saravanan
Top achievements
Rank 1
Saravanan asked on 26 Mar 2010, 02:07 PM

RADCombobox is used in user control.

 

 

<telerik:RadComboBox ID="ddlCustomerName"

 

 

runat="server"

 

 

Width ="300px"

 

 

AllowCustomText="false"

 

 

HighlightTemplatedItems="true"

 

 

OnClientSelectedIndexChanging="PopulateContract"

 

 

 

 

 

 

EnableLoadOnDemand="true"

 

 

OnItemsRequested="ddlCustomerName_ItemsRequested"

 

 

MarkFirstMatch="true"

 

 

 

 

 

AutoPostback="true">

 

 

 

 

 

</telerik:RadComboBox>

 

 

 

This user control is registered in an aspx page.

 

<%

@ Register TagPrefix="uc"

 

 

TagName="TestFooter"

 

 

Src="~/UserControl/ParameterSetFooterGrid.ascx" %>

 

 

The Radcombobox in the user control is a mandatory field. The user should be alerted with message "Please enter xxx to proceed further" but this is not getting fired.

 

function

 

fn_Validation(Customer)

 

{

 

 

if(document.getElementById(Customer).selectedIndex==0)

 

{

alert(

'Please select a Customer Name to proceed further')

 

document.getElementById(Customer).focus();

 

return false;

 

}

}

This function is called on button click as

 

btnSubmit.Attributes.Add(

"onClick", "return fn_Validation('" & TH1.Customer.ClientID &  "' );")

 

 

This event is not getting fired.

1 Answer, 1 is accepted

Sort by
0
Iana Tsolova
Telerik team
answered on 31 Mar 2010, 03:05 PM
Hi Raghuraman,

Could you please specify where is the javascript declared, in the page or in the user control?
And is the user control statically defined or loaded dynamically?

Kind regards,
Iana
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Grid
Asked by
Saravanan
Top achievements
Rank 1
Answers by
Iana Tsolova
Telerik team
Share this question
or