Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old May 19th, 2009, 04:07 PM
Registered User
 
Join Date: May 2009
Posts: 3
Thanks: 1
Thanked 0 Times in 0 Posts
Default Form to Form Communications

Here's my (simple?) VB 2005 problem:

I need to update a NumericUpDown control on FormA from FormB

I've tried running this from frmB:

MySolution.frmA.nud1.Value = intNewValue

I've also tried creating the following subroutine on frmA:

Friend Sub UpdateNud(ByVal intNewValue As Integer)
Me.nud1.Value = intNewValue
End Sub

Both options run without complaint but neither changes the value. I've searched through stacks of literature but haven't yet found a solution. Any help would be appreciated.
Reply With Quote
  #2 (permalink)  
Old May 20th, 2009, 12:02 AM
Lee Dumond's Avatar
Wrox Author
Points: 4,942, Level: 29
Points: 4,942, Level: 29 Points: 4,942, Level: 29 Points: 4,942, Level: 29
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2008
Location: Decatur, IL, USA.
Posts: 923
Thanks: 12
Thanked 166 Times in 162 Posts
Default

Have you tried cross-posting from form B to form A?
__________________
Visit my blog at http://leedumond.com
Follow me on Twitter: http://twitter.com/LeeDumond

Code:
if (this.PostHelpedYou)
{
   ClickThanksButton(); 
}
Reply With Quote
  #3 (permalink)  
Old May 20th, 2009, 12:24 PM
Registered User
 
Join Date: May 2009
Posts: 3
Thanks: 1
Thanked 0 Times in 0 Posts
Default Form to Form Communications

Sorry, I'm not sure what that means so I guess the answer must be no.

Regards,
Pete
Reply With Quote
  #4 (permalink)  
Old May 20th, 2009, 01:31 PM
Lee Dumond's Avatar
Wrox Author
Points: 4,942, Level: 29
Points: 4,942, Level: 29 Points: 4,942, Level: 29 Points: 4,942, Level: 29
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2008
Location: Decatur, IL, USA.
Posts: 923
Thanks: 12
Thanked 166 Times in 162 Posts
Default

Form A markup:

Code:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="FormA.aspx.cs"
   Inherits="FormA" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit"
   TagPrefix="cc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
   <title>Form A</title>
</head>
<body>
   <form id="form1" runat="server">
      <div>
         <cc1:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server" />
         <asp:TextBox ID="TextBox1A" runat="server" />
         <cc1:NumericUpDownExtender ID="TextBox1_NumericUpDownExtender"
            runat="server" Enabled="True" Maximum="1.7976931348623157E+308"
            Minimum="0" TargetControlID="TextBox1A" Width="100">
         </cc1:NumericUpDownExtender>
      </div>
   </form>
</body>
</html>
Form A code-behind:

Code:
using System;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class FormA : Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
       if (PreviousPage != null)
       {
          TextBox1A.Text = ((TextBox) PreviousPage.FindControl("TextBox1B")).Text;
       }
    }
}
Form B markup:

Code:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="FormB.aspx.cs"
   Inherits="FormB" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
   <title>Form B</title>
</head>
<body>
   <form id="form1" runat="server">
      <div>
         <p>
            Put an integer in the textbox below, and click the button to
            cross-post it to Form A.
         </p>
         <asp:TextBox ID="TextBox1B" runat="server" />
         <asp:Button ID="Button1" runat="server" Text="Post" PostBackUrl="FormA.aspx" />
      </div>
   </form>
</body>
</html>
__________________
Visit my blog at http://leedumond.com
Follow me on Twitter: http://twitter.com/LeeDumond

Code:
if (this.PostHelpedYou)
{
   ClickThanksButton(); 
}
Reply With Quote
The Following User Says Thank You to Lee Dumond For This Useful Post:
pjtraynor (May 20th, 2009)
  #5 (permalink)  
Old May 20th, 2009, 01:45 PM
Registered User
 
Join Date: May 2009
Posts: 3
Thanks: 1
Thanked 0 Times in 0 Posts
Default Form to Form Communications

That's very helpful - Thanks!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to set a form as startup form in vb.net 2.0 mallikalapati .NET Framework 2.0 1 February 21st, 2008 09:19 AM
Close all MdiChield form from open one form/Button salman .NET Framework 2.0 6 December 10th, 2007 03:21 AM
Firefox Error when Form Floated / Form locks socoolbrewster CSS Cascading Style Sheets 5 October 6th, 2007 09:59 PM
Converting an HTML Form to ASP.Net Form k_alidxb75 ASP.NET 1.x and 2.0 Application Design 0 November 30th, 2006 03:26 AM
parent form from child form - urgent plz netfresher C# 1 November 8th, 2006 06:59 PM



All times are GMT -4. The time now is 01:29 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.