Click here to Skip to main content
15,887,214 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi ,

I got the following error Line 56: document.getElementByIdcboReligion.SelectedItem.ClientID%>").value = "Hindu"; i got this error plz give me any advise .

Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: CS1061: 'System.Web.UI.WebControls.ListItem' does not contain a definition for 'ClientID' and no extension method 'ClientID' accepting a first argument of type 'System.Web.UI.WebControls.ListItem' could be found (are you missing a using directive or an assembly reference?)

Source Error:

Line 54: document.getElementById("<%=txtCountry.ClientID%>").value = "India";
Line 55: document.getElementById("<%=txtAddress.ClientID%>").value = "Hyd";
Line 56: document.getElementById(cboReligion.SelectedItem.ClientID%>").value = "Hindu";
Line 57:
Line 58:



&lt;form id="myform" action="" method="post">


&lt;script type="text/javascript">
function myload(myform) {


try {


document.getElementById("<%=txtPatientName.ClientID%>").value = "sifu123";
document.getElementById("<%=ucRegNo.RegNoTextBox.ClientID%>").value = "12";
document.getElementById("<%=txtState.ClientID%>").value = "AP";
document.getElementById("<%=txtPhone.ClientID%>").value = "08674242301";
document.getElementById("<%=txtCountry.ClientID%>").value = "India";
document.getElementById("<%=txtAddress.ClientID%>").value = "Hyd";
document.getElementById("<%= cboReligion.SelectedItem.ClientID%>").value = "Hindu";



}
catch (e) {
alert(e.message);
}


</script>
</form>
Posted
Updated 25-Mar-12 20:57pm
v3
Comments
Uday P.Singh 26-Mar-12 2:00am    
not clear, need more information

1 solution

There is no such document object member: document.getElementByIdcboReligion. :-)

—SA
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900