Wednesday, March 21, 2012

modalpopup

hii need to use a modalpopup to add an item to my dropdownlist.my dropdownliste extract the itmes from an oracle database.

the client click on a botton to add the new item in the database and i want that the ddl refreshe.

can u help me plez.

1<asp:Panel runat="server" id="pnl_add">2 <asp:TextBox runat="server" id="txt_name" />3 <asp:RequiredFieldValidator runat="server" id="rfv_name"4 ControlToValidate="txt_name"5 ToolTip="Please enter a name"6 ErrorMessage=" *" />7 <asp:Button runat="server" id="btn_ok"8 Text="Ok" />9 <asp:Button runat="server" id="btn_cancel"10 Text="Cancel" />11</asp:Panel>12<ajaxToolkit:ModalPopupExtender runat="server" id="mpe_add"13 TargetControl="btn_add"14 PopupControlID="pnl_add"15 CancelControlID="btn_Cancel" />1617<asp:UpdatePanel runat="server" id="up_items"18 RenderMode="block"19 UpdateMode="conditional">20 <Triggers>21 <asp:AsyncPostBackTrigger22 ControlID="btn_Ok"23 EventName="Click" />24 </Triggers>25 <ContentTemplate>26 <asp:DropDownList runat="server" id="ddl_items" />27 </ContentTemplate>28</asp:UpdatePanel>
1Protected Sub btn_Ok_Click(sender asObject, e as EventArgs) handles btn_Ok.Click2'insert into database34 up_items.Update()5End Sub

No comments:

Post a Comment