Showing posts with label web. Show all posts
Showing posts with label web. Show all posts

Thursday, March 29, 2012

Passing values between Web Forms

Hi,

I have a web page which is split vertically into two by a frame, giving me LeftPage.aspx and RightPage.aspx.

Now then, I want to pass the contents of a few text boxes on LeftPage to some text boxes on RightPage.

How do I do it?

By the way, i'd like the passing to happen at the end of the Page_Load event on LeftPage.

Cheers,
DarrenHello, in the LeftFrame, you specify the link as follows:

Then you name the right frame = "rightFrame". Then, you have used querystrings to pass these values.

regards
Hi,

Thanks for the quick response, however your message does not show any code between your first line and then the line that starts "Then you name..." (i.e. it's blank).

Sorry i'm as thick as a whale omlette when it comes to APS.NET i've only just started... could you be more specific please (i.e. supply code??)

thanks in advance!

regards,
darren
By the way i've tried:

LEFT PAGE CODE:

Server.Transfer("RightPage.aspx")

... but this replaces the left page with the right page inside the left frame!!

regards,
darren


Link text

Replace the 'this' and 'that' with asp variables, or databinders, whatever it is you are using as the values.
Well, I beleive this is the same as my solution, but I didn't get any resposne ?

regards
Use the code that chrisbarr mentioned for the link.
Then in the rightpage.aspx code, use something like (in VB)

If Not Request.Params("a") Is Nothing Then
info = Request.Params("a")
End If

This should collect the information.
Does this help?

Passing values between web pages which are in different Web Sites

Hi,
I want to pass information from one page, which is in a site to a page
which is in a different site.
Can I pass an xml file between sites
Thanx
Shankar
*** Sent via Developersdex http://www.examnotes.net ***
Don't just participate in USENET...get rewarded for it!On Thu, 27 Jan 2005 23:07:58 -0800, Shankar Ayyachamy wrote:

> Hi,
> I want to pass information from one page, which is in a site to a page
> which is in a different site.
> Can I pass an xml file between sites
> Thanx
> Shankar
> *** Sent via Developersdex http://www.examnotes.net ***
> Don't just participate in USENET...get rewarded for it!
What about good old query string or form variables?
--
http://dotnetjunkies.com/weblog/dotnut

Thanx,
Other than these two, can we pass a xml file between web sites?
*** Sent via Developersdex http://www.examnotes.net ***
Don't just participate in USENET...get rewarded for it!
On Fri, 28 Jan 2005 00:58:02 -0800, Shankar Ayyachamy wrote:

> Thanx,
> Other than these two, can we pass a xml file between web sites?
> *** Sent via Developersdex http://www.examnotes.net ***
> Don't just participate in USENET...get rewarded for it!
GET/POST are the only ways to access a web-page/send data to it. I think
you need to POST this xml file, using a form variable on the sender page,
and submit it to the second webpage.
HTH
Ranjan
--
http://dotnetjunkies.com/weblog/dotnut
Shankar Ayyachamy <vidshan2@.yahoo.com> confessed in news:eRnB6dRBFHA.4004
@.tk2msftngp13.phx.gbl:

>
> Thanx,
> Other than these two, can we pass a xml file between web sites?
> *** Sent via Developersdex http://www.examnotes.net ***
> Don't just participate in USENET...get rewarded for it!
Yes.

Passing values between web pages which are in different Web Sites

Hi,

I want to pass information from one page, which is in a site to a page
which is in a different site.

Can I pass an xml file between sites

Thanx
Shankar

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!On Thu, 27 Jan 2005 23:07:58 -0800, Shankar Ayyachamy wrote:

> Hi,
> I want to pass information from one page, which is in a site to a page
> which is in a different site.
> Can I pass an xml file between sites
> Thanx
> Shankar
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!

What about good old query string or form variables?
--

http://dotnetjunkies.com/weblog/dotnut

Thanx,

Other than these two, can we pass a xml file between web sites?

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
On Fri, 28 Jan 2005 00:58:02 -0800, Shankar Ayyachamy wrote:

> Thanx,
> Other than these two, can we pass a xml file between web sites?
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!

GET/POST are the only ways to access a web-page/send data to it. I think
you need to POST this xml file, using a form variable on the sender page,
and submit it to the second webpage.

HTH
Ranjan
--

http://dotnetjunkies.com/weblog/dotnut
Shankar Ayyachamy <vidshan2@.yahoo.com> confessed in news:eRnB6dRBFHA.4004
@.tk2msftngp13.phx.gbl:

>
> Thanx,
> Other than these two, can we pass a xml file between web sites?
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!

Yes.

--

Passing Values Between web forms pages

i am trying to implement passing values from my login webpage to another. but i get an error of "Specified cast is not valid."

i followed the program logic and I cant find the error that the debugger says that it is in the casting. I am following the example provided by Microsoft in
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconpassingservercontrolvaluesbetweenpages.asp

next, it is the code behind of both forms

1st webform

<---login.aspx---
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

End Sub
Public ReadOnly Property UserId() As String
Get
Return Trim(txtUser.Text)
End Get
End Property

Private Sub lnkLogin_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lnkLogin.Click

Server.Transfer("secondForm.aspx")

end sub

<----secondForm.aspx---
Imports System
Imports System.Data
Imports System.Data.SqlClient
Imports System.Web

Imports System.Web.Security
Imports System.Web.UI

Public Class secondForm

Inherits System.Web.UI.Page

Public userLogin As login

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

Dim blnAddinProgress As Boolean

Dim strUsername As String

If Not IsPostBack() Then

userLogin = CType(Context.Handler, login)

strUsername = userLogin.UserId

<-----
The error that i got from the debugger is "Specified cast is not valid."

following this message, Do i have to change the casting or is there another error or piece of code that i am forgetting.

thanks in advanceYou might try the similar technique documented in this topic:

Passing Values Between Web Forms Pages
HI! the link that you provided me is the one that i used.

If you see the structure of the code is pretty simmilar to the one of the link. Do you know about other option?
the error could be related to I am using Forms authentications?

thank you very much for your help
>HI! the link that you provided me is the one that i used.

Ok. The URL that you provided is not the same as the one for the other article, so I was a little confused.

Here's a question: what kind of control is lnkLogin in your login page? It should be a LinkButton or just Button (not a Hyperlink).

So, assuming that you're using a LinkButton, the bad news is that I cannot reproduce your error. I had to add a line (which you probably have). This is what my target page code looks like:

 Public userLogin As login
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) _
Handles MyBase.Load
Dim blnAddinProgress As Boolean
Dim strUsername As String
If Not IsPostBack() Then
userLogin = CType(Context.Handler, login)
strUsername = userLogin.UserId
Response.Write(strUsername)
End If
End Sub

Passing Values Between Web Forms Pages

I am porting an old client/server application to asp.net. I used to
retrieve data into local tables (Paradox table-files on the client's
disk) and work on them before saving them back to the server. What is
the approach for this in asp.net? The comments in MSDN on using the
session object are scary, imagining that several users at the same
time will use plenty of space on the server's memory! Or is it
realistic to memorize the data in a page and access them from the
following pages?
Thank for your help!You can add objects to the HttpContext of the current Page, and then use
Server.Transfer to transfer to the next page. The HttpContext is transferred
as well, and you can pull the data from the original page out of that.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
http://www.takempis.com
Big things are made up of
lots of little things.

"cgia" <cgian31@.katamail.com> wrote in message
news:b35db8fd.0307250620.7aed635b@.posting.google.c om...
> I am porting an old client/server application to asp.net. I used to
> retrieve data into local tables (Paradox table-files on the client's
> disk) and work on them before saving them back to the server. What is
> the approach for this in asp.net? The comments in MSDN on using the
> session object are scary, imagining that several users at the same
> time will use plenty of space on the server's memory! Or is it
> realistic to memorize the data in a page and access them from the
> following pages?
> Thank for your help!
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.Items("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/i...te/default.aspx

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

http://www.dotnetjunkies.com/tutori...?tutorialid=600

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

--
I hope this helps,
Steve C. Orr, MCSD
http://Steve.Orr.net

"cgia" <cgian31@.katamail.com> wrote in message
news:b35db8fd.0307250620.7aed635b@.posting.google.c om...
> I am porting an old client/server application to asp.net. I used to
> retrieve data into local tables (Paradox table-files on the client's
> disk) and work on them before saving them back to the server. What is
> the approach for this in asp.net? The comments in MSDN on using the
> session object are scary, imagining that several users at the same
> time will use plenty of space on the server's memory! Or is it
> realistic to memorize the data in a page and access them from the
> following pages?
> Thank for your help!
There are a lot of options to transferring values between pages: Session
like you've mentioned, The querystring (of course), But you may want to look
into Server.Transfer and the Context Object.

I hope this leads you in the right direction.

--
S. Justin Gengo, MCP
Web Developer

Free code library at:
www.aboutfortunate.com

"Out of chaos comes order."
Nietzche
"cgia" <cgian31@.katamail.com> wrote in message
news:b35db8fd.0307250620.7aed635b@.posting.google.c om...
> I am porting an old client/server application to asp.net. I used to
> retrieve data into local tables (Paradox table-files on the client's
> disk) and work on them before saving them back to the server. What is
> the approach for this in asp.net? The comments in MSDN on using the
> session object are scary, imagining that several users at the same
> time will use plenty of space on the server's memory! Or is it
> realistic to memorize the data in a page and access them from the
> following pages?
> Thank for your help!
Actually what I want to transfer between forms is huge tables... do
you think it is appropriate to use the server.transfer?

cgian31@.katamail.com (cgia) wrote in message news:<b35db8fd.0307250620.7aed635b@.posting.google.com>...
> I am porting an old client/server application to asp.net. I used to
> retrieve data into local tables (Paradox table-files on the client's
> disk) and work on them before saving them back to the server. What is
> the approach for this in asp.net? The comments in MSDN on using the
> session object are scary, imagining that several users at the same
> time will use plenty of space on the server's memory! Or is it
> realistic to memorize the data in a page and access them from the
> following pages?
> Thank for your help!
Yes, that seems like one of the more efficient solutions for this particular
problem.

--
I hope this helps,
Steve C. Orr, MCSD
http://Steve.Orr.net

"cgia" <cgian31@.katamail.com> wrote in message
news:b35db8fd.0307251918.2ad13d06@.posting.google.c om...
> Actually what I want to transfer between forms is huge tables... do
> you think it is appropriate to use the server.transfer?
>
> cgian31@.katamail.com (cgia) wrote in message
news:<b35db8fd.0307250620.7aed635b@.posting.google.com>...
> > I am porting an old client/server application to asp.net. I used to
> > retrieve data into local tables (Paradox table-files on the client's
> > disk) and work on them before saving them back to the server. What is
> > the approach for this in asp.net? The comments in MSDN on using the
> > session object are scary, imagining that several users at the same
> > time will use plenty of space on the server's memory! Or is it
> > realistic to memorize the data in a page and access them from the
> > following pages?
> > Thank for your help!

passing values from a web page into windows form application

Hi guys,

How can I pass session/application values from a web page (ASP or
ASP.NET) that is on a host company, into my cliente application?

So I can hide menus based on access permisions once the user makes the
log in in the web page by the application.

I'm using VB.NET with Web Control COM

Thank you

Bruno Alexandre
(Sintra, PORTUGAL)Hi Bruno,

You could post the values to a page from your site containing a vb6
component. The vb6 component would run in-process and with a reference to
the 'Microsoft Active Server Pages Object Library' you could then query the
session and application variables ASPTypeLibrary.Session and
ASPTypeLibrary.Application.
I have a sample program which isfreely available from a demonstration I did
on this a while back available at
http://www.crainiate.net/downloads/vb6wsdemo.zip

This component would then need to notify your application across process's,
there are a number of ways of doing this.

Your client would however need to run IIS, so this solution is limited to
windows2000 or windowsXP.

Kind regards,
James

--
Create interactive flowcharts, diagrams and UML models with ERM3 at
http://www.crainiate.net

"Bruno Alexandre" <bruno.alexandre@.filtrarte.com> wrote in message
news:uWoY6OsoDHA.2188@.TK2MSFTNGP11.phx.gbl...
> Hi guys,
> How can I pass session/application values from a web page (ASP or
> ASP.NET) that is on a host company, into my cliente application?
> So I can hide menus based on access permisions once the user makes the
> log in in the web page by the application.
> I'm using VB.NET with Web Control COM
>
> Thank you
> Bruno Alexandre
> (Sintra, PORTUGAL)

passing values from main webform to include template pages

View a printable version of this message!I'm new to ASP.Net... I have a web page (myform.aspx) that is put together using 3 include files, header.cscx, left.cscx, & footer.cscx (each has their own .cscx.vb files). I want to assign some custom values on myform.aspx.vb, how can I get these custom values in my one of my includes files, ie. header.cscx.vb?
'**********This is myform.aspx*************
<%@dotnet.itags.org. Register TagPrefix="UC" TagName="footer" src="http://pics.10026.com/?src=footer.ascx"%>
<%@dotnet.itags.org. Register TagPrefix="UC" TagName="left" src="http://pics.10026.com/?src=left.ascx"%>
<%@dotnet.itags.org. Register TagPrefix="UC" TagName="header" src="http://pics.10026.com/?src=header.ascx"%>
<%@dotnet.itags.org. Page Language="vb" AutoEventWireup="false" Codebehind="myform.aspx.vb" Inherits="intranet.myform"%>
<UC:header id="header" runat="server" />
<UC:left id="left" runat="server" />
<TABLE><TR><td>My contents go here...</td></TR></TABLE>
<UC:footer id="footer" runat="server" />

'**********This is myform.aspx.vb*************
Public Class myform
Inherits System.Web.UI.Page
Protected WithEvents lblPageTitle As System.Web.UI.WebControls.Label
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
lblPageTitle.Text = "Welcome to my home page!"
End Sub
End Class

'**********This is header.ascx*************
<%@dotnet.itags.org. Control Language="vb" AutoEventWireup="false" Codebehind="header.ascx.vb" Inherits="intranet.header" %>
'I don't have any HTML code here yet (all are in header.acsx.vb) b/c I'm still working on the sepration between HTML design and codebehind page.

'**********This is header.ascx.vb*************
Public Class header
Inherits System.Web.UI.UserControl
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

'How can I get the value of lblPageTitle here so I can display it in the HTML Title tag??
'I have other values that I want to pass to this page too, but for this example, I'm just trying to get the value of lblPageTitle from myform.aspx.vb
Response.Write("<HTML><HEAD>")
Response.Write("<title>lblPageTitle</title>")
Response.Write("</HEAD><BODY>")
...
End Sub
End Class1) Cookie
2) Session Variable
3) Query String
I think any of these will work for what you're describing. You'retrying to get som value to be accessible to your user controls from themain page.

Have you thought of using properties inside the usercontrols?
check this please:
An Extensive Examination of User Controls
The best reference to UserControls
Regards
Thank you so much, it's exactly what I need!
That is great, Im happy for you.
regards

Monday, March 26, 2012

passing values from one web form to another web form

I have a web form welcome.asp and it has three textboxes and two
dropdown list. It has one button called Submit.
when I click that button it should pass all the data from text boxes
and dropdown lists to another web form named processform.aspx.
So, my question is how can I pass the data from one web form to
another web form by clicking abutton.
ThanksIf you are using Server.Transfer method or cross-page posting, you can use
PreviousPage property to access the originating page.
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
<bbawa1@.yahoo.com> wrote in message
news:1181585117.479238.102680@.n15g2000prd.googlegroups.com...
> I have a web form welcome.asp and it has three textboxes and two
> dropdown list. It has one button called Submit.
> when I click that button it should pass all the data from text boxes
> and dropdown lists to another web form named processform.aspx.
> So, my question is how can I pass the data from one web form to
> another web form by clicking abutton.
> Thanks
>
If this is a form post, you also have access to either the form or the query
string.
"Eliyahu Goldin" <REMOVEALLCAPITALSeEgGoldDinN@.mMvVpPsS.org> wrote in
message news:OZWVDQFrHHA.3456@.TK2MSFTNGP02.phx.gbl...
> If you are using Server.Transfer method or cross-page posting, you can use
> PreviousPage property to access the originating page.
> --
> Eliyahu Goldin,
> Software Developer & Consultant
> Microsoft MVP [ASP.NET]
> http://msmvps.com/blogs/egoldin
>
> <bbawa1@.yahoo.com> wrote in message
> news:1181585117.479238.102680@.n15g2000prd.googlegroups.com...
>
On Jun 11, 12:15 pm, "Eliyahu Goldin"
<REMOVEALLCAPITALSeEgGoldD...@.mMvVpPsS.org> wrote:
> If you are using Server.Transfer method or cross-page posting, you can use
> PreviousPage property to access the originating page.
> --
> Eliyahu Goldin,
> Software Developer & Consultant
> Microsoft MVP [ASP.NET]http://msmvps.com/blogs/egoldin
> <bba...@.yahoo.com> wrote in message
> news:1181585117.479238.102680@.n15g2000prd.googlegroups.com...
>
>
>
>
>
> - Show quoted text -
When I use Server.Transfer["ProcessForm.aspx"]; my btn_click event
it gives me following error message
only assignments, call, increment, decrement, and new object
expressions can be used as a statement
cannot apply indexing with [] to an expression of type 'method group'
Ysgrifennodd bbawa1@.yahoo.com:
> I have a web form welcome.asp and it has three textboxes and two
> dropdown list. It has one button called Submit.
> when I click that button it should pass all the data from text boxes
> and dropdown lists to another web form named processform.aspx.
> So, my question is how can I pass the data from one web form to
> another web form by clicking abutton.
> Thanks
>
I take the view that computer programs are usually modeling some real
world object or objects. I therefore construct server side object(s)
that store information entered via Pages in its/their state variables
(fields/properties/attributes).
On submit, I do any validation of the data that is required, store the
data in the object(s) and then store a reference to the object(s) in the
Session.
It is then a simple matter to retrieve that object and its data from the
Session in any subsequent form.
HTH
Peter
ASP.NET provides a plethora of ways to pass data between pages.
I've detailed virtually every technique here:
http://SteveOrr.net/articles/PassData.aspx
I hope this helps,
Steve C. Orr,
MCSD, MVP, CSM, ASPInsider
http://SteveOrr.net
<bbawa1@.yahoo.com> wrote in message
news:1181585117.479238.102680@.n15g2000prd.googlegroups.com...
>I have a web form welcome.asp and it has three textboxes and two
> dropdown list. It has one button called Submit.
> when I click that button it should pass all the data from text boxes
> and dropdown lists to another web form named processform.aspx.
> So, my question is how can I pass the data from one web form to
> another web form by clicking abutton.
> Thanks
>

passing values from one web form to another web form

I have a web form welcome.asp and it has three textboxes and two
dropdown list. It has one button called Submit.

when I click that button it should pass all the data from text boxes
and dropdown lists to another web form named processform.aspx.

So, my question is how can I pass the data from one web form to
another web form by clicking abutton.

ThanksIf you are using Server.Transfer method or cross-page posting, you can use
PreviousPage property to access the originating page.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
<bbawa1@.yahoo.comwrote in message
news:1181585117.479238.102680@.n15g2000prd.googlegr oups.com...

Quote:

Originally Posted by

I have a web form welcome.asp and it has three textboxes and two
dropdown list. It has one button called Submit.
>
when I click that button it should pass all the data from text boxes
and dropdown lists to another web form named processform.aspx.
>
So, my question is how can I pass the data from one web form to
another web form by clicking abutton.
>
Thanks
>


If this is a form post, you also have access to either the form or the query
string.

"Eliyahu Goldin" <REMOVEALLCAPITALSeEgGoldDinN@.mMvVpPsS.orgwrote in
message news:OZWVDQFrHHA.3456@.TK2MSFTNGP02.phx.gbl...

Quote:

Originally Posted by

If you are using Server.Transfer method or cross-page posting, you can use
PreviousPage property to access the originating page.
>
--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
>
>
<bbawa1@.yahoo.comwrote in message
news:1181585117.479238.102680@.n15g2000prd.googlegr oups.com...

Quote:

Originally Posted by

>I have a web form welcome.asp and it has three textboxes and two
>dropdown list. It has one button called Submit.
>>
>when I click that button it should pass all the data from text boxes
>and dropdown lists to another web form named processform.aspx.
>>
>So, my question is how can I pass the data from one web form to
>another web form by clicking abutton.
>>
>Thanks
>>


>
>


On Jun 11, 12:15 pm, "Eliyahu Goldin"
<REMOVEALLCAPITALSeEgGoldD...@.mMvVpPsS.orgwrote:

Quote:

Originally Posted by

If you are using Server.Transfer method or cross-page posting, you can use
PreviousPage property to access the originating page.
>
--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]http://msmvps.com/blogs/egoldin
>
<bba...@.yahoo.comwrote in message
>
news:1181585117.479238.102680@.n15g2000prd.googlegr oups.com...
>
>
>

Quote:

Originally Posted by

I have a web form welcome.asp and it has three textboxes and two
dropdown list. It has one button called Submit.


>

Quote:

Originally Posted by

when I click that button it should pass all the data from text boxes
and dropdown lists to another web form named processform.aspx.


>

Quote:

Originally Posted by

So, my question is how can I pass the data from one web form to
another web form by clicking abutton.


>

Quote:

Originally Posted by

Thanks- Hide quoted text -


>
- Show quoted text -


When I use Server.Transfer["ProcessForm.aspx"]; my btn_click event
it gives me following error message

only assignments, call, increment, decrement, and new object
expressions can be used as a statement

cannot apply indexing with [] to an expression of type 'method group'
Ysgrifennodd bbawa1@.yahoo.com:

Quote:

Originally Posted by

I have a web form welcome.asp and it has three textboxes and two
dropdown list. It has one button called Submit.
>
when I click that button it should pass all the data from text boxes
and dropdown lists to another web form named processform.aspx.
>
So, my question is how can I pass the data from one web form to
another web form by clicking abutton.
>
Thanks
>


I take the view that computer programs are usually modeling some real
world object or objects. I therefore construct server side object(s)
that store information entered via Pages in its/their state variables
(fields/properties/attributes).

On submit, I do any validation of the data that is required, store the
data in the object(s) and then store a reference to the object(s) in the
Session.

It is then a simple matter to retrieve that object and its data from the
Session in any subsequent form.

HTH

Peter
ASP.NET provides a plethora of ways to pass data between pages.
I've detailed virtually every technique here:
http://SteveOrr.net/articles/PassData.aspx
--
I hope this helps,
Steve C. Orr,
MCSD, MVP, CSM, ASPInsider
http://SteveOrr.net
<bbawa1@.yahoo.comwrote in message
news:1181585117.479238.102680@.n15g2000prd.googlegr oups.com...

Quote:

Originally Posted by

>I have a web form welcome.asp and it has three textboxes and two
dropdown list. It has one button called Submit.
>
when I click that button it should pass all the data from text boxes
and dropdown lists to another web form named processform.aspx.
>
So, my question is how can I pass the data from one web form to
another web form by clicking abutton.
>
Thanks
>

passing values to showmodal dialog

I have parent.aspx web page from which I call a modal dialog (child.aspx via
showmodaldialog). I'd like to populate two text boxes, <asp:TextBox id=txt
_HN> on the child form with data from the caller.
for parent.aspx....
<script> block
function UpdH(title,horse)
{
var iParms=new Object();
iParms.Name=horse;
...}
for child.aspx...
<script> block
I've tried "document.getElementById('txt_HN').value=iParms.Horse;" within ch
ild.aspx form - but get error "document.getElementbyId(...) is null or not a
n object". How do I do this?David,
Try dialogArguments.window.document.getElementById....
using the following to open your window in java script:
var TestWindow = new Object();
TestWindow.caller = window.showModalDialog(URLstr, window, sFeatures);
replacing the parameters there with whatever you use as appropriate.
Raymond Lewallen
"DavidS" <DavidS@.discussions.microsoft.com> wrote in message
news:564EE97A-8C7D-4E35-B034-99BB78A95904@.microsoft.com...
> I have parent.aspx web page from which I call a modal dialog (child.aspx
via showmodaldialog). I'd like to populate two text boxes, <asp:TextBox
id=txt_HN> on the child form with data from the caller.
> for parent.aspx....
> <script> block
> function UpdH(title,horse)
> {
> var iParms=new Object();
> iParms.Name=horse;
> ...}
> for child.aspx...
> <script> block
> I've tried "document.getElementById('txt_HN').value=iParms.Horse;" within
child.aspx form - but get error "document.getElementbyId(...) is null or not
an object". How do I do this?

passing values to showmodal dialog

I have parent.aspx web page from which I call a modal dialog (child.aspx via showmodaldialog). I'd like to populate two text boxes, <asp:TextBox id=txt_HN> on the child form with data from the caller.
for parent.aspx....
<script> block
function UpdH(title,horse)
{
var iParms=new Object();
iParms.Name=horse;
...}
for child.aspx...
<script> block
I've tried "document.getElementById('txt_HN').value=iParms.Hor se;" within child.aspx form - but get error "document.getElementbyId(...) is null or not an object". How do I do this?David,

Try dialogArguments.window.document.getElementById... .

using the following to open your window in javascript:

var TestWindow = new Object();
TestWindow.caller = window.showModalDialog(URLstr, window, sFeatures);

replacing the parameters there with whatever you use as appropriate.

Raymond Lewallen

"DavidS" <DavidS@.discussions.microsoft.com> wrote in message
news:564EE97A-8C7D-4E35-B034-99BB78A95904@.microsoft.com...
> I have parent.aspx web page from which I call a modal dialog (child.aspx
via showmodaldialog). I'd like to populate two text boxes, <asp:TextBox
id=txt_HN> on the child form with data from the caller.
> for parent.aspx....
> <script> block
> function UpdH(title,horse)
> {
> var iParms=new Object();
> iParms.Name=horse;
> ...}
> for child.aspx...
> <script> block
> I've tried "document.getElementById('txt_HN').value=iParms.Hor se;" within
child.aspx form - but get error "document.getElementbyId(...) is null or not
an object". How do I do this?

Passing variable between asp login page and the redirected page

Hi All

I have an asp.net 2.0 web with a standard login control

I want to pass some extra variables to the redirected page after the successful login

I just can't get it to work. help much appreciated

--------------------------
Protected Sub Login1_Authenticate(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.AuthenticateEventArgs) Handles Login1.Authenticate

Context.Items.Clear()

Context.Items.Add("UserNamevalue", Me.Login1.UserName)

Context.Items.Add("mydbkeyvalue", 2)

FormsAuthentication.RedirectFromLoginPage("steve", False)

Server.Transfer("~/memberpages/demos.aspx", True)

End If

Catch ex As Exception

Response.Write(ex.Message)

End Try

End Sub

---------------------------------------

In a link button onclick event on the demos.aspx

Me.lblsamupdate.Text = "Context " & Context.Items("UserNamevalue").ToString

I get error 'Object reference not set to an instance of an object'

Why???Hello Steve,

did you check that u have this variable in the context in receiver?

--
WBR,
Michael Nemtsev [.NET/C# MVP] :: blog: http://spaces.live.com/laflour
"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo

SHi All
S>
SI have an asp.net 2.0 web with a standard login control
S>
SI want to pass some extra variables to the redirected page after the
Ssuccessful login
S>
SI just can't get it to work. help much appreciated
S>
S---------------------
S------
S>
SProtected Sub Login1_Authenticate(ByVal sender As Object, ByVal e As
SSystem.Web.UI.WebControls.AuthenticateEventArgs) Handles
SLogin1.Authenticate
S>
SContext.Items.Clear()
S>
SContext.Items.Add("UserNamevalue", Me.Login1.UserName)
S>
SContext.Items.Add("mydbkeyvalue", 2)
S>
SFormsAuthentication.RedirectFromLoginPage("steve", False)
S>
SServer.Transfer("~/memberpages/demos.aspx", True)
S>
SEnd If
S>
SCatch ex As Exception
S>
SResponse.Write(ex.Message)
S>
SEnd Try
S>
SEnd Sub
S>
S---------------------
S-------------------
S>
SIn a link button onclick event on the demos.aspx
S>
SMe.lblsamupdate.Text = "Context " &
SContext.Items("UserNamevalue").ToString
S>
SI get error 'Object reference not set to an instance of an object'
S>
SWhy???
S>
Steve.
I don't see how you can expect this to work:

FormsAuthentication.RedirectFromLoginPage("steve", False)
Server.Transfer("~/memberpages/demos.aspx", True)

Your first line causes the browser to request the redirect page.
the second line (Server.Transfer) will never execute.

Also, you could either stick the items into a cookie(s) or put them in
Session.

-- Peter
// Abandon all hope, ye who enter here.
http://www.eggheadcafe.com
unBlog: http://petesbloggerama.blogspot.com
BlogMetaFinder: http://www.blogmetafinder.com
"Steve" wrote:

Quote:

Originally Posted by

Hi All
>
I have an asp.net 2.0 web with a standard login control
>
I want to pass some extra variables to the redirected page after the successful login
>
I just can't get it to work. help much appreciated
>
--------------------------
Protected Sub Login1_Authenticate(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.AuthenticateEventArgs) Handles Login1.Authenticate
>
Context.Items.Clear()
>
Context.Items.Add("UserNamevalue", Me.Login1.UserName)
>
Context.Items.Add("mydbkeyvalue", 2)
>
FormsAuthentication.RedirectFromLoginPage("steve", False)
>
Server.Transfer("~/memberpages/demos.aspx", True)
>
End If
>
Catch ex As Exception
>
Response.Write(ex.Message)
>
End Try
>
End Sub
>
---------------------------------------
>
In a link button onclick event on the demos.aspx
>
Me.lblsamupdate.Text = "Context " & Context.Items("UserNamevalue").ToString
>
I get error 'Object reference not set to an instance of an object'
>
>
>
Why???
>

Passing variable from Sub to Sub

How do I pass the value to

Public Sub DeliverFile(ByVal Page As System.Web.UI.Page, _
ByVal Data() As Byte, ByVal Type As String, _
ByVal Length As Integer, _
Optional ByVal DownloadFileName As String = "")

Suppose I have a sub that get the connection as below?

sub connect(sender As Object, e As EventArgs)
dim cnn as string = "dsn=fyp; uid=root; pwd="
dim oconn as new odbcconnection(cnn)
dim sql as string
sql = "Select * From ReportSubmission Where StudentID = 'WeiSiong';"
dim cmd as odbccommand
cmd = new odbccommand(sql, oconn)
oconn.open
cmd.executereader
oconn.close
end sub
You have to explain yourself. What values are you getting from database, what kind of data types are they. What do want to do with these values and your method?
To get the data and put it into a dataset (a collection of data that ASP.NEt controls natively bind to) you would use the following function:

Function GetData(ByVal StudentID As String) As System.Data.DataSet
Dim connectionString As String = "Insert your connection string here"
Dim dbConnection As System.Data.IDbConnection = New System.Data.OleDb.OleDbConnection(connectionString)
Dim query As String = "SELECT * FROM ReportSubmission WHERE StudentID = @.StudentID"
Dim dbCommand As System.Data.IDbCommand = New System.Data.OleDb.OleDbCommand
dbCommand.CommandText = query
dbCommand.Connection = dbConnection

Dim paramSID As System.Data.IDataParameter = New System.Data.OleDb.OleDbParameter
paramSID.ParameterName = "@.StudentID"
paramSID.Value = StudentID
paramSID.DbType = System.Data.DbType.String
dbCommand.Parameters.Add(paramSID)

Dim dataAdapter As System.Data.IDbDataAdapter = New System.Data.OleDb.OleDbDataAdapter
dataAdapter.SelectCommand = dbCommand
Dim ds As System.Data.DataSet = New System.Data.DataSet
dataAdapter.Fill(dataSet)
Return ds
End Function

Then, in order to access the dataset within your code you would call the function as follows


dim yourdata as string = GetData("WeiSiong").tables(0).rows(0).item("Name of column in the database that you want to read from")

Passing Variable To Controls

If we have a web page in which any simple control is present for example a TextBox

<asp:TextBoxID="TextBox1"runat="server"Text=""></asp:TextBox>

Now in code file a public variable is defined like

publicstring txtValue ="Khan";

Now I want to assign thetxtValue inText filed of TextBox Just like

<asp:TextBoxID="TextBox1"runat="server"Text="<%=txtValue%>"></asp:TextBox>

But this approach is not working.

Can anyone tell it?

Modify your markup to:

<asp:TextBox ID="TextBox1" runat="server" Text='<%# GetValue %>' />
 Then you should make an at least protected function in your code behind to return the string:
 
protected string GetValue(){return txtValue;}

I have tried it but it is getting error.

Please check it on you own side.


This syntax should work. I've used it a dozen times in my apps.

What is the error you're getting?


Default.aspx.cs

using System;

using System.Data;

using System.Configuration;

using System.Collections;

using System.Web;

using System.Web.Security;

using System.Web.UI;

using System.Web.UI.WebControls;

using System.Web.UI.WebControls.WebParts;

using System.Web.UI.HtmlControls;

publicpartialclass_Default : System.Web.UI.Page

{

privatestring txtValue ="Zeeshan";protectedstring GetValue()

{

return txtValue;

}

}

Default.aspx

<%@.PageLanguage="C#"AutoEventWireup="true"CodeFile="Default.aspx.cs"Inherits="_Default"Debug="true" %>

<!DOCTYPEhtmlPUBLIC"-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<htmlxmlns="http://www.w3.org/1999/xhtml">

<headrunat="server">

<title>Untitled Page</title>

</head>

<body>

<formid="form1"runat="server">

<div>

<asp:TextBoxID="TextBox1"runat="server"Text="<%# GetValue %>"></asp:TextBox>

</div>

</form>

</body>

</html>

And the error which I am getting is

Error 1 The best overloaded method match for 'System.Convert.ToString(object, System.IFormatProvider)' has some invalid arguments D:\New Project\dawateislamix.net\Default.aspx 12

Error 2 Argument '1': cannot convert from 'method group' to 'object' D:\New Project\dawateislamix.net\Default.aspx 12


Can you try with<asp:TextBoxID="TextBox1"runat="server"Text="<%# GetValue() %>"></asp:TextBox>


Modify your html as follows:

<asp:TextBoxID="TextBox1"runat="server"Text="<%# GetValue() %>"></asp:TextBox>


There is not any error now.

But still the value is not passed to the control.


Pls try to set the value in

Page_Load() event.

txtValue ="Zeeshan" ;


Default2.aspx

<%@.PageLanguage="C#"AutoEventWireup="true"CodeFile="Default2.aspx.cs"Inherits="Default2" %>

<!DOCTYPEhtmlPUBLIC"-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<htmlxmlns="http://www.w3.org/1999/xhtml">

<headrunat="server">

<title>Untitled Page</title>

</head>

<body>

<formid="form1"runat="server">

<div>

<asp:textboxID="Textbox1"runat="server"Text="<%# GetValue() %>"></asp:textbox>

</div>

</form>

</body>

</html>

Default2.aspx.cs

using System;

using System.Data;

using System.Configuration;

using System.Collections;

using System.Web;

using System.Web.Security;

using System.Web.UI;

using System.Web.UI.WebControls;

using System.Web.UI.WebControls.WebParts;

using System.Web.UI.HtmlControls;

publicpartialclassDefault2 : System.Web.UI.Page

{

privatestring txtValue;protectedstring GetValue()

{

return txtValue;

}

protectedvoid Page_Load(object sender,EventArgs e)

{

txtValue ="Zeeshan";

}

}

Please check it.

It still does not show the text.


sorry guys its as simple as this

in your code behind you have this

publicpartialclasscodedisplay : System.Web.UI.Page

{

privatestring txtValue ="Zeeshan";protectedvoid Page_Load(object sender,EventArgs e)

{

TextBox1.Text = txtValue;

}

}

and in your aspx you have this

<asp:TextBoxID="TextBox1"runat="server"/>

with all form and html elements.

Good luck


You can do it in your code behind instead of in your markup:

protectedvoid Page_Load(object sender,EventArgs e)

{

if (!IsPostBack)

TextBox1.Text = GetValueStr();

}

privatestring txtValue ="test";protectedstring GetValueStr()

{

return txtValue;

}


But If I want to do it on Mark up then.


Well if you want to do it on mark up then, put it straight in

text="Zeeshan"

text is a property and hence

Don't use code blocks in ASPNET. Avoid if you can avoid it because they are written for backward compatability; instead write an event handler or startup routine in the codebehind which populates the property on the control as necessary.

For example, you could do it in Page_Load - but be sure to surround it with if (! PostBack) so that the value doesn't get overwritten when posting back.

In late binding controls i.e. say a textbox in a gridview etc, you can databind but that again uses reflection etc and hence is slow.


Hi,

If you have to do it in the markup use single quotes instead Text='<%=MyPublicVariable %>'

HTH

Saturday, March 24, 2012

passing variables between controls

I have a default page that loads a few web user controls like below

pnl_header.Controls.Add(Page.LoadControl("control\\header.ascx"));
pnl_body.Controls.Add(Page.LoadControl("control\\list_topic.ascx"));

And I have some information which is the same for each control and I do not want to do a SQL call every time for each control so I was wondering what is the best way to call the info once and then share the information between all the controls.

TIA.
AlvinYou could call on the sql on the first application load event. Then you could add the object to cache.

Cache["myCache"] = myDataSet; // for instance

if(Cache["myCache"]==null){

// Call a method to create the cache

}
esle{

myNewDataSet = (DataSet) Cache["myCache"];
}

Then you can retrieve the info from cache instead of hitting the db everytime.

You could also look at CacheDependencies as you can have the cache automatically refresh based on a change event - although this may not be necessary since you connecting to a db.

Hope that helps
This is just what I needed. Thanks Keith

passing variables between pages

I have a web app that searches a database and returns a datagrid table.
the user inputs the search terms into a textbox. The user selects the
info he wants and it sends him to a 2nd page, after another selection
it goes to a 3rd page. I have been able to pass the search term in my
textbox back and forth to all the pages using Context.items. Now the
user may click a button that is supposed to take him back to the first
page and reload the original datagrid. How do I get the variable
containing the search terms from the 3rd page back to the 1st page and
automatically perform the search or is there another way to recall the
datagrid? thanks.Why won't you put it in a session variable?

Eliyahu

<lacombpcs@.juno.com> wrote in message
news:1117539066.532083.18140@.g49g2000cwa.googlegro ups.com...
> I have a web app that searches a database and returns a datagrid table.
> the user inputs the search terms into a textbox. The user selects the
> info he wants and it sends him to a 2nd page, after another selection
> it goes to a 3rd page. I have been able to pass the search term in my
> textbox back and forth to all the pages using Context.items. Now the
> user may click a button that is supposed to take him back to the first
> page and reload the original datagrid. How do I get the variable
> containing the search terms from the 3rd page back to the 1st page and
> automatically perform the search or is there another way to recall the
> datagrid? thanks.
You could session variables (as already mentioned), you could still use
context items provided you know what the originating page was (ie. the fact
it came from the 3rd page). You could use an argument in the URL/query
string to set this. You could also save his info to a database, and use the
query string info to flag a reload of that info from the database.

There are many options.

--

- Paul Glavich
ASP.NET MVP
ASPInsider (www.aspinsiders.com)

<lacombpcs@.juno.com> wrote in message
news:1117539066.532083.18140@.g49g2000cwa.googlegro ups.com...
> I have a web app that searches a database and returns a datagrid table.
> the user inputs the search terms into a textbox. The user selects the
> info he wants and it sends him to a 2nd page, after another selection
> it goes to a 3rd page. I have been able to pass the search term in my
> textbox back and forth to all the pages using Context.items. Now the
> user may click a button that is supposed to take him back to the first
> page and reload the original datagrid. How do I get the variable
> containing the search terms from the 3rd page back to the 1st page and
> automatically perform the search or is there another way to recall the
> datagrid? thanks.

passing variables between pages

I have a web app that searches a database and returns a datagrid table.
the user inputs the search terms into a textbox. The user selects the
info he wants and it sends him to a 2nd page, after another selection
it goes to a 3rd page. I have been able to pass the search term in my
textbox back and forth to all the pages using Context.items. Now the
user may click a button that is supposed to take him back to the first
page and reload the original datagrid. How do I get the variable
containing the search terms from the 3rd page back to the 1st page and
automatically perform the search or is there another way to recall the
datagrid? thanks.can u keep the search variables in session?
bineesh
<lacombpcs@.juno.com> wrote in message
news:1117539066.532083.18140@.g49g2000cwa.googlegroups.com...
> I have a web app that searches a database and returns a datagrid table.
> the user inputs the search terms into a textbox. The user selects the
> info he wants and it sends him to a 2nd page, after another selection
> it goes to a 3rd page. I have been able to pass the search term in my
> textbox back and forth to all the pages using Context.items. Now the
> user may click a button that is supposed to take him back to the first
> page and reload the original datagrid. How do I get the variable
> containing the search terms from the 3rd page back to the 1st page and
> automatically perform the search or is there another way to recall the
> datagrid? thanks.
>
Why won't you put it in a session variable?
Eliyahu
<lacombpcs@.juno.com> wrote in message
news:1117539066.532083.18140@.g49g2000cwa.googlegroups.com...
> I have a web app that searches a database and returns a datagrid table.
> the user inputs the search terms into a textbox. The user selects the
> info he wants and it sends him to a 2nd page, after another selection
> it goes to a 3rd page. I have been able to pass the search term in my
> textbox back and forth to all the pages using Context.items. Now the
> user may click a button that is supposed to take him back to the first
> page and reload the original datagrid. How do I get the variable
> containing the search terms from the 3rd page back to the 1st page and
> automatically perform the search or is there another way to recall the
> datagrid? thanks.
>
You could session variables (as already mentioned), you could still use
context items provided you know what the originating page was (ie. the fact
it came from the 3rd page). You could use an argument in the URL/query
string to set this. You could also save his info to a database, and use the
query string info to flag a reload of that info from the database.
There are many options.
- Paul Glavich
ASP.NET MVP
ASPInsider (www.aspinsiders.com)
<lacombpcs@.juno.com> wrote in message
news:1117539066.532083.18140@.g49g2000cwa.googlegroups.com...
> I have a web app that searches a database and returns a datagrid table.
> the user inputs the search terms into a textbox. The user selects the
> info he wants and it sends him to a 2nd page, after another selection
> it goes to a 3rd page. I have been able to pass the search term in my
> textbox back and forth to all the pages using Context.items. Now the
> user may click a button that is supposed to take him back to the first
> page and reload the original datagrid. How do I get the variable
> containing the search terms from the 3rd page back to the 1st page and
> automatically perform the search or is there another way to recall the
> datagrid? thanks.
>

Passing variables between pages [CASE CLOSED]

Hi,
I just wanted to know how can i pass my variables from one web page to the other?
For example, I want to pass the server string on the 1st page to other pages. How do i go around doing it?
Pls helpPassing Parameteres from One Page to another (http://aspnet.4guysfromrolla.com/articles/020205-1.aspx)
Thanks a lot Ali. But I don't really understand C#. Is it possible to explain in VB codes? :blush:
Thanks a lot Ali. But I don't really understand C#. Is it possible to explain in VB codes? :blush:
Ok the easiest way to pass data between pages is to use Query String. Suppose you have two variables ([i] firstName and lastName[i]) on Page1 and you want to pass them onto page2, then on Page1 you can build a url like this Dim redirectUrl As String
redirectUrl = "Page2.aspx?firstName=" & firstName & ";&lastName=" & lastName" And then use the redirect method of response like this Response.Redirect(redirectUrl) And in page2 you can access the querystring variables like this Request.QueryString("firstName")

Does this make any sense?
Ideally, connection strings should be held in the web.config file, which looks something like this:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.web>
<compilation defaultLanguage="vb" debug="true" />
</system.web>
<appSettings>
<add key="ConnectionInfo" value="server=(local);database=Northwind;Integrated Security=SSPI;uid=sa;pwd=sa;" />
</appSettings>
</configuration>

You need to replace the value of the ConnectionInfo key with your own connection string (and you'll probably want to turn debug off at some point, bearing in mind that the settings in this file apply to all of your pages).

You then retrieve this value in your pages using:
ConfigurationSettings.AppSettings("ConnectionInfo")

However, to just pass the contents of a variable (eg. strForeName = "Jim", strSurname = "Jones"), then you can use the QueryString.

First, when you want to get to the new page, you use:
Response.Redirect("some_page.aspx?forename=" & strForeName & "&surname=" & strSurname)

These variables can then be retrieved in some_page.aspx using this syntax:

Dim strForeName As String = Request.QueryString("forename")
Dim strSurname As String = Request.QueryString("surname")

This can be extended for more variables just by extending the line you use when you redirect to some_page.aspx (eg. "some_page.aspx?var1=value&var2=value&var3=value"). Note the use of the question mark for the first value and ampersand for the following values.
Thanks a lot dude! You really solved my problem.
Greatest thanks to Ali. You're the man! :bigyello: :bigyello:

passing variables between web page events & httpmodules events

Use the item property on the httpcontext object. It's a dictionary object
which stores key/pair values but it is available every the httpcontext
object is available.

Regards

--

----
Got TidBits?
Get it here: www.networkip.net/tidbits
"shiv" <kadalli@dotnet.itags.org.hotmail.com> wrote in message
news:082a01c3b295$6d2db890$a501280a@dotnet.itags.org.phx.gbl...
> hi all,
> I need to access some variables which are generated in
> preRequestHandler Event in httpModule. I need these
> variables in Page ButtonControl Click event. Is that
> possible? I don't want to use session variables here. has
> anybody got some inputs here.
> Thanks in advance,
> regards
> shivThanks Alvin,
I too found out the same. You reaffirmed my findings!.
Thanks a millon!

regards
shiv
>--Original Message--
>Use the item property on the httpcontext object. It's a
dictionary object
>which stores key/pair values but it is available every
the httpcontext
>object is available.
>Regards
>--
>
>----
>Got TidBits?
>Get it here: www.networkip.net/tidbits
>"shiv" <kadalli@.hotmail.com> wrote in message
>news:082a01c3b295$6d2db890$a501280a@.phx.gbl...
>> hi all,
>>
>> I need to access some variables which are generated in
>> preRequestHandler Event in httpModule. I need these
>> variables in Page ButtonControl Click event. Is that
>> possible? I don't want to use session variables here.
has
>> anybody got some inputs here.
>> Thanks in advance,
>> regards
>> shiv
>>
>
>.

Passing Variables between web forms

Hi There,
My question is as following,
I have a webform (Webform1) which contains one label control and command
button, when the user clicks the button another webform (Webform2) appears,
webform2 contains only one control which is the Calendar control, I want to
do the following
1- when the user selects a date from the webforms, I want the value
(selected date) appears in the label control in the webform1
2- Webform2 to be closed automatically after the date selection
Kind regards and thanks in advancesearch MSDN for showModalDialog method. That will do just what you're
looking for.
Dale
"Aitham alama" <h_salama@.yahoo.com> wrote in message
news:eSfH8gcZEHA.3716@.TK2MSFTNGP11.phx.gbl...
> Hi There,
> My question is as following,
> I have a webform (Webform1) which contains one label control and command
> button, when the user clicks the button another webform (Webform2)
appears,
> webform2 contains only one control which is the Calendar control, I want
to
> do the following
> 1- when the user selects a date from the webforms, I want the value
> (selected date) appears in the label control in the webform1
> 2- Webform2 to be closed automatically after the date selection
> Kind regards and thanks in advance
>