How to refresh dropdown

Jul 3, 2009 at 11:37 AM

I need to refresh my dropdown everytime user select an otion from radio button.

rightnow it shows the year eventhough user doesn't select any year. something like default setting and when user start changing option it should capture the value selected by user.

I am not sure should i use update panel or something else ??

Pl. help

[code]

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

<font size="2">

<%

</font>

 

@ Page Language="C#" AutoEventWireup="true" CodeFile="~/try1.aspx.cs" Inherits="try1" MasterPageFile="~/hits_main.master"

%>

<font size="2" color="#0000ff"><font size="2" color="#0000ff">

<

</font></font>
<font size="2" color="#0000ff">

 

</font>

 

asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat

="server">

 

<font size="2" color="#0000ff"><font size="2" color="#0000ff">

<

</font></font>
<font size="2" color="#0000ff">

 

</font>

 

div

>

<font size="2">

 

</font>

 

<table cellspacing="10" border=".02">

<font size="2">

 

</font>

 

<tr>

<font size="2">

 

</font>

 

<td align="left" >

<font size="2">

 

</font>

 

<asp:RadioButtonList ID="RBl1" runat="server" AutoPostBack="True"

<font size="2">

 

</font>

 

CellPadding="2" CellSpacing="5"

<font size="2">

 

</font>

 

onselectedindexchanged

="RBl1_SelectedIndexChanged">

<font size="2">

 

</font>

 

<asp:ListItem Value="G" Selected="True">Regular Grants</asp:ListItem

>

<font size="2">

 

</font>

 

<asp:ListItem Value ="A">ARRA Grants</asp:ListItem

>

<font size="2">

 

</font>

 

<asp:ListItem Value ="C">Contract</asp:ListItem

>

<font size="2">

 

</font>

 

</asp:RadioButtonList>

 

<font size="2">

 

</font>

 

</td

>

 

<font size="2">

 

</font>

 

<td

>

<font size="2">

 

</font>

 

<asp:ObjectDataSource ID="Srcfmyr" runat="server"

<font size="2">

 

</font>

 

OldValuesParameterFormatString="original_{0}" SelectMethod="GetData"

<font size="2">

 

</font>

 

TypeName="HITS.App_code.stateTableAdapters.SOURCE_YEAR_VWTableAdapter">

<font size="2">

 

</font>

 

<SelectParameters

>

<font size="2">

 

</font>

 

<asp:ControlParameter ControlID="RBl1" Name="myType"

<font size="2">

 

</font>

 

PropertyName="SelectedValue" Type="String" DefaultValue="G"

/>

<font size="2">

 

</font>

 

</SelectParameters

>

<font size="2">

 

</font>

 

</asp:ObjectDataSource

>

<font size="2">

From:

</font>

 

<asp:DropDownList ID="ddlyr" runat="server" AutoPostBack="True"

<font size="2">

 

</font>

 

DataSourceID="Srcfmyr" DataTextField="SOURCE_YEAR"

<font size="2">

 

</font>

 

DataValueField="SOURCE_YEAR" Font-Underline="False"

<font size="2">

 

</font>

 

onselectedindexchanged="ddlyr_SelectedIndexChanged" >

<font size="2">

 

</font>

 

</asp:DropDownList>&nbsp; &nbsp; &nbsp;

<font size="2">

 

</font>

 

<asp:Label ID="mesg" runat="server" Text="" ForeColor="Red"></asp:Label

>

<font size="2">

 

</font>

 

<asp:ObjectDataSource ID="SrcToyr" runat="server"

<font size="2">

 

</font>

 

OldValuesParameterFormatString="original_{0}" SelectMethod="GetData"

<font size="2">

 

</font>

 

TypeName

="HITS.App_code.stateTableAdapters.SOURCE_YEAR_VWTableAdapter">

<font size="2">

 

</font>

 

<SelectParameters

>

<font size="2">

 

</font>

 

<asp:ControlParameter ControlID="RBl1" DefaultValue="G" Name="myType"

<font size="2">

 

</font>

 

PropertyName="SelectedValue" Type="String"

/>

<font size="2">

 

</font>

 

</SelectParameters

>

<font size="2">

 

</font>

 

</asp:ObjectDataSource

>

<font size="2">

 

</font>

 

<asp:Label ID="lblTo" runat ="server" Text="To:"></asp:Label

>

<font size="2">

 

</font>

 

<asp:DropDownList ID="ddlTo" runat="server"

<font size="2">

 

</font>

 

AutoPostBack="True" DataSourceID="Srcfmyr" DataTextField="SOURCE_YEAR"

<font size="2">

 

</font>

 

DataValueField="SOURCE_YEAR" Font-Underline="False" OnSelectedIndexChanged="ddlTo_Clicked"

>

 

<font size="2">

 

</font>

 

</asp:DropDownList

>

 

<font size="2">

 

</font>

 

</td

>

<font size="2">

 

</font>

 

</tr

>

<font size="2">

 

</font>

 

<tr>

[/code]