Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

make text of popup widow dynamic

Posted on 2009-04-08
4
Medium Priority
?
734 Views
Last Modified: 2013-12-17
here i have create a panel which will be used as a popup window.

in panel i have passed one label which will be load with the popup window.

i have value in a text box when i submit the form i wnat the value of text box at label

resides in popup how can i??

above problem is for asp.net,C#,3.5

plz make it fast it's urgemt...
<asp:Panel ID="pnlRechargePopup" runat="server" Style="display: none; width: 250px;
                    background-color: White; border-width: 2px; border-color: Black; border-style: solid;
                    padding: 20px;">
                    <div style="text-align: center;">
                        Are you sure you want to recharge with 
                        <asp:Label ID="Label1" Text="Label">            
                        </asp:Label> ?
                        <br />
                        
                        <br />
                        <asp:Button ID="confirmButtonOk" runat="server" Text="OK" CssClass="adminButton" CausesValidation="false" />
                        <asp:Button ID="confirmButtonCancel" runat="server" Text="Cancel" CssClass="adminButton"
                            CausesValidation="false" />
                    </div>
                </asp:Panel>
 
 
<asp:TextBox ID="txtOther" CssClass="inputbgsmall" runat ="server" ></asp:TextBox>
 
 
 
<asp:Button ID="SubmitButton" runat="server" CssClass="inputbgsmall" CausesValidation="false" Text="Submit" onclick="SubmitButton_Click"/>
              <ajaxToolkit:ConfirmButtonExtender ID="ConfirmRechargeButtonExtender" runat="server"
                    TargetControlID="SubmitButton" DisplayModalPopupID="ModalPopupExtenderConfirm" />
<ajaxToolkit:ModalPopupExtender ID="ModalPopupExtenderConfirm" runat="server" TargetControlID="SubmitButton"
                    PopupControlID="pnlRechargePopup" OkControlID="confirmButtonOk" CancelControlID="confirmButtonCancel"
                    BackgroundCssClass="modalBackground" X="450" Y="250"/>

Open in new window

0
Comment
Question by:scspl
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 2

Expert Comment

by:T0ni
ID: 24110102
Add the runat="server" tag to the label. Ex: <asp:Label ID="Label1" Text="Label" runat="server" />
In the code behind page just set it's text. Ex: Label1.Text = txtOther.Text;
<asp:Panel ID="pnlRechargePopup" runat="server" Style="display: none; width: 250px;
                    background-color: White; border-width: 2px; border-color: Black; border-style: solid;
                    padding: 20px;">
                    <div style="text-align: center;">
                        Are you sure you want to recharge with 
                        <asp:Label ID="Label1" Text="Label" runat="server">            
                        </asp:Label> ?
                        <br />
                        
                        <br />
                        <asp:Button ID="confirmButtonOk" runat="server" Text="OK" CssClass="adminButton" CausesValidation="false" />
                        <asp:Button ID="confirmButtonCancel" runat="server" Text="Cancel" CssClass="adminButton"
                            CausesValidation="false" />
                    </div>
                </asp:Panel>
 
 
<asp:TextBox ID="txtOther" CssClass="inputbgsmall" runat ="server" ></asp:TextBox>
 
 
 
<asp:Button ID="SubmitButton" runat="server" CssClass="inputbgsmall" CausesValidation="false" Text="Submit" onclick="SubmitButton_Click"/>
              <ajaxToolkit:ConfirmButtonExtender ID="ConfirmRechargeButtonExtender" runat="server"
                    TargetControlID="SubmitButton" DisplayModalPopupID="ModalPopupExtenderConfirm" />
<ajaxToolkit:ModalPopupExtender ID="ModalPopupExtenderConfirm" runat="server" TargetControlID="SubmitButton"
                    PopupControlID="pnlRechargePopup" OkControlID="confirmButtonOk" CancelControlID="confirmButtonCancel"
                    BackgroundCssClass="modalBackground" X="450" Y="250"/>
 
 
//IN THE CODE BEHIND PAGE (JUST DOUBLE CLICK THE BUTTON TO CREATE THE EVENT HANDLER)
 
        protected void SubmitButton_Click(object sender, EventArgs e)
        {
            Label1.Text = txtOther.Text;
        }

Open in new window

0
 
LVL 2

Expert Comment

by:T0ni
ID: 24110114
Just view the changes I have made in the code, adjust to them and you should be fine.
0
 

Author Comment

by:scspl
ID: 24113411
you are not getting my code . ...


i am rendering my label with the popup window and it will be open at client side so by just clicking

the submit button it will not be copied the value.

because it will render b4 the submit event will fire and it will first show the label and then

submit event will be fired.

so is there any other suggestions??
0
 
LVL 2

Accepted Solution

by:
T0ni earned 1500 total points
ID: 24114509
You're right. I made some research and found you need to create a [WebMethod] that will be fired when the popup window is rendered.

This link should guide you trough:
http://blogs.msdn.com/delay/archive/2006/09/19/762609.aspx 
0

Featured Post

Enroll in October's Free Course of the Month

Do you work with and analyze data? Enroll in October's Course of the Month for 7+ hours of SQL training, allowing you to quickly and efficiently store or retrieve data. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question