I have two forms, the first has a textbox with customer name (read only) and a button to load the second form which has some textboxes for enter customer name, etc. When I populate these textboxes from SQL and click ok to close the second form I want the customer name from a textbox to return to the first form.
How do I do this? Return values? Global variables? Any help would be greatly appreciated!
8 1460
try using the hidden control, declare a html contol of type hidden, then set its value on the Form2 , when you reopen the form 1 you can get the value using Requets("hdnControlName");
try using the hidden control, declare a html contol of type hidden, then set its value on the Form2 , when you reopen the form 1 you can get the value using Requets("hdnControlName");
Or set a session variable... or cookie, though I would suggest session variables just because I am partial to them.
Session["FirstName"] = "HisName";
...
string FirstName = (string)Session["FirstName"];
Is this a web application or a windows application?
There is a sticky at the top of the forum the begs people to post correctly. Please read it as it sets a format for discussion titles.
Or set a session variable... or cookie, though I would suggest session variables just because I am partial to them.
Session["FirstName"] = "HisName";
...
string FirstName = (string)Session["FirstName"];
The suggestion is good, however please note creating a session or cookie require utilization of resource at client end, beside this making severe use of session variable is not a good practice.
In case if user wishes to create a session/cookie then please do abandon the session/delete the cookie once its use is over.
Hello
If its a web application you can use java script to solve your
problem ,you can get the by gooling with key word as java script for popup i already send the some long time back for this you can easily search it ,dont try either cookies or sessions unless they are required mandatorly
Good Luck
I have two forms, the first has a textbox with customer name (read only) and a button to load the second form which has some textboxes for enter customer name, etc. When I populate these textboxes from SQL and click ok to close the second form I want the customer name from a textbox to return to the first form.
How do I do this? Return values? Global variables? Any help would be greatly appreciated!
Please see this article on what Sessions are and how to use them
The suggestion is good, however please note creating a session or cookie require utilization of resource at client end, beside this making severe use of session variable is not a good practice.
In case if user wishes to create a session/cookie then please do abandon the session/delete the cookie once its use is over.
This is true, but it also takes some of the load off the server, which is why I am partial to them.
Good points though
Why don't you just create a class with friend shared variables and use them in the other form?
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Paul Schouten |
last post by:
I was wondering if anyone could help me with this...
I am having problems sharing data between child forms.
the setup is as follows:
mainFrm <--- MDIForm
|----> ViewFrm <----ChildForm
|---->...
|
by: varlagas |
last post by:
We disabled the antivirus software but the problem persists. Any clues?
Many thanks in advance!
Panagiotis Varlagas
=======================================================================
...
|
by: Red Green |
last post by:
I am trying to switch to C# from Delphi and I am having some trouble finding
some information. What I need to do should be simple but I have been through
a dozen books and done web searches that...
|
by: Robert W. |
last post by:
I'm embarking on a project that will have both a desktop application and a
Pocket PC application. It seems logical to have as much code as possible
sitting in a shared project, which would be...
|
by: Mervin Williams |
last post by:
I am using Infragistics UltraWebTab (a tab folder control for ASP.NET). My
tab folder control will include five tab pages with a separate web form on
each, and these web forms will share data.
...
|
by: Tod Birdsall, MCSD for .NET |
last post by:
Hi All,
I have two ASP.NET applications which I am trying to have share forms
authentication. But I am running into problems.
App A is an ASP.NET 2.0 Beta 2 application. App B is an ASP.NET...
|
by: Chris Thunell |
last post by:
I have 2 forms, on 1 form i use the wizards to create a strong typed dataset
with tables from an SQL database... and from that i can do stuff like:
me.daEmployee.fill(me.dataset11.tblEmployee) ...
|
by: Nick |
last post by:
Hello,
Please pardon my ignorance as this is something I should know, but I'm a
little unclear. I have an MDI based app. It is setup so the user opens a file
and the main child form is created....
|
by: Bob Alston |
last post by:
Having problems sharing an Access database on a Windows 2000 PC. The
other PC is windows 98 (as I recall) but NOT windows 2000!
The 2nd PC has a shortcut to the MDB on the primary PC.
The MDB...
|
by: kirk |
last post by:
I have program.cs, my "main" form and then a "settings" form.
My "main" form existed for awhile and I had constants, instantiations,
properties, etc within it created.
I went to create my...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
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...
|
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...
|
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,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
| |