473,725 Members | 2,276 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

pass the control value from one web form to another form

tom
Hi Experts,

I want to pass the selectedDate value from my calender
form to another web form or a web user control. Could you
please show me how to do this?

Thanks in advance.

Nov 17 '05 #1
4 4802
Tom,

There are a number of choices to do so.

Depending on your needs, you could use Server.Transfer or Response.Redire ct
and the query string.

To use the query string

Response.Redire ct("pagetwo.asp x?date=" & selectedDate.To String)

Then on page two:

Dim Date As Date = CType(Request.Q uerystring.Item ("date"), Date)

If you want to use Server.Transfer (Which would be more suited if a number
of variables need to be passed to the second page.) I suggest reading up on
it a bit more. It's fairly easy to do, but can be confusing for the user
because they are moved to page two but their browser's address bar will
still display the first page's url.

If you want some quick code samples I have some in the code library of my
web site: www.aboutfortunate.com. Just use the search box in the code
library area and input: "Server.Transfe r".

Sincerely,

--
S. Justin Gengo, MCP
Web Developer

Free code library at:
www.aboutfortunate.com

"Out of chaos comes order."
Nietzche
"tom" <an*******@disc ussions.microso ft.com> wrote in message
news:00******** *************** *****@phx.gbl.. .
Hi Experts,

I want to pass the selectedDate value from my calender
form to another web form or a web user control. Could you
please show me how to do this?

Thanks in advance.

Nov 17 '05 #2
Here's a nice, simple way to pass values from one page to another:
(VB.NET code)

'Add data to the context object before transferring
Context.Items(" myParameter") = x
Server.Transfer ("WebForm2.aspx ")

Then, in WebForm2.aspx:

'Grab data from the context property
Dim x as Integer = CType(Context.I tems("myParamet er"),Integer)

Of course there are a number of ways to pass values from one page to
another, such as using the querystring, cookies, session,
context, saving to a temporary table in the database between each page, etc.
You'll have to decide which technique is best for your application.
Here are several good articles on the subject to help you decide.
http://msdn.microsoft.com/msdnmag/is...e/default.aspx

http://www.aspalliance.com/kenc/passval.aspx

http://www.dotnetjunkies.com/tutoria...tutorialid=600

http://www.dotnetbips.com/displayarticle.aspx?id=79

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
Hire top-notch developers at http://www.able-consulting.com

"tom" <an*******@disc ussions.microso ft.com> wrote in message
news:00******** *************** *****@phx.gbl.. .
Hi Experts,

I want to pass the selectedDate value from my calender
form to another web form or a web user control. Could you
please show me how to do this?

Thanks in advance.

Nov 17 '05 #3
tom
Hi Steve and S. Justin,

Thank you very much for your responses. I'm sorry that I
didn't explain my problem more clearly on my previous
mail. My problem is a different situation. On my page one
there is textbox and the page two only contains a calendar
control. I need to open page one first and click a button
on page one will open the page two. After user selected a
date from the calendar the page two will close and the
date should be shown on the page one's textbox. I'm
struggling with how to pass value back to page one when
the page one is already opened and update page one's data?

Please help me!
Thanks in advance.
-----Original Message-----
Here's a nice, simple way to pass values from one page to another:(VB.NET code)

'Add data to the context object before transferring
Context.Items( "myParamete r") = x
Server.Transfe r("WebForm2.asp x")

Then, in WebForm2.aspx:

'Grab data from the context property
Dim x as Integer = CType(Context.I tems ("myParameter") ,Integer)
Of course there are a number of ways to pass values from one page toanother, such as using the querystring, cookies, session,
context, saving to a temporary table in the database between each page, etc.You'll have to decide which technique is best for your application.Here are several good articles on the subject to help you decide.
http://msdn.microsoft.com/msdnmag/is...04/ASPNETUserS tate/default.aspx
http://www.aspalliance.com/kenc/passval.aspx

http://www.dotnetjunkies.com/tutoria...tutorialid=600

http://www.dotnetbips.com/displayarticle.aspx?id=79

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
Hire top-notch developers at http://www.able- consulting.com
"tom" <an*******@disc ussions.microso ft.com> wrote in messagenews:00******* *************** ******@phx.gbl. ..
Hi Experts,

I want to pass the selectedDate value from my calender
form to another web form or a web user control. Could you please show me how to do this?

Thanks in advance.

.

Nov 17 '05 #4
Tom,

I think this article is just what you need:

http://www.vb2themax.com/Item.asp?PageID=TipBank&ID=614

Sincerely,

--
S. Justin Gengo, MCP
Web Developer

Free code library at:
www.aboutfortunate.com

"Out of chaos comes order."
Nietzche
"tom" <an*******@disc ussions.microso ft.com> wrote in message
news:0e******** *************** *****@phx.gbl.. .
Hi Steve and S. Justin,

Thank you very much for your responses. I'm sorry that I
didn't explain my problem more clearly on my previous
mail. My problem is a different situation. On my page one
there is textbox and the page two only contains a calendar
control. I need to open page one first and click a button
on page one will open the page two. After user selected a
date from the calendar the page two will close and the
date should be shown on the page one's textbox. I'm
struggling with how to pass value back to page one when
the page one is already opened and update page one's data?

Please help me!
Thanks in advance.
-----Original Message-----
Here's a nice, simple way to pass values from one page to

another:
(VB.NET code)

'Add data to the context object before transferring
Context.Items( "myParamete r") = x
Server.Transfe r("WebForm2.asp x")

Then, in WebForm2.aspx:

'Grab data from the context property
Dim x as Integer = CType(Context.I tems

("myParameter") ,Integer)

Of course there are a number of ways to pass values from

one page to
another, such as using the querystring, cookies, session,
context, saving to a temporary table in the database

between each page, etc.
You'll have to decide which technique is best for your

application.
Here are several good articles on the subject to help you

decide.
http://msdn.microsoft.com/msdnmag/is...04/ASPNETUserS

tate/default.aspx

http://www.aspalliance.com/kenc/passval.aspx

http://www.dotnetjunkies.com/tutoria...tutorialid=600

http://www.dotnetbips.com/displayarticle.aspx?id=79

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
Hire top-notch developers at http://www.able-

consulting.com

"tom" <an*******@disc ussions.microso ft.com> wrote in

message
news:00******* *************** ******@phx.gbl. ..
Hi Experts,

I want to pass the selectedDate value from my calender
form to another web form or a web user control. Could you please show me how to do this?

Thanks in advance.

.

Nov 17 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
11296
by: martin | last post by:
Hi, I am a web page and a web user control. My web user control is placed in my web page using the following directive <%@ Register TagPrefix="uc1" TagName="Header" Src="WebControls/Header.ascx" %> The web user control contains the following server controls
2
3626
by: John Lau | last post by:
Hi, Is there documentation that talks about the page lifecycle, the lifecycle of controls on the page, and the rendering of inline code, in a single document? Thanks, John
0
2444
by: ab_j | last post by:
I have a user control that contains a dropdown which I want to use as a menu on multiple .aspx pages. Basically, all I am trying to do is pass the selected value of the dropdown in the user control to the main ..aspx page. In an attempt to make it more clear on what I am talking about, here is the order of events in page life cycle (from http://www.dotnetspider.com/technology/KBPages/789.aspx) ..ascx - OnInit() ..ascx - Page_Init()
5
1430
by: Mike Hoff | last post by:
Hello, I am wondering if it is possible to pass a procedure name to another proc. I have been looking into delegates, but cannot seem to get the code correct. Basically what I have is a proc to add handlers to various controls on a form. basically each control would get mostly the same handlers, but there is a particular handler that would vary based on the parent on the control in question. What I would like to do is something like...
2
2510
by: c676228 | last post by:
Hi, This is my first time to post asp.net question on this forum. I have a question for "How to pass the first form value to the next form" I have enrollinfo.aspx form which look like as follow: <form id="Form1" method="post" runat="server"> <Subway:Address id="address" runat="server" Caption="Home Address"></Subway:Address> <p></p> <SUBWAY:PEOPLEINFO id="Peopleinfo" runat="server" Caption="Employee Information"></SUBWAY:PEOPLEINFO>
1
6128
by: sara | last post by:
I am learning how to use simple functions to make my apps more powerful and efficient. On one screen, I want to populate field B: ItemDescription by looking up the ItemDescription in the Items Table. I would use the key to the Items Table from the selection the user made in the combo box. SO: User chooses an item from the combo box whose value is "3". I want to look up the ItemDescription of the Item with the Key "3" and show that...
17
7074
by: Rabbit | last post by:
Hi, On my 1st page, i have a function which gets a new ID value and need to transfer to another immediately. which I want to get in 2nd page using Request.form("txtID"), but doesn't work, the returned value is "" Anybody know how to set this value on 1st page properly, in order to let 2nd page catch it? I don't want to use querystring to pass this value!
4
21215
by: bluepiper | last post by:
Im using VB 6.0 The problem is have two forms the the first one (name it Form1) include one textbox control and button , and when pressing button I want to pass the textbox value to another text control in the second form (name it Form2). Please help me. Thanks
12
11098
by: raylopez99 | last post by:
Keywords: scope resolution, passing classes between parent and child forms, parameter constructor method, normal constructor, default constructor, forward reference, sharing classes between forms. Here is a newbie mistake that I found myself doing (as a newbie), and that even a master programmer, the guru of this forum, Jon Skeet, missed! (He knows this I'm sure, but just didn't think this was my problem; LOL, I am needling him) If...
0
8752
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9401
Oralloy
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9257
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9179
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8099
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6011
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4519
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4784
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2157
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.