c# - Modal popup not generating postback to page -


<ajaxtoolkit:modalpopupextender  runat="server"           id="modalpopupextender1"          cancelcontrolid="btncancel" okcontrolid="btnokay"           targetcontrolid="button1" popupcontrolid="panel1"           drag="true"           backgroundcssclass="modalpopupbg"         />  <asp:button id="button1" runat="server" text="test modal popup"      onclick="button1_click" />     <br />  <asp:updatepanel id="up" runat="server">     <contenttemplate>         <asp:button id="button2" runat="server" text="post back"          onclick="button2_click" />         <asp:label id="label1" runat="server" autopostback="true" text="nothing has happened yet..."></asp:label>          <asp:panel id="panel1" runat="server" autopostback="true">             <div class="hellowworldpopup">                 <asp:textbox id="textbox1" runat="server"></asp:textbox>                 <asp:button id="btncancel" runat="server" text="canel"                      onclick="btncancel_click" />                 <asp:button id="btnokay" runat="server" text="okay" onclick="btnokay_click" />             </div>         </asp:panel>      </contenttemplate> </asp:updatepanel> 

so trying label have contents of user typed in textbox inside modal popup. right btnokay not causing work.

.cs file:

protected void btncancel_click(object sender, eventargs e) {     textbox1.text = ""; } protected void btnokay_click(object sender, eventargs e) {     label1.text = textbox1.text;     textbox1.autopostback = true; } protected void button1_click(object sender, eventargs e) {     label1.text = "";     textbox1.text = ""; } protected void button2_click(object sender, eventargs e) {     label1.text = "you clicked button"; } 

i not want page post @ all, update hidden labels on page once information entered. how do this?

edit: alright, should trick think.

<ajax:modalpopupextender runat="server" id="modalpopupextender1" targetcontrolid="button1"     popupcontrolid="panel1" drag="true" backgroundcssclass="modalpopupbg"  /> <asp:button id="button1" runat="server" text="test modal popup" /><br /> <asp:panel id="panel1" runat="server">     <div class="hellowworldpopup">         <asp:textbox id="textbox1" runat="server" />         <asp:button id="btncancel" runat="server" text="canel" onclick="btncancel_click" />         <asp:button id="btnokay" runat="server" text="okay" onclick="btnokay_click" />     </div> </asp:panel>  <asp:updatepanel id="up" runat="server" updatemode="conditional">     <contenttemplate>         <asp:label id="label1" runat="server" text="nothing has happened yet..." />     </contenttemplate> </asp:updatepanel> 

.

protected void btncancel_click(object sender, eventargs e) {     textbox1.text = "";  }  protected void btnokay_click(object sender, eventargs e) {     label1.text = textbox1.text;     up.update(); } 

Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -