Click here to Skip to main content
15,901,001 members
Home / Discussions / C#
   

C#

 
AnswerRe: Dot Net Remoting Pin
Corinna John29-Jun-11 5:04
Corinna John29-Jun-11 5:04 
QuestionActivator.CreateInstance Pin
scotlandc28-Jun-11 4:12
scotlandc28-Jun-11 4:12 
AnswerRe: Activator.CreateInstance Pin
BobJanova28-Jun-11 4:17
BobJanova28-Jun-11 4:17 
AnswerRe: Activator.CreateInstance Pin
PIEBALDconsult28-Jun-11 14:29
mvePIEBALDconsult28-Jun-11 14:29 
GeneralRe: Activator.CreateInstance Pin
scotlandc28-Jun-11 21:16
scotlandc28-Jun-11 21:16 
GeneralRe: Activator.CreateInstance Pin
BobJanova28-Jun-11 22:29
BobJanova28-Jun-11 22:29 
GeneralRe: Activator.CreateInstance Pin
scotlandc28-Jun-11 23:28
scotlandc28-Jun-11 23:28 
Questionhow can I retrieve values ​​from a textBox in another screen after the user set / send it Pin
aspkiddy28-Jun-11 2:42
aspkiddy28-Jun-11 2:42 
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)
 <script type="text/javascript">
  $(document).ready(function () {

   $("#<%=mNombre50TextBox.ClientID %>").keyup(function () {
    $("#<%=mTotal50TextBox.ClientID %>").attr("value", $("#<%=mNombre50TextBox.ClientID %>").attr("value") * 50);

    $("#<%=mMontantTextBox.ClientID %>").attr("value", $("#<%=mTotal50TextBox.ClientID %>").attr("value"));
   });
			 $("#<%=mNombre100donnerTextBox.ClientID %>").keyup(function () {
    $("#<%=mTotal100donnerTextBox.ClientID %>").attr("value", $("#<%=mNombre100donnerTextBox.ClientID %>").attr("value") * 100);

    $("#<%=mMontantTextBox.ClientID %>").attr("value", parseInt($("#<%=mTotal50TextBox.ClientID %>").attr("value")) + parseInt($("#<%=mTotal100donnerTextBox.ClientID %>").attr("value")));



   });
			
		        }); 
 </script>

	
 <div class="conteneur_lbl">
    <div class="lbl">
     <asp:Label ID="billets50" runat="server">Nombre de billet(s) à 50 $ :</asp:Label>
    </div>
    <div class="nmbr_txtbox">
     <asp:TextBox ID="mNombre50TextBox" Text="0" runat="server" MaxLength="3" Width="35px"></asp:TextBox>
    </div>
    <div class="dollars_txtbx">
     somme partielle :
     <asp:TextBox ID="mTotal50TextBox" runat="server" Text="0" MaxLength="6" ReadOnly="True"></asp:TextBox><span
      class="pour_cent_dollars">,00$ </span>
    </div>
   </div>
<div class="conteneur_lbl">
    <div class="lbl">
     <asp:Label ID="billets100donner" runat="server">Nombre de billet(s) à donner à 100 $ :</asp:Label>
    </div>
    <div class="nmbr_txtbox">
     <asp:TextBox ID="mNombre100donnerTextBox" Text="0" runat="server" MaxLength="3" Width="35px"></asp:TextBox>
    </div>
    <div class="dollars_txtbx">
     somme partielle :
     <asp:TextBox ID="mTotal100donnerTextBox" Text="0" runat="server" MaxLength="6" ReadOnly="True"></asp:TextBox><span
      class="pour_cent_dollars">,00$ </span>
    </div>
   </div>


 <div class="conteneur_lbl">
    <div class="lbl">
     <asp:Label ID="OfferLabel" runat="server">Montant total :</asp:Label>
    </div>
    <div class="txtbx">
     <asp:TextBox ID="mMontantTextBox" runat="server" ReadOnly="True"></asp:TextBox>
     ,00$
     </div>
   </div>


Then (when the user clicks a button), the information is backuped for the following screen:

Here is my code in codebehind C#
private void SetPageState()
		{


mFormulairePageState.MontantContribution = mMontantTextBox.Text; 

//...

			SavePageState();
		}

			public struct FormulairePageState
		{		
			
			
			public int SelectedIndex;
			//....

			public string MontantContribution;
			
						//....
						
		}				

In the second screen, I display the sum in a "Label", mPriceLabel,!
Here is my code in codebehind C#
private void LoadLabels()
		{
			object FormulairePageState = Session["FormulairePage"];
			
			// change the amount by adding two 00
			cost = s.MontantContribution;
   double doubleVal = 0.0;
   if (Double.TryParse(cost, out doubleVal))
   {
    newVal = (int)doubleVal * 100;
    mPriceLabel.Text = newVal.ToString(); // 1000 is displayed, I need it for credit card
    

   }


But in my label, mPriceLabel, there is nothing, it is empty. Cry | :(( Comemnt I can display the sum in this screen ?Confused | :confused:
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 ?Confused | :confused:
AnswerRe: how can I retrieve values ​​from a textBox in another screen after the user set / send it Pin
Not Active28-Jun-11 2:49
mentorNot Active28-Jun-11 2:49 
GeneralRe: how can I retrieve values ​​from a textBox in another screen after the user set / send it Pin
marszheng28-Jun-11 15:03
marszheng28-Jun-11 15:03 
GeneralRe: how can I retrieve values ​​from a textBox in another screen after the user set / send it Pin
Not Active28-Jun-11 15:45
mentorNot Active28-Jun-11 15:45 
AnswerRe: how can I retrieve values ​​from a textBox in another screen after the user set / send it Pin
BobJanova28-Jun-11 22:33
BobJanova28-Jun-11 22:33 
QuestionProblem with reteriving xml data from sql data base. Pin
prasadbuddhika28-Jun-11 0:23
prasadbuddhika28-Jun-11 0:23 
AnswerRe: Problem with reteriving xml data from sql data base. Pin
abhinish28-Jun-11 0:35
abhinish28-Jun-11 0:35 
QuestionProblem with Process.HasExited Pin
Nigel Mackay27-Jun-11 23:52
Nigel Mackay27-Jun-11 23:52 
AnswerRe: Problem with Process.HasExited PinPopular
BobJanova27-Jun-11 23:55
BobJanova27-Jun-11 23:55 
GeneralRe: Problem with Process.HasExited Pin
Nigel Mackay28-Jun-11 0:08
Nigel Mackay28-Jun-11 0:08 
QuestionCode style [modified] Pin
Lutosław27-Jun-11 23:43
Lutosław27-Jun-11 23:43 
AnswerRe: Code style Pin
V.27-Jun-11 23:50
professionalV.27-Jun-11 23:50 
AnswerRe: Code style [modified] Pin
Pete O'Hanlon28-Jun-11 0:00
mvePete O'Hanlon28-Jun-11 0:00 
GeneralRe: Code style Pin
BobJanova28-Jun-11 0:06
BobJanova28-Jun-11 0:06 
GeneralRe: Code style Pin
Pete O'Hanlon28-Jun-11 0:30
mvePete O'Hanlon28-Jun-11 0:30 
GeneralRe: Code style Pin
Lutosław28-Jun-11 0:54
Lutosław28-Jun-11 0:54 
GeneralRe: Code style Pin
Pete O'Hanlon28-Jun-11 1:07
mvePete O'Hanlon28-Jun-11 1:07 
GeneralRe: Code style Pin
Lutosław28-Jun-11 1:17
Lutosław28-Jun-11 1:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.