not sure what you mean, 'between tags'. Do you mean as innerHTML between a <div> and a </div> ? if so, then the easiest way is to just give your div an id, and roll with it thusly:
<div id='msg'></div>
(in your event handler): $get('msg').innerHTML = // the text you want to display
I think this is what want
<asp:DropDownListID="ddlTest" AutoPostBack="true"OnSelectedIndexChanged="UpdateLabel" runat="server">
<asp:ListItemText="Item 1"Value="Item 1"Selected="true"/>
<asp:ListItemText="Item 2"Value="Item 2"Selected="false"/>
</asp:DropDownList>
<Triggers>
<asp:AsyncPostBackTriggerControlID="ddlTest"EventName="SelectedIndexChanged"/>
</Triggers>
<ContentTemplate>
<asp:LabelID="lblTest"runat="sever"/>
</ContentTemplate>
</asp:UpdatePanel>
C#
protected
void UpdateLabel(object sender,EventArgs e){
this.lblTest.Text =this.ddlTest.SelectedValue;
}
No comments:
Post a Comment