<script type="text/javascript">
function configureDropDownLists(ddl_religion,ddl_caste) {
var Hindu = new Array('Ahom', 'Brahmin-other', 'Intercaste','Kalita','Kayastha','kshatriya','Manipuri','Maratha','Nepali','Rajbonshi','Rajput','SC','ST','Vishwakarma','Other');
var Muslim = new Array('Ansari', 'Arain', 'Awan','Bohra','Dekkani','Dudekula','Jat','Malik','Qureshi','Khoja','Memon','Mughal','Pathan','Mapila','Shafi','Sheikh','Syed','Siddiqui','Other');
var Christian = new Array('Born Again', 'Bretheren', 'Evangelist','Jacobite','Knanaya','Knanaya Catholic','Knanaya Jacobite','Latin Catholic','Malankara','Marthoma','Pendacost','Roman Catholic','Seventh-day Adventist','Sysrian Catholic','Sysrian Jacobite','Sysrian Orthodox','Syro Malabar','Other');
var Sikh=new Array('Ahluwalia','Arora','Bhatia','Bhatra','Ghumar','Intercaste','Jat','Kamboj','Khatri','Lubana','Majabi','Nai','Rajput','Ramdasia','Ramgharia','Ravidasia','Saini','Tonk Kshatriya','Unspecified','Other');
var Jain=new Array('Aggarwal','Bania','Intercaste','Jaiswal','Kvo','Khandewal','Orwal','Porwal','Vaishya','Other');
var Parsi=new Array('Intercaste','Irani','Other','Parsi');
var Buddhist=new Array('Other','Dont Wish to Specify');
var Others=new Array('Other','Dont Wish to Specify');
switch (ddl_religion.value)
{
case 'Hindu':
document.getElementById(ddl_caste).options.length = 0;
for (i = 0; i < Hindu.length; i++)
{
createOption(document.getElementById(ddl_caste), Hindu[i], Hindu[i]);
}
break;
case 'Muslim':
document.getElementById(ddl_caste).options.length = 0;
for (i = 0; i < Muslim.length; i++)
{
createOption(document.getElementById(ddl_caste), Muslim[i], Muslim[i]);
}
break;
case 'Christian':
document.getElementById(ddl_caste).options.length = 0;
for (i = 0; i < Christian.length; i++)
{
createOption(document.getElementById(ddl_caste), Christian[i], Christian[i]);
}
break;
case 'Sikh':
document.getElementById(ddl_caste).options.length = 0;
for (i = 0; i < Sikh.length; i++)
{
createOption(document.getElementById(ddl_caste), Sikh[i], Sikh[i]);
}
break;
case 'Jain':
document.getElementById(ddl_caste).options.length = 0;
for (i = 0; i < Jain.length; i++)
{
createOption(document.getElementById(ddl_caste), Jain[i], Jain[i]);
}
break;
case 'Parsi':
document.getElementById(ddl_caste).options.length = 0;
for (i = 0; i < Parsi.length; i++)
{
createOption(document.getElementById(ddl_caste), Parsi[i], Parsi[i]);
}
break;
case 'Buddhist':
document.getElementById(ddl_caste).options.length = 0;
for (i = 0; i < Buddhist.length; i++)
{
createOption(document.getElementById(ddl_caste), Buddhist[i], Buddhist[i]);
}
break;
case 'Others':
document.getElementById(ddl_caste).options.length = 0;
for (i = 0; i < Others.length; i++)
{
createOption(document.getElementById(ddl_caste), Others[i], Others[i]);
}
break;
default:
document.getElementById(ddl_caste).options.length = 0;
break;
}
}
function createOption(ddl, text, value) {
var opt = document.createElement('option');
opt.value = value;
opt.text = text;
ddl.options.add(opt);
}
</script>
<asp:DropDownList ID="ddl_religion" runat="server" onchange="configureDropDownLists(this,'ddl_caste')">
<asp:ListItem value="Hindu">Hindu</asp:ListItem>
<asp:ListItem value="Muslim">Muslim</asp:ListItem>
<asp:ListItem value="Christian">Christian</asp:ListItem>
<asp:ListItem Value="Sikh">Sikh</asp:ListItem>
<asp:ListItem Value="Jain">Jain</asp:ListItem>
<asp:ListItem Value="Parsi">Parsi</asp:ListItem>
<asp:ListItem Value="Buddhist">Buddhist</asp:ListItem>
<asp:ListItem Value="Others">Others</asp:ListItem>
</asp:DropDownList>
<br />
<br />
<asp:DropDownList ID="ddl_caste" runat="server">
<asp:ListItem>Caste</asp:ListItem>
</asp:DropDownList>
Everything is working fine and i am able to update the second dropdownlist based on the item selected in the first dropdownlist.
The problem is that i am not able to capture the data to a cs file and upload then it to database and i am getting this error
For security purposes, this feature verifies that arguments to postback or callback events originate from the server control that originally rendered them. If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method in order to register the postback or callback data for validation