Dropdown Selected Value isnt getting selected . its alwz shows the first value in selection
<p>hii..</p>

<p>i am really facing a peculiar problem .. which i m not sure why its happening . </p>

<p>i have two dropdowlists ddprojecttype and ddprojectname . on selecting project type i m populating projectnames into ddprojectname with jquery ajax . and its showing properly only . how ever whenever i am trying to make a selection on the dropdownlist it alwz and alwz selects the first item . and also its behaviour is peculiar . while i am viewing the aspx page in the browser then its showing all the project names into the dropdown. whereas in case of vieweing the source its not showing the dropdown options at all . would post the page code as well as the html for that and d jquery scripts for them </p>

<pre><code> &lt;asp:DropDownList ID="ddProjectTypeID" runat="server" &gt;
                    &lt;/asp:DropDownList&gt;
&lt;asp:DropDownList ID="ddProjectName" runat="server"  &gt;
                    &lt;/asp:DropDownList&gt;
</code></pre>

<p>the jquery for the scripts which loads the project names successfully is : </p>

<pre><code>$('[id*="ddProjectTypeID"]').change(function() {
    if ($(this).find(":selected").text() != "--Select--") {
        $.ajax({
            type: 'POST',
            contentType: "application/json; charset=utf-8",
            url: 'Services/Service.asmx/GetProjectNames',
            data: '{"p_type_id":"' + $(this).find(":selected").val() + '"}',
            dataType: "json",
            success: function(data, textStatus) {
                if (textStatus == "success") {
                    var myObject = data.d;
                    $('[id*="ddProjectName"] &gt;option').remove();
                    $('[id*="ddProjectName"]').append($('&lt;option&gt;&lt;/option&gt;').val("--Select--").html("--Select--"));
                    for (var i = 0; i &lt;= myObject.length - 1; i++) {
                        $('[id*="ddProjectName"]').append($('&lt;option&gt;&lt;/option&gt;').val(myObject[i].project_id)
                                        .html(myObject[i].project_name));
                    }
                }
            },
            error: function(data, textStatus) {
                alert('An error has occured retrieving data!');
            }
        });
    }
});
</code></pre>

<p>it loads the names successfully onto the ddprojectnames dropdownlist : </p>

<p>curiously whenever i am executing this code : </p>

<pre><code>protected void btnSubmit_Click(object sender, EventArgs e)
    {
    ScheduleDetails scdetails = new ScheduleDetails();
    scdetails.ProjectTypeID = ddProjectTypeID.SelectedItem.Value;
            scdetails.ProjectID = ddProjectName.SelectedItem.Value;


}
</code></pre>

<p>it only gets scdetails.ProjectTypeID = 1 but 
scdetails.ProjectID = "--Select--" </p>

<p>not getting the reason why . although i have loaded the projectnames from the cascading dropdown from projecttypeID even then also it gets "--select--" as result whenever irrespective i chose any value from ddprojectname ...</p>

<p>can anyone have any clue why its happening ? </p>
