473,406 Members | 2,208 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

how can I retrieve values ​​from a textBox in another screen after the user send it

Hi,
how can I retrieve values ​​from a textBox in another screen after the user set / send it

In the first screen, I have a TextBox, mNombre50TextBox, the user fills in the number of tickets they want in the textBox.the sum is displayed (by calculating with jQuery) in another textBox, mTotal50TextBox, and the total bill is in 3th (another) textBox, ,mMontantTextBox...

Here is my code in aspx (Front end)
Expand|Select|Wrap|Line Numbers
  1. <script type="text/javascript">
  2.   $(document).ready(function () {
  3.  
  4.    $("#<%=mNombre50TextBox.ClientID %>").keyup(function () {
  5.     $("#<%=mTotal50TextBox.ClientID %>").attr("value", $("#<%=mNombre50TextBox.ClientID %>").attr("value") * 50);
  6.  
  7.     $("#<%=mMontantTextBox.ClientID %>").attr("value", $("#<%=mTotal50TextBox.ClientID %>").attr("value"));
  8.    });
  9.              $("#<%=mNombre100donnerTextBox.ClientID %>").keyup(function () {
  10.     $("#<%=mTotal100donnerTextBox.ClientID %>").attr("value", $("#<%=mNombre100donnerTextBox.ClientID %>").attr("value") * 100);
  11.  
  12.     $("#<%=mMontantTextBox.ClientID %>").attr("value", parseInt($("#<%=mTotal50TextBox.ClientID %>").attr("value")) + parseInt($("#<%=mTotal100donnerTextBox.ClientID %>").attr("value")));
  13.  
  14.  
  15.  
  16.    });
  17.  
  18.                 });
  19.  </script>
  20.  
  21.  
  22.  <div class="conteneur_lbl">
  23.     <div class="lbl">
  24.      <asp:Label ID="billets50" runat="server">Nombre de billet(s) à 50 $ :</asp:Label>
  25.     </div>
  26.     <div class="nmbr_txtbox">
  27.      <asp:TextBox ID="mNombre50TextBox" Text="0" runat="server" MaxLength="3" Width="35px"></asp:TextBox>
  28.     </div>
  29.     <div class="dollars_txtbx">
  30.      somme partielle :
  31.      <asp:TextBox ID="mTotal50TextBox" runat="server" Text="0" MaxLength="6" ReadOnly="True"></asp:TextBox><span
  32.       class="pour_cent_dollars">,00$ </span>
  33.     </div>
  34.    </div>
  35. <div class="conteneur_lbl">
  36.     <div class="lbl">
  37.      <asp:Label ID="billets100donner" runat="server">Nombre de billet(s) à donner à 100 $ :</asp:Label>
  38.     </div>
  39.     <div class="nmbr_txtbox">
  40.      <asp:TextBox ID="mNombre100donnerTextBox" Text="0" runat="server" MaxLength="3" Width="35px"></asp:TextBox>
  41.     </div>
  42.     <div class="dollars_txtbx">
  43.      somme partielle :
  44.      <asp:TextBox ID="mTotal100donnerTextBox" Text="0" runat="server" MaxLength="6" ReadOnly="True"></asp:TextBox><span
  45.       class="pour_cent_dollars">,00$ </span>
  46.     </div>
  47.    </div>
  48.  
  49.  
  50.  <div class="conteneur_lbl">
  51.     <div class="lbl">
  52.      <asp:Label ID="OfferLabel" runat="server">Montant total :</asp:Label>
  53.     </div>
  54.     <div class="txtbx">
  55.      <asp:TextBox ID="mMontantTextBox" runat="server" ReadOnly="True"></asp:TextBox>
  56.      ,00$
  57.      </div>
  58.    </div>
Then (when the user clicks a button), the information is backuped for the following screen:

Here is my code in codebehind C#
Expand|Select|Wrap|Line Numbers
  1. private void SetPageState()
  2.         {
  3.  
  4.  
  5. mFormulairePageState.MontantContribution = mMontantTextBox.Text;
  6.  
  7. //...
  8.  
  9.             SavePageState();
  10.         }
  11.  
  12.             public struct FormulairePageState
  13.         {        
  14.  
  15.  
  16.             public int SelectedIndex;
  17.             //....
  18.  
  19.             public string MontantContribution;
  20.  
  21.                         //....
  22.  
  23.         }    
In the second screen, I display the sum in a "Label", mPriceLabel,!
Here is my code in codebehind C#
Expand|Select|Wrap|Line Numbers
  1. private void LoadLabels()
  2.         {
  3.             object FormulairePageState = Session["FormulairePage"];
  4.  
  5.             // change the amount by adding two 00
  6.             cost = s.MontantContribution;
  7.    double doubleVal = 0.0;
  8.    if (Double.TryParse(cost, out doubleVal))
  9.    {
  10.     newVal = (int)doubleVal * 100;
  11.     mPriceLabel.Text = newVal.ToString(); // 1000 is displayed, I need it for credit card
  12.  
  13.  
  14.    }
  15.  
But in my label, mPriceLabel, there is nothing, it is empty. Comemnt I can display the sum in this screen ?
I did a test on my first screen: I removed "[ReadOnly="True"]" in my TextBox "mMontantTextBox"... Then I typed the numbers directly in the textBox, mMontantTextBox. In this case, these values ​​are displayed in the label on the second screen!

Could you help me, please : Comemnt I can display the sum in 2sd screen ?
Jun 28 '11 #1

✓ answered by Frinavale

Have you considered saving the information in Session?
Or even saving the information in a cookie?
Or even passing the information via Query String to the second page?

You cannot use the page's state management because it is page specific..if you need the information on another page then you have to some how pass it to the page. You can use cookies, session, or query string to do so.

(For more information on Session, see the article titled "Session: how to pass information between web pages")

-Frinny

1 1634
Frinavale
9,735 Expert Mod 8TB
Have you considered saving the information in Session?
Or even saving the information in a cookie?
Or even passing the information via Query String to the second page?

You cannot use the page's state management because it is page specific..if you need the information on another page then you have to some how pass it to the page. You can use cookies, session, or query string to do so.

(For more information on Session, see the article titled "Session: how to pass information between web pages")

-Frinny
Jun 28 '11 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Guru | last post by:
Hi, I am using FOP for creating pdf. I am having a table which has 14 columns. And each column contents may contain any number of chars. My problem is : When the text is having no spaces in...
47
by: Mountain Bikn' Guy | last post by:
Take some standard code such as shown below. It simply loops to add up a series of terms and it produces the correct result. // sum numbers with a loop public int DoSumLooping(int iterations) {...
28
by: Andreas Prilop | last post by:
Jukka reports on http://www.cs.tut.fi/~jkorpela/chars/spaces.html that Internet Explorer 6 fails on the "zero width space" U+200B ​ Is this observation still valid? For which versions of MS...
5
by: | last post by:
Hi all, HttpWebRequest, and SoapHttpClientProtocol both expose a ClientCertificates property, which can hold multiple client certificates, but on the service side, it can only receive one client...
8
by: Santos L Halper | last post by:
i cant believe that im the only person that has ever run into this problem. im using a very simple table to layout a page. the table has 3 columns, with the middle column being where the data will...
11
by: =?Utf-8?B?R29rdWw=?= | last post by:
I am struck up with a problem and want anyone here to help me out. I am a beginner in .NET trying to learng DataBinding concepts. I have binded 4 text boxes with a dataset but when I say...
15
by: removeps-groups | last post by:
How to wrap text in <ptag if the text has no spaces and is very long? Here is an example: ...
12
by: AL | last post by:
How to call a C++ function from c code? extern "C++"? I think it just inhibit the warning. I maybe have to consider c++ object creation problem. Does the C++ need to be a static function? ...
7
by: mjbauer95 | last post by:
I have a function that I want to be able to use to find out if a string is in a string. int in(char string, char finder){ int i = 0; int j = 0; int r = 0; int flag = 0; while (string...
0
davide marchi
by: davide marchi | last post by:
Hi friends, I need to extract email addresses from a public site that publishes the names of companies in adobe flash format: http://www.vinitaly.com/catalogo I only use Linux, but do not yet...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.