Thursday, March 29, 2012

passing value to another page

hi,

i would like to redirect to customer.aspx from login aspx.

the code is

response.redirect(customer.aspx)

at the same time, i would like to pass the Login ID to customer.aspx. what code should i use for the customer.aspx as well as login.aspx in order to perform such function?

thanks

christeneThere are several options, of which just a few are:

1. Pass it in the URL
2. Store it in a session variable
3. Send it to the user's machine in a cookie.

Hope this helps,
Russ
well.........

my login is a button.
how i implement URL elements in a button control?

how do we use session variable?..i am not sure abt this....

hope u can explain futher...thanks a lot...

christene
What do you mean "My login is a button"? Can you tell me exactly what you have going on?
haha.....it means....

after the user type in the user name n password...they will click on a LOGIN BUTTON in order to log in....

well,i have done some testing using URL and it works...

response.redirect(customer.aspx?cusName = "& CustomerName &"")

on the customer.aspx,

Request.params("cusName")

right?

however, can u pls explain what is session variable?...i have heard about this but not sure what it is and how it works.....can u?

thanks...

christene
There is a good article on MSDN should you passing server control values between pages at
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconpassingservercontrolvaluesbetweenpages.asp

Passing Value Query

Hi,

I have an e-commerce website written in asp 1.1, vb.net and utilising an access database. Within the database I have a ProductID value to identify each product. Within the following sub procedure I want to be able to reference this value as I want to be able to check if there are enough items in stock. The code below uses the cartitemID and quantity as variables. However to reference individual items in the database I surely will need to pass the ProductID value. How should I approach this ?

[CODE]

Sub dgCart_Update(sender As Object, e As DataGridCommandEventArgs)

Dim intCartitemID As Integer
Dim txtQuantity As TextBox
Dim intQuantity As Integer

'Passes ProductID as sender

'Dim intProductID As Integer ??

intCartitemID = dgCart.DataKeys(e.Item.ItemIndex)
txtQuantity = e.Item.FindControl("txtQuantity")
intQuantity = txtQuantity.Text

'Define intQuantityInStock and reference to CheckQuantity function
Dim intQuantityInStock As Integer = CheckQuantity(intProductID)

'If statement to check enough quantity in stock
If intQuantityInStock < intQuantity
lblError.Text = "This item is currently low in stock. Please select an alternative</b>"
lblError.Visible = True
Else
Dim strSQL As String = "UPDATE [tblCartItems] SET [intQuantityOrder]=@dotnet.itags.org.Quantity WHERE "& _
"intCartitemID = @dotnet.itags.org.intCartitemID"

Dim dbCommand As New OleDbCommand(strSQL, dbConnection)

Dim cmd As New OleDbCommand

dbCommand.Parameters.Add("@dotnet.itags.org.Quantity", intQuantity)
dbCommand.Parameters.Add("@dotnet.itags.org.intCartitemID", intCartitemID)

dbConnection.Open()
dbCommand.ExecuteNonQuery()
dbConnection.Close()

dgCart.EditItemIndex = -1
dgCart.DataSource = DisplayCart()
dgCart.DataBind()

End If

End Sub
[/CODE]

You should be able to set this value in, say the CommandArgument of the button that is being clicked

ex:

<asp:Button
ID="btnAddToCart" runat="server"
CommandArgument='<%# Eval( "ProductID" ) %>'
CommandName="Product"
Text="Add To Cart" />

Then in your code behind, assign intProductID = (int) e.CommandArgument

Depending on what else you are doing with your grid, you may have to wrap an "if" around some code, checking if e.CommandName == "Product"


Thanks - unfortunately I'm not using a button in this instance. How else could I approach it ?


Fixed it thanks

passing value using eventargs

is there a way to pass values using the eventargs of a certain event, lets
say onclick?? or how does everyone else pass values? lets say each button
has 5 things (string, ints, etc) it needs to know, how can you pass that to
the event handler?One option is to utilize the commandarguments argument.
it's a read write property of the control retrievable thru event args ex.
e.commandname

"memememe" <[rem]casolorz[rem]@.hot[rem]mail.com> wrote in message
news:q9iOa.647787$vU3.612940@.news1.central.cox.net ...
> is there a way to pass values using the eventargs of a certain event, lets
> say onclick?? or how does everyone else pass values? lets say each button
> has 5 things (string, ints, etc) it needs to know, how can you pass that
to
> the event handler?
"Alvin Bruney" <vapordan_spam_me_not@.hotmail_no_spamhotmail.com> wrote in
message news:edMGAILRDHA.3144@.tk2msftngp13.phx.gbl...
> One option is to utilize the commandarguments argument.
> it's a read write property of the control retrievable thru event args ex.
> e.commandname
> "memememe" <[rem]casolorz[rem]@.hot[rem]mail.com> wrote in message
> news:q9iOa.647787$vU3.612940@.news1.central.cox.net ...
> > is there a way to pass values using the eventargs of a certain event,
lets
> > say onclick?? or how does everyone else pass values? lets say each
button
> > has 5 things (string, ints, etc) it needs to know, how can you pass that
> to
> > the event handler?

I have used that but it wont solve my problem right now (actually not my
problem, someone elses) because they are using the onlick event of something
other than a button, and it does not have the command event.
Some .Net Event classes contain data in them. It sounds like you might need
to create a custom Event Class and Event Handler delegate, in order to pass
the data you specifically need. Is that correct?

HTH,

Kevin Spencer
Microsoft FrontPage MVP
Internet Developer
http://www.takempis.com
Some things just happen.
Everything else occurs.

"memememe" <[rem]casolorz[rem]@.hot[rem]mail.com> wrote in message
news:q9iOa.647787$vU3.612940@.news1.central.cox.net ...
> is there a way to pass values using the eventargs of a certain event, lets
> say onclick?? or how does everyone else pass values? lets say each button
> has 5 things (string, ints, etc) it needs to know, how can you pass that
to
> the event handler?
"Kevin Spencer" <kevin@.SPAMMERSSUCKtakempis.com> wrote in message
news:OnHHN2LRDHA.940@.TK2MSFTNGP11.phx.gbl...
> Some .Net Event classes contain data in them. It sounds like you might
need
> to create a custom Event Class and Event Handler delegate, in order to
pass
> the data you specifically need. Is that correct?
> HTH,
> Kevin Spencer
> Microsoft FrontPage MVP
> Internet Developer
> http://www.takempis.com
> Some things just happen.
> Everything else occurs.
> "memememe" <[rem]casolorz[rem]@.hot[rem]mail.com> wrote in message
> news:q9iOa.647787$vU3.612940@.news1.central.cox.net ...
> > is there a way to pass values using the eventargs of a certain event,
lets
> > say onclick?? or how does everyone else pass values? lets say each
button
> > has 5 things (string, ints, etc) it needs to know, how can you pass that
> to
> > the event handler?

that would probably actually work (had considered similar scenarios), i just
hope i can convince the person needing that thats the way to go.
What about creating a class that extends lets say htmlanchor and on the
onclick event it passes something on the event args, or it has some
properties that can be read/write?
As to whether you can successfully override an event handler for an existing
class, you would have to check that class to find out. It's not hard to
create a custom Server Control either.

HTH,

Kevin Spencer
Microsoft FrontPage MVP
Internet Developer
http://www.takempis.com
Some things just happen.
Everything else occurs.

"memememe" <[rem]casolorz[rem]@.hot[rem]mail.com> wrote in message
news:vUjOa.648127$vU3.216888@.news1.central.cox.net ...
> "Kevin Spencer" <kevin@.SPAMMERSSUCKtakempis.com> wrote in message
> news:OnHHN2LRDHA.940@.TK2MSFTNGP11.phx.gbl...
> > Some .Net Event classes contain data in them. It sounds like you might
> need
> > to create a custom Event Class and Event Handler delegate, in order to
> pass
> > the data you specifically need. Is that correct?
> > HTH,
> > Kevin Spencer
> > Microsoft FrontPage MVP
> > Internet Developer
> > http://www.takempis.com
> > Some things just happen.
> > Everything else occurs.
> > "memememe" <[rem]casolorz[rem]@.hot[rem]mail.com> wrote in message
> > news:q9iOa.647787$vU3.612940@.news1.central.cox.net ...
> > > is there a way to pass values using the eventargs of a certain event,
> lets
> > > say onclick?? or how does everyone else pass values? lets say each
> button
> > > has 5 things (string, ints, etc) it needs to know, how can you pass
that
> > to
> > > the event handler?
> > > that would probably actually work (had considered similar scenarios), i
just
> hope i can convince the person needing that thats the way to go.
> What about creating a class that extends lets say htmlanchor and on the
> onclick event it passes something on the event args, or it has some
> properties that can be read/write?

passing values

hi guys, hello :) im new to asp.net and come from php "gasp" - anyway, i have a list of car categories and when i click an item i want it to populate the datalist with the data, ie - if you click Car1 = select * from Car1.

I already have a search facility, which calls a stored procedure which loads the data by part number. but im not sure how to do this.

the categories are in the same form, so once a category is clicked it loads the data into the same formI'm not sure I follow what the issue is... Having a button postback? Generating the results? Displaying the results?
Hi curt sorry if i confused you

basically i have this function set up

sub loaddata(s as object, e as evenargs)
dim cmd as new sqldataadapter("select * from varCategory", objConn)
objDA.Fill(objDS, "parts")
dgData.Datasource= objDS
dgData.Databind()
objconn.close()

ok now on my form i have a list of cars, and what i want it to do is call this procedure when a car is clicked, and pass on the value of that car to varCategory.

how can i do this?

Hi!

You could call it like this:

Try
cmd =New SqlCommand("usp_TrackUser", objConn)
cmd.CommandType = CommandType.StoredProcedure
cmd.Parameters.Clear()
cmd.Parameters.Add("@.varCategory", varCategory)
If objConn.State <> ConnectionState.OpenThen objConn.Open()
'execute or asggin to adpater
cmd.ExecuteNonQuery()
Catch exAs System.Exception
'show the error
EndTry

Review the next article:Call a parameterized SP in SQL

Saludos,


What is this "list"? Dropdown? Grid? Etc?

Most controls have an event you can tie to (Click, etc) you can also usually set the control to "autopostback" and allow this event to cause the page to post....

passing values

is there a way to choose which values to
pass to the server when a form is submited?For each form field in the form, a value will be passed.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"rpp" <rpsur@.yahoo.com> wrote in message
news:8fccfb65.0312110716.52e2e776@.posting.google.c om...
> is there a way to choose which values to
> pass to the server when a form is submited?

Passing Values

Hi

I have two aspx pages in a frame and in the top page[top frame] i am
creating the controls[TextBox etc..] dynamically and putting in a place
holder. I have a hyperlink in this page[top frame] to populate the data in
the bottom aspx page[bottom frame]. When the user clicks this hyperlink i
need to populate the bottom aspx page[bottom aspx page]based on the user
imputs. So i need to pass the values from the top aspx page [top frame] to
bottom aspx page[bottom frame]. how can i achieve this. Please give some
ideas...

Thanks in AdvanceSince these are just aspx pages, you should be able to the querystring, or
session variables to pass data between the 2 pages.
"Gibs" <dotnet_Gibs@.yahoo.com> wrote in message
news:uHkXScD5DHA.2412@.TK2MSFTNGP09.phx.gbl...
> Hi
> I have two aspx pages in a frame and in the top page[top frame] i am
> creating the controls[TextBox etc..] dynamically and putting in a place
> holder. I have a hyperlink in this page[top frame] to populate the data in
> the bottom aspx page[bottom frame]. When the user clicks this hyperlink i
> need to populate the bottom aspx page[bottom aspx page]based on the user
> imputs. So i need to pass the values from the top aspx page [top frame] to
> bottom aspx page[bottom frame]. how can i achieve this. Please give some
> ideas...
>
> Thanks in Advance
I am using the hyperlink only to redirect the page. more if i am doing a
postback these text box values are not visible.I am getting an error 'Object
reference not set to an instance of an object'. So i am not able to set the
session also.

"Showjumper" <shojumper@.grkjashdjkf.com> wrote in message
news:uHw0LsD5DHA.1040@.TK2MSFTNGP10.phx.gbl...
> Since these are just aspx pages, you should be able to the querystring, or
> session variables to pass data between the 2 pages.
> "Gibs" <dotnet_Gibs@.yahoo.com> wrote in message
> news:uHkXScD5DHA.2412@.TK2MSFTNGP09.phx.gbl...
> > Hi
> > I have two aspx pages in a frame and in the top page[top frame] i am
> > creating the controls[TextBox etc..] dynamically and putting in a place
> > holder. I have a hyperlink in this page[top frame] to populate the data
in
> > the bottom aspx page[bottom frame]. When the user clicks this hyperlink
i
> > need to populate the bottom aspx page[bottom aspx page]based on the
user
> > imputs. So i need to pass the values from the top aspx page [top frame]
to
> > bottom aspx page[bottom frame]. how can i achieve this. Please give some
> > ideas...
> > Thanks in Advance
> I am using the hyperlink only to redirect the page. more if i am doing a
> postback these text box values are not visible.I am getting an error
'Object
> reference not set to an instance of an object'. So i am not able to set
the
> session also.

The error probably means that you ar using a tag like <asp:Textbox
id="txtPipo"> in your aspx file but you do not declare a matching Textbox
object in your codebehind file like

Textbox txtPipo;

As for passing information, you can append all the data as name-value pairs
to the target url you pass to the redirect statement like

http:/someservername?name=pipo%20%address=woonwagen%20%o ccupation=clown

and then retrieve them through Request.QueryString as Showjumper already
suggested.

> "Showjumper" <shojumper@.grkjashdjkf.com> wrote in message
> news:uHw0LsD5DHA.1040@.TK2MSFTNGP10.phx.gbl...
> > Since these are just aspx pages, you should be able to the querystring,
or
> > session variables to pass data between the 2 pages.
> > "Gibs" <dotnet_Gibs@.yahoo.com> wrote in message
> > news:uHkXScD5DHA.2412@.TK2MSFTNGP09.phx.gbl...
> > > Hi
> > > > I have two aspx pages in a frame and in the top page[top frame] i am
> > > creating the controls[TextBox etc..] dynamically and putting in a
place
> > > holder. I have a hyperlink in this page[top frame] to populate the
data
> > > in the bottom aspx page[bottom frame]. When the user clicks this
> > > hyperlink i need to populate the bottom aspx page[bottom aspx page]
> > > based on the user imputs. So i need to pass the values from the top
> > > aspx page [top frame] to bottom aspx page[bottom frame]. how can
> > > i achieve this. Please give some ideas...
You can pass some values via client side code to a control (or hidden
control) in your other frame.
Here's some javascript code that might do the trick for you:
parent.FRAMENAME.document.form1.myhiddentextbox.va lue='test';

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

"Gibs" <dotnet_Gibs@.yahoo.com> wrote in message
news:uHkXScD5DHA.2412@.TK2MSFTNGP09.phx.gbl...
> Hi
> I have two aspx pages in a frame and in the top page[top frame] i am
> creating the controls[TextBox etc..] dynamically and putting in a place
> holder. I have a hyperlink in this page[top frame] to populate the data in
> the bottom aspx page[bottom frame]. When the user clicks this hyperlink i
> need to populate the bottom aspx page[bottom aspx page]based on the user
> imputs. So i need to pass the values from the top aspx page [top frame] to
> bottom aspx page[bottom frame]. how can i achieve this. Please give some
> ideas...
>
> Thanks in Advance

Passing Values

I know that I can create session variables and pass those values from one
screen to another, but is there not a way to makes variables from one scree
n available to another screen other then session variables? Is there not a
way to create properties in the one screen and then pass some sort of
reference to the screen you are calling?

Can you point me to an example or an article on how to use?

Thanks in advance for your assistance!!!!!!!!Passing Values from Aspx to Aspx

Although ASP.NET usually submits data to the current page for processing,
there are times when you need to pass values from the controls on one page
to controls or routines on another ASP.NET page.
This is a cookbook style tutorial that shows you how to pass from one page
to another. For a deeper explanation, see the Microsoft Help file references
at the bottom of the page.

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

"Jim Heavey" <JimHeavey@.nospam.com> wrote in message
news:Xns948861B2BA553JimHeaveyhotmailcom@.207.46.24 8.16...
>I know that I can create session variables and pass those values from one
> screen to another, but is there not a way to makes variables from one
> scree
> n available to another screen other then session variables? Is there not
> a
> way to create properties in the one screen and then pass some sort of
> reference to the screen you are calling?
> Can you point me to an example or an article on how to use?
> Thanks in advance for your assistance!!!!!!!!
someone asked exactly the same questions like 10 posts before you so check there

Passing values across webforms that use Master pages

Sorry to create a new thread on an old post but I didn't get a viable answer
and thought that the odds were against me getting one unless I started a new
thread.

My question was this:

I want to pass a string variable from default3.aspx to default2.aspx.

I create a property in default2.aspx, called "X", and assign a value. I then
call Server.Transfer("default3.aspx")

In default3.aspx I have this code:
Dim Default3 As Default3 = ctype(Context.Handler, Default3)
Dim PassedString As String = Default3.x

This will work fine as long a default 3 is not a webform that references a
master page.

If it is, it tells me that "Default 3" is an undefined type. As a result,
the only way that I know o get it to work is to turn of Option Strict and
change it to this:

Dim Default3 As Object = Context.Handler
Dim PassedString As String = Default3.x

I really dont want to turn off Option Strict or resort to looselt typed
variables.

How do I correct this?
Chad,
Try either putting the String name=value combo on the querystring, or into
the HttpContext.Current.Items Collection. Not reasonable to expect a
"property" of a page to survive a server.transfer or Response.Redirect.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com

"Chad" wrote:

> Sorry to create a new thread on an old post but I didn't get a viable answer
> and thought that the odds were against me getting one unless I started a new
> thread.
> My question was this:
> I want to pass a string variable from default3.aspx to default2.aspx.
> I create a property in default2.aspx, called "X", and assign a value. I then
> call Server.Transfer("default3.aspx")
> In default3.aspx I have this code:
> Dim Default3 As Default3 = ctype(Context.Handler, Default3)
> Dim PassedString As String = Default3.x
> This will work fine as long a default 3 is not a webform that references a
> master page.
> If it is, it tells me that "Default 3" is an undefined type. As a result,
> the only way that I know o get it to work is to turn of Option Strict and
> change it to this:
> Dim Default3 As Object = Context.Handler
> Dim PassedString As String = Default3.x
> I really dont want to turn off Option Strict or resort to looselt typed
> variables.
> How do I correct this?
>
>
>
>
>
Actually, it does work if you define Default3 as an Object. I was trying to
strongly type the variable Default3 as an object of type "Default3" and it
did not recognize the class "Defaulyt3" outside of the Default3 class.

Try it. It does work.

"Peter Bromberg [C# MVP]" <pbromberg@.yahoo.nospammin.com> wrote in message
news:C28C574E-44C8-4903-B81A-8A970605CBAA@.microsoft.com...
> Chad,
> Try either putting the String name=value combo on the querystring, or into
> the HttpContext.Current.Items Collection. Not reasonable to expect a
> "property" of a page to survive a server.transfer or Response.Redirect.
> Peter
> --
> Co-founder, Eggheadcafe.com developer portal:
> http://www.eggheadcafe.com
> UnBlog:
> http://petesbloggerama.blogspot.com
>
>
> "Chad" wrote:
>> Sorry to create a new thread on an old post but I didn't get a viable
>> answer
>> and thought that the odds were against me getting one unless I started a
>> new
>> thread.
>>
>> My question was this:
>>
>> I want to pass a string variable from default3.aspx to default2.aspx.
>>
>> I create a property in default2.aspx, called "X", and assign a value. I
>> then
>> call Server.Transfer("default3.aspx")
>>
>> In default3.aspx I have this code:
>> Dim Default3 As Default3 = ctype(Context.Handler, Default3)
>> Dim PassedString As String = Default3.x
>>
>> This will work fine as long a default 3 is not a webform that references
>> a
>> master page.
>>
>> If it is, it tells me that "Default 3" is an undefined type. As a result,
>> the only way that I know o get it to work is to turn of Option Strict and
>> change it to this:
>>
>> Dim Default3 As Object = Context.Handler
>> Dim PassedString As String = Default3.x
>>
>> I really dont want to turn off Option Strict or resort to looselt typed
>> variables.
>>
>> How do I correct this?
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>

Passing values between 2 open pages (eg. parent and dialog)

Can someone tell me if there is another way of passing variables back and forth between 2 open pages (such as in the case of a dialog window) without using javascript.

I have done it before using javascript but now that I am using a lot of user controls on my pages I find it a pain in the butt with how the user controls are being named, especially when you have multiple nested controls.

Any help would be greatly appreciated.
Thanks.You could use session variables, but this would require that each of the pages involved do a postback in order to be able to read the session variables. Otherwise, javascript is your best bet.
Alright, thanks mendhak, just thought I would check to see if there was a better way.

Passing Values and Server.Transfer

Hello all.
With a background in ASP, I am finding the work required for passing
values between pages mystifying. For various obvious reasons, I have
eliminated using cookies and session to store state data. The only
ASP.NET options left is to use the Server.Transfer to transfer to page
2 from page 1, and then use the context to get whatever values in page
1 from page 2. I do find this indeed a very elegant solution as now I
can pass objects instead of plain text values.
But the problem is with the out of sync URL when using
Server.Transfer. I am scratching my head as to how anybody can not see
this as a problem. Not only the URL being display is not the same as
the page that you are seeing, it is also consistently one step behind
in a wizard-like sequential pages environment. Is it not confusing as
hell for the users?
Is there a better way to handle such a basic infrastructure problem
(passing values between pages), or am I just stuck in the old ASP
thinking?
Thanks in advance.> But the problem is with the out of sync URL when using
> Server.Transfer. I am scratching my head as to how anybody can not see
> this as a problem. Not only the URL being display is not the same as
> the page that you are seeing, it is also consistently one step behind
> in a wizard-like sequential pages environment. Is it not confusing as
> hell for the users?
Yeah, but the url showing is the url that the browser posted to. Server.Tran
sfer
is all done server side and thus the browser really doesn't know that the
second page is the one that did the rendering. In ASP.NET 2.0 they've introd
uced
cross page postbacks which is the prefered way to accomplish what you're
doing. I posted about this, FWIW:
http://staff.develop.com/ballen/blo.../>
3b8b4f29eaf
-Brock
DevelopMentor
http://staff.develop.com/ballen

Passing Values and Server.Transfer

Hello all.

With a background in ASP, I am finding the work required for passing
values between pages mystifying. For various obvious reasons, I have
eliminated using cookies and session to store state data. The only
ASP.NET options left is to use the Server.Transfer to transfer to page
2 from page 1, and then use the context to get whatever values in page
1 from page 2. I do find this indeed a very elegant solution as now I
can pass objects instead of plain text values.

But the problem is with the out of sync URL when using
Server.Transfer. I am scratching my head as to how anybody can not see
this as a problem. Not only the URL being display is not the same as
the page that you are seeing, it is also consistently one step behind
in a wizard-like sequential pages environment. Is it not confusing as
hell for the users?

Is there a better way to handle such a basic infrastructure problem
(passing values between pages), or am I just stuck in the old ASP
thinking?

Thanks in advance.> But the problem is with the out of sync URL when using
> Server.Transfer. I am scratching my head as to how anybody can not see
> this as a problem. Not only the URL being display is not the same as
> the page that you are seeing, it is also consistently one step behind
> in a wizard-like sequential pages environment. Is it not confusing as
> hell for the users?

Yeah, but the url showing is the url that the browser posted to. Server.Transfer
is all done server side and thus the browser really doesn't know that the
second page is the one that did the rendering. In ASP.NET 2.0 they've introduced
cross page postbacks which is the prefered way to accomplish what you're
doing. I posted about this, FWIW:

http://staff.develop.com/ballen/blo...6c-d3b8b4f29eaf

-Brock
DevelopMentor
http://staff.develop.com/ballen

Passing values across webforms that use Master pages

Sorry to create a new thread on an old post but I didn't get a viable answer
and thought that the odds were against me getting one unless I started a new
thread.
My question was this:
I want to pass a string variable from default3.aspx to default2.aspx.
I create a property in default2.aspx, called "X", and assign a value. I then
call Server.Transfer("default3.aspx")
In default3.aspx I have this code:
Dim Default3 As Default3 = ctype(Context.Handler, Default3)
Dim PassedString As String = Default3.x
This will work fine as long a default 3 is not a webform that references a
master page.
If it is, it tells me that "Default 3" is an undefined type. As a result,
the only way that I know o get it to work is to turn of Option Strict and
change it to this:
Dim Default3 As Object = Context.Handler
Dim PassedString As String = Default3.x
I really dont want to turn off Option Strict or resort to looselt typed
variables.
How do I correct this?Chad,
Try either putting the String name=value combo on the querystring, or into
the HttpContext.Current.Items Collection. Not reasonable to expect a
"property" of a page to survive a server.transfer or Response.Redirect.
Peter
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com
"Chad" wrote:

> Sorry to create a new thread on an old post but I didn't get a viable answ
er
> and thought that the odds were against me getting one unless I started a n
ew
> thread.
> My question was this:
> I want to pass a string variable from default3.aspx to default2.aspx.
> I create a property in default2.aspx, called "X", and assign a value. I th
en
> call Server.Transfer("default3.aspx")
> In default3.aspx I have this code:
> Dim Default3 As Default3 = ctype(Context.Handler, Default3)
> Dim PassedString As String = Default3.x
> This will work fine as long a default 3 is not a webform that references a
> master page.
> If it is, it tells me that "Default 3" is an undefined type. As a result,
> the only way that I know o get it to work is to turn of Option Strict and
> change it to this:
> Dim Default3 As Object = Context.Handler
> Dim PassedString As String = Default3.x
> I really dont want to turn off Option Strict or resort to looselt typed
> variables.
> How do I correct this?
>
>
>
>
>
>
Actually, it does work if you define Default3 as an Object. I was trying to
strongly type the variable Default3 as an object of type "Default3" and it
did not recognize the class "Defaulyt3" outside of the Default3 class.
Try it. It does work.
"Peter Bromberg [C# MVP]" <pbromberg@.yahoo.nospammin.com> wrote in message
news:C28C574E-44C8-4903-B81A-8A970605CBAA@.microsoft.com...
> Chad,
> Try either putting the String name=value combo on the querystring, or into
> the HttpContext.Current.Items Collection. Not reasonable to expect a
> "property" of a page to survive a server.transfer or Response.Redirect.
> Peter
> --
> Co-founder, Eggheadcafe.com developer portal:
> http://www.eggheadcafe.com
> UnBlog:
> http://petesbloggerama.blogspot.com
>
>
> "Chad" wrote:
>

passing values between aspx.vb pages

About javascript window.opener. How do I pass values from source.vb to object.vb if I use window.opener("target.aspx") in a javascript function? I want to use a separate .js file for this purpose.

My code looks something like this.

'Source.aspx
<script ... src="http://pics.10026.com/?src=scripts.js"
<a onclick="newwindow()">text</a
'Source.aspx.vb

variable1 as String
variable2 as Integer

'scripts.js
function newwindow() {
myWin = opener("target.aspx");
}

'Target.aspx.vb

variabletarget1 as String
variabletarget2 as Integer

So, I would like to set variabletarget1 = variable1 and variabletarget2 = variable2 in the process. I am not using frames or iframes. MSDN says that window.opener works only in <frame> or <iframe> pages.

How to do this with javascript?

HenrixHi Henrix,
Somethig like this:


'Source.aspx
<script ... src="http://pics.10026.com/?src=scripts.js"
<a runat="server">text</a
'Source.aspx.vb

variable1 as String
variable2 as Integer
...

a.Attributes.Add("onclick", "newwindow('"& variable1 & "'," & variable2 & ")"

'scripts.js
function newwindow(variable1, variable2) {
myWin = opener("target.aspx?variable1="+variable1+"&variable2="+variable2);
}

'Target.aspx.vb

variabletarget1 as String
variabletarget2 as Integer
...
variabletarget1 = Request.QueryString("variable1")
variabletarget2 = Int32.Parse(Request.QueryString("variable2"))

Passing values between asp.net pages.

In asp you called a new page and passed any variable information through a query string.
Can some one tell me what the best practice is in asp.net to get information from one asp.net page to another ?

Or at least what the options wereYou can do this exactly as you did in ASP.
If you didn't want to continue using the querystring you could use cookies, sessions, or some other choices. But the querystring in a browser is a querystring in a browser - you can read one or create one just as you always did.

passing values between controls

Hi all, learning the asp.net is a slow process... but I am plodderign
along. I have hit a bit of a snag - I have 4 pages of code here...
control1.ascx
control2.ascx
default.asx... default.asx.vb

relevant details (i think) on default.asx:
<uc1:ProductList ID="ProductList1" runat="server"
OnPreRender="getSelectedProduct" />
<uc2:ProductDetails ID="ProductDetails1" runat="server" /
on default.asx.vb:
Protected Sub getSelectedProduct(ByVal sender As Object, ByVal e As
System.EventArgs)
Response.Write("TEST: " & ProductList1.selectedProduct())
End Sub

To this point the system actually works. When i select a product in the
1st User Control, it is displayed on the main page, however, I need to
take this one step further... base what happens in UC2 on what has
happened in UC1.

what would I type in UC2, to reference to get the value of the
selection in UC1 ?You need to think of your user controls as objects...

and as an object, it can expose properties, read and/or write properties.

public string PropertyOfUserControl1
{
get {return "this could be a member variable";}
}

Then you can read the property from uc1, and set a property of uc2.

uc2.PropertyOfUserControl2 = uc1.PropertyOfUserControl1;

If the code behind of uc2...you need to deal with the property you set.

<evandela@.bigpond.net.au> wrote in message
news:1142818077.366768.296410@.g10g2000cwb.googlegr oups.com...
> Hi all, learning the asp.net is a slow process... but I am plodderign
> along. I have hit a bit of a snag - I have 4 pages of code here...
> control1.ascx
> control2.ascx
> default.asx... default.asx.vb
> relevant details (i think) on default.asx:
> <uc1:ProductList ID="ProductList1" runat="server"
> OnPreRender="getSelectedProduct" />
> <uc2:ProductDetails ID="ProductDetails1" runat="server" />
> on default.asx.vb:
> Protected Sub getSelectedProduct(ByVal sender As Object, ByVal e As
> System.EventArgs)
> Response.Write("TEST: " & ProductList1.selectedProduct())
> End Sub
> To this point the system actually works. When i select a product in the
> 1st User Control, it is displayed on the main page, however, I need to
> take this one step further... base what happens in UC2 on what has
> happened in UC1.
> what would I type in UC2, to reference to get the value of the
> selection in UC1 ?

Passing values between contentplaceholders

I have on the same page two ojbectdatasources (ods1, ods2) located in distinct contentplaceholders (CPL1, CPL2). Both are tied to gridviews (grv1, grv2). Objectdatasource ods2 uses grv1 datakey 'ProdCatID' as select parameter. If both ods and grv's are located within the same contentplaceholder, selecting a grv1 value causes ods2 to fire correctly. When the ods and the grv's aremoved to distinct contentplaceholders, firing fails.

Based on the procedure outlined in post: http://forums.asp.net/p/677362/677362.aspx#677362, I tried to substitute 'FormParameter' for 'SelectParameter' to no avail.

Is my code declaration wrong or are there restrictions on using a gridview as select source? (FormField also fails when ods1/grv1 is moved back to the same contentplaceholder.)

TIA for any hints.

1. SelectParameter definition for ods2 when the ods are located in different contentplaceholders with value of 'ctl00$CPL1$grv1' as found in the page html code (does not work):

<SelectParameters> <asp:FormParameter formfield="ctl00$CPL1$grv1" name="ProdCatID" type="Int32"> </asp:FormParameter> </SelectParameters>
2. SelectParameter definition when both ods are located within the same contentplaceholder (works ok):
<asp:ControlParameter controlid="grv1" name="ProdCatID" propertyname="SelectedValue" type="Int32"> </asp:ControlParameter>

Hi Msch,

Based on my understanding, you want to retrieve the data base on the GridView's DataKey value. The GridViews and DataSource controls are in different contentplaceholders. If I have misunderstood you, please feel free to let me know.

If we don't want to place them in the same contentplaceholder, we can bind GridView2 base on the DataKey value of GridView1 in the codebehind. For example:

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">Content1 <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"DataKeyNames="ProductID" DataSourceID="SqlDataSource1" OnSelectedIndexChanged="GridView1_SelectedIndexChanged"> <Columns> <asp:BoundField DataField="ProductID" HeaderText="ProductID" ReadOnly="True" SortExpression="ProductID" /> <asp:BoundField DataField="ProductName" HeaderText="ProductName" SortExpression="ProductName" /> <asp:CommandField ButtonType="Button" ShowSelectButton="True" /> </Columns> </asp:GridView> <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:aspnetforumConnectionString%>" SelectCommand="SELECT [ProductID], [ProductName] FROM [Production]"></asp:SqlDataSource> <br /></asp:Content><asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder2" Runat="Server">Content2 <asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False" DataKeyNames="ProductID"> <Columns> <asp:BoundField DataField="ProductID" HeaderText="ProductID" ReadOnly="True" SortExpression="ProductID" /> <asp:BoundField DataField="ProductName" HeaderText="ProductName" SortExpression="ProductName" /> <asp:BoundField DataField="CategoryName" HeaderText="CategoryName" SortExpression="CategoryName" /> <asp:BoundField DataField="SupplierName" HeaderText="SupplierName" SortExpression="SupplierName" /> </Columns> </asp:GridView> <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:aspnetforumConnectionString%>" SelectCommand="SELECT * FROM [Production] WHERE ([ProductID] = @.ProductID)" OnSelecting="SqlDataSource2_Selecting"> <SelectParameters> <asp:Parameter Name="ProductID" Type="String" /> </SelectParameters> </asp:SqlDataSource></asp:Content>

CodeBehind:

protected void GridView1_SelectedIndexChanged(object sender, EventArgs e) {//Executing Select method to bound the GridView2.GridView2.DataSource = SqlDataSource2.Select(DataSourceSelectArguments.Empty); GridView2.DataBind(); }protected void SqlDataSource2_Selecting(object sender, SqlDataSourceSelectingEventArgs e) {//Get the DataKey of GridView1 and then assign to the SqlDataSource's selectparameter.e.Command.Parameters[0].Value = GridView1.DataKeys[GridView1.SelectedIndex][0].ToString(); }


I hope this helps.

Passing values between client and server side (Javascript to C#)

I would like to access client side values from the code behind.

Say I open a window like this

 popWindow = window.open("data_list.aspx","dataWindow",'toolbar,width=150,height=100')
 How can I get the window name "dataWindow" from that current window or the parent window?
 Any other examples accessing variables between server side (C#) and client side (JavaScript) would be greatly appreciated.
 Regards -WH 

Page.Request.ServerVariables["SCRIPT_NAME"] will get the name of the current page. You can also pass values in a querystring, which will make them accessible to server-side code.
thanks, Page.Request.ServerVariables["SCRIPT_NAME"] worked out for me.

Passing values between forms

(Type your message here)
Hi
I'm new to asp.net and I need some help
I have three forms with some textboxes.I want to pass the values of the text
boxes of form1 and form2 to the third form
For this I'm using in the first form
System.Web.HttpContext.Current.Server.Transfer("secondform.aspx")
also a get function for returning the values of textbox
In the second form
rp1 = CType(context.Current.Handler, firstform)
RegisterHiddenField("txtpjcode", Request("txtpjcode"))
similarly for the second form
But When I run this I can't retrive any values of previous forms
From: Mani P.S
Posted by a user from .NET 247 (http://www.dotnet247.com/)
<Id>vrL66fQqLUe3kVkG/raHIA==</Id>Hi,
see this in MSDN
http://msdn.microsoft.com/library/d...bformspages.asp
HTH
Regards
Joyjit
"Mani P.S via .NET 247" <anonymous@.dotnet247.com> wrote in message
news:u1OdS1pNFHA.1732@.TK2MSFTNGP14.phx.gbl...
> (Type your message here)
> Hi
> I'm new to asp.net and I need some help
> I have three forms with some textboxes.I want to pass the values of the
textboxes of form1 and form2 to the third form
> For this I'm using in the first form
> System.Web.HttpContext.Current.Server.Transfer("secondform.aspx")
> also a get function for returning the values of textbox
> In the second form
> rp1 = CType(context.Current.Handler, firstform)
> RegisterHiddenField("txtpjcode", Request("txtpjcode"))
> similarly for the second form
> But When I run this I can't retrive any values of previous forms
> --
> From: Mani P.S
> --
> Posted by a user from .NET 247 (http://www.dotnet247.com/)
> <Id>vrL66fQqLUe3kVkG/raHIA==</Id>
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.dotnetbips.com/displayarticle.aspx?id=79
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"Mani P.S via .NET 247" <anonymous@.dotnet247.com> wrote in message
news:u1OdS1pNFHA.1732@.TK2MSFTNGP14.phx.gbl...
> (Type your message here)
> Hi
> I'm new to asp.net and I need some help
> I have three forms with some textboxes.I want to pass the values of the
> textboxes of form1 and form2 to the third form
> For this I'm using in the first form
> System.Web.HttpContext.Current.Server.Transfer("secondform.aspx")
> also a get function for returning the values of textbox
> In the second form
> rp1 = CType(context.Current.Handler, firstform)
> RegisterHiddenField("txtpjcode", Request("txtpjcode"))
> similarly for the second form
> But When I run this I can't retrive any values of previous forms
> --
> From: Mani P.S
> --
> Posted by a user from .NET 247 (http://www.dotnet247.com/)
> <Id>vrL66fQqLUe3kVkG/raHIA==</Id>

Passing values between forms

(Type your message here)
Hi
I'm new to asp.net and I need some help
I have three forms with some textboxes.I want to pass the values of the textboxes of form1 and form2 to the third form
For this I'm using in the first form
System.Web.HttpContext.Current.Server.Transfer("secondform.aspx")
also a get function for returning the values of textbox
In the second form
rp1 = CType(context.Current.Handler, firstform)
RegisterHiddenField("txtpjcode", Request("txtpjcode"))
similarly for the second form
But When I run this I can't retrive any values of previous forms

----------
From: Mani P.S

--------
Posted by a user from .NET 247 (http://www.dotnet247.com/)

<Id>vrL66fQqLUe3kVkG/raHIA==</Id>Hi,

see this in MSDN
http://msdn.microsoft.com/library/d...bformspages.asp

HTH
Regards

Joyjit

"Mani P.S via .NET 247" <anonymous@.dotnet247.com> wrote in message
news:u1OdS1pNFHA.1732@.TK2MSFTNGP14.phx.gbl...
> (Type your message here)
> Hi
> I'm new to asp.net and I need some help
> I have three forms with some textboxes.I want to pass the values of the
textboxes of form1 and form2 to the third form
> For this I'm using in the first form
> System.Web.HttpContext.Current.Server.Transfer("secondform.aspx")
> also a get function for returning the values of textbox
> In the second form
> rp1 = CType(context.Current.Handler, firstform)
> RegisterHiddenField("txtpjcode", Request("txtpjcode"))
> similarly for the second form
> But When I run this I can't retrive any values of previous forms
> ----------
> From: Mani P.S
> --------
> Posted by a user from .NET 247 (http://www.dotnet247.com/)
> <Id>vrL66fQqLUe3kVkG/raHIA==</Id
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.dotnetbips.com/displayarticle.aspx?id=79

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

"Mani P.S via .NET 247" <anonymous@.dotnet247.com> wrote in message
news:u1OdS1pNFHA.1732@.TK2MSFTNGP14.phx.gbl...
> (Type your message here)
> Hi
> I'm new to asp.net and I need some help
> I have three forms with some textboxes.I want to pass the values of the
> textboxes of form1 and form2 to the third form
> For this I'm using in the first form
> System.Web.HttpContext.Current.Server.Transfer("secondform.aspx")
> also a get function for returning the values of textbox
> In the second form
> rp1 = CType(context.Current.Handler, firstform)
> RegisterHiddenField("txtpjcode", Request("txtpjcode"))
> similarly for the second form
> But When I run this I can't retrive any values of previous forms
> ----------
> From: Mani P.S
> --------
> Posted by a user from .NET 247 (http://www.dotnet247.com/)
> <Id>vrL66fQqLUe3kVkG/raHIA==</Id

passing values between different projects

Hi,
I h ave one project in C# and the other one in vb.net. I want one of the VB.net webforms to pass a value to C#'s webform. how can I do this ?

Thanks,If they're published to the same website, you can post the values in the Query String or store the values into session. The difference in languages does not matter.

passing values between controls

Hi all, learning the asp.net is a slow process... but I am plodderign
along. I have hit a bit of a snag - I have 4 pages of code here...
control1.ascx
control2.ascx
default.asx... default.asx.vb
relevant details (i think) on default.asx:
<uc1:ProductList ID="ProductList1" runat="server"
OnPreRender="getSelectedProduct" />
<uc2:ProductDetails ID="ProductDetails1" runat="server" />
on default.asx.vb:
Protected Sub getSelectedProduct(ByVal sender As Object, ByVal e As
System.EventArgs)
Response.Write("TEST: " & ProductList1.selectedProduct())
End Sub
To this point the system actually works. When i select a product in the
1st User Control, it is displayed on the main page, however, I need to
take this one step further... base what happens in UC2 on what has
happened in UC1.
what would I type in UC2, to reference to get the value of the
selection in UC1 ?You need to think of your user controls as objects...
and as an object, it can expose properties, read and/or write properties.
public string PropertyOfUserControl1
{
get {return "this could be a member variable";}
}
Then you can read the property from uc1, and set a property of uc2.
uc2.PropertyOfUserControl2 = uc1.PropertyOfUserControl1;
If the code behind of uc2...you need to deal with the property you set.
<evandela@.bigpond.net.au> wrote in message
news:1142818077.366768.296410@.g10g2000cwb.googlegroups.com...
> Hi all, learning the asp.net is a slow process... but I am plodderign
> along. I have hit a bit of a snag - I have 4 pages of code here...
> control1.ascx
> control2.ascx
> default.asx... default.asx.vb
> relevant details (i think) on default.asx:
> <uc1:ProductList ID="ProductList1" runat="server"
> OnPreRender="getSelectedProduct" />
> <uc2:ProductDetails ID="ProductDetails1" runat="server" />
> on default.asx.vb:
> Protected Sub getSelectedProduct(ByVal sender As Object, ByVal e As
> System.EventArgs)
> Response.Write("TEST: " & ProductList1.selectedProduct())
> End Sub
> To this point the system actually works. When i select a product in the
> 1st User Control, it is displayed on the main page, however, I need to
> take this one step further... base what happens in UC2 on what has
> happened in UC1.
> what would I type in UC2, to reference to get the value of the
> selection in UC1 ?
>

Passing values between pages

Hello everyone, I am very new to ASP.NET and in fact I am working on my first real project and I am in need to some assistance.

I want to pass values from one page to another after clicking on a button and get the values in the page_load routine of the called page.

Can someone tell me how to do this?

Presently my code looks something like this:

Coding of the button click event
I have declared a hidden field on page 1 and called it hidMerchantName, in the click event I am doing the following:

hidMerchantName.Value = dMerchantName.Text
Server.Transfer("~/Statements.aspx", True)

Now on page 2 I want to be able to get the value of hidMerchantName

If you guys also have a better way of passing values please let me know

Hi,

Read this:

http://steveorr.net/faq/PassValues.aspx and also this:

http://odetocode.com/Articles/421.aspx


There are many articles that target your question. I suggest you check out the article below:

Passing values from one page to another
Just go to following link:

http://dkuldeep.blogspot.com/2006/01/posting-to-other-pages-aspnet-20.html

just assume txtName as hidMerchantName.

Regards

Kuldeep Deokule

Passing values between pages

I'm attempting to pass values between a couple of webpages in Visual Studio Express 2008. I feel I'm almost there, but I can't get the info to display on the second page. BTW I'm using master and code behind pages.

Here's the code:

page1.aspx
=========

<%@dotnet.itags.org. Page Language="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="false" CodeFile="page1.aspx.vb" Inherits="page1" title="Untitled Page" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">

<asp:Label ID="Label1" runat="server" Text="First Name:"></asp:Label> <asp:TextBox id="txtFirst" runat="server" /><br>
<asp:Label ID="Label2" runat="server" Text="Last Name:"></asp:Label> <asp:TextBox id="txtLast" runat="server" />
<asp:Button id="button1" Text="Submit" onclick="doSubmit" runat="server" />

</asp:Content>page1.aspx.vb=============Partial Class page1 Inherits System.Web.UI.Page Sub doSubmit(ByVal Source As Object, ByVal E As EventArgs) Context.Items.Add("first", txtFirst.text) Context.Items.Add("last", txtLast.text) Server.Transfer("Page2.aspx") End SubEnd Classpage2.aspx========<%@dotnet.itags.org. Page Language="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="false" CodeFile="page2.aspx.vb" Inherits="page2" title="Untitled Page" %><asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"><asp:Label ID="Label1" runat="server"></asp:Label></asp:Content>page2.aspx.vb==========Partial Class page2 Inherits System.Web.UI.Page Sub Page_Load(ByVal Source As Object, ByVal E As EventArgs) Label1.Text = "The Name you entered was : " & Context.Items("first") & " " & Context.Items("last") End SubEnd Class
 Hopefully someone with more experience can help me solve what seems a relitively simple process. 
 
TIA
Steve

Check below link

Ways to pass data between webforms

HC


Try this:

/////////////////////////
// Page1
/////////////////////////

Public Property FirstValue() As String
Get
Dim viewState As Object = Me.ViewState("FirstValue")

If viewState Is Nothing Then
Return String.Empty
Else
Return CStr(viewState)
End If
End Get
Set
Me.ViewState("FirstValue") = value
End Set
End Property

Sub doSubmit(ByVal Source As Object, ByVal E As EventArgs)
FirstValue = txtFirst.Text

' Add additional public properties and assignments as needed

Server.Transfer("Page2.aspx")
End Sub

/////////////////////////
// Page2
/////////////////////////

Sub Page_Load(ByVal Source As Object, ByVal E As EventArgs)
Dim contextHandler As Object = Context.Handler
If TypeOf contextHandler Is page1 Then
Dim page1Class As page1 = CType(contextHandler, page1)
Dim firstValue As String = page1Class.FirstValue
Label1.Text = "The Name you entered was : " + firstValue
Else
Label1.Text = "Not from Page 1!"
End If '
End Sub

NC...


Try using your transfer method like this Server.Transfer("your detail page",true). i think that should help you out.


NC,

Thanks for your response to my question.

I am attempting to utilze your code, but I'm running into a problem on the second vb page

NC01:

Sub Page_Load(ByVal Source As Object, ByVal E As EventArgs)
Dim contextHandler As Object = Context.Handler
If TypeOf contextHandler Is page1 Then
Dim page1Class As page1 = CType(contextHandler, page1)
Dim firstValue As String = page1Class.FirstValue
Label1.Text = "The Name you entered was : " + firstValue
Else
Label1.Text = "Not from Page 1!"
End If '
End Sub

I'm getting the following error: "Type 'page1' is not defined."

Can you tell me how to resolve this.

TIA

Steve


Why cont you use the PreviousPage Property to get the previous page all contsol in current page..just have a lokk at the folowing articvles..it would help you out..

http://forums.asp.net/t/1005660.aspx


I thought that you posted that the class name of the first page is page1? You are not by chance going across virtuals are you?

NC...


NC,

No they are physically seperate pages.

Steve

Passing values between pages

Hi
I need to move from page1 to page2 but I also need to pass a string value
between the two. Is there a way to achieve this?
Thanks
Regardsquerystring
- Sahil Malik
You can reach me thru my blog at
http://www.dotnetjunkies.com/weblog/sahilmalik
"John" <John@.nospam.infovis.co.uk> wrote in message
news:%23iWf5$WrEHA.3988@.tk2msftngp13.phx.gbl...
> Hi
> I need to move from page1 to page2 but I also need to pass a string value
> between the two. Is there a way to achieve this?
> Thanks
> Regards
>
This was asked and answered here the other day. Here's a part of the respons
e
from Steve Orr:
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
Here's one nice, simple way to pass values from one page to another:
'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)
"John" wrote:

> Hi
> I need to move from page1 to page2 but I also need to pass a string value
> between the two. Is there a way to achieve this?
> Thanks
> Regards
>
>
You can use a Session variable.
Xavier Pacheco
Xapware Technologies Inc
manage your projects: www.xapware.com/ActiveFocus.htm
the blog: www.xavierpacheco.com/xlog
the book: www.amazon.com/exec/obidos/ASIN/067...avierpacheco-20
Umm .. be careful when you use Session variables though - sticking
everything under the sun into session variables is not the most desirable
thing to do; from a scaleability point of view.
- Sahil Malik
You can reach me thru my blog at
http://www.dotnetjunkies.com/weblog/sahilmalik
"Xavier Pacheco" <xavier@._nospam_xapware.com> wrote in message
news:xn0do9v4d9ymlpx00f@.msnews.microsoft.com...
> You can use a Session variable.
>
> --
> Xavier Pacheco
> Xapware Technologies Inc
> manage your projects: www.xapware.com/ActiveFocus.htm
> the blog: www.xavierpacheco.com/xlog
> the book: www.amazon.com/exec/obidos/ASIN/067...avierpacheco-20
very true indeed.
Xavier Pacheco
Xapware Technologies Inc
manage your projects: www.xapware.com/ActiveFocus.htm
the blog: www.xavierpacheco.com/xlog
the book: www.amazon.com/exec/obidos/ASIN/067...avierpacheco-20

Passing values between pages with MasterPages

After a few hours of trial and error I have reached the following
conclusions, can you please tell me if I am right:
I have 2 aspx pages both with the same master page and I wish to pass
values from one to the other.
1. The postbackurl method doesn't seem to work with master pages. If I
take away the master pages it works.
2. The server.transfer method also doesn't work if I try to acess the
values via Request.Form or PreviousPage.FindControl. Again if I take
away the master pages it works.
3. My only option if I don't want to use the querystring to pass the
values (i.e. response.redirect) is to use a method which stores the
values in the server's RAM. e.g use Context.Items in conjunction with
Server.Transfer. This works with MasterPages but has the downfall of
the server's RAM now being used.
Please tell me if I am wrong or if there is no way of using cross page
posting or server.transfer for passing values from one aspx page with a
masterpage to another with the same masterpage without storing the
values in RAM?
Kind regards,
Steve."Steve" wrote:
> I have 2 aspx pages both with the same master page and I wish to pass
> values from one to the other.
Try using session variables, which should persist across page requests at a
user level:
1)
Session("SettingName") = strSettingValue
2)
strSettingValue = CStr(Session("SettingName"))

Passing values between pages with MasterPages

After a few hours of trial and error I have reached the following
conclusions, can you please tell me if I am right:

I have 2 aspx pages both with the same master page and I wish to pass
values from one to the other.

1. The postbackurl method doesn't seem to work with master pages. If I
take away the master pages it works.

2. The server.transfer method also doesn't work if I try to acess the
values via Request.Form or PreviousPage.FindControl. Again if I take
away the master pages it works.

3. My only option if I don't want to use the querystring to pass the
values (i.e. response.redirect) is to use a method which stores the
values in the server's RAM. e.g use Context.Items in conjunction with
Server.Transfer. This works with MasterPages but has the downfall of
the server's RAM now being used.

Please tell me if I am wrong or if there is no way of using cross page
posting or server.transfer for passing values from one aspx page with a
masterpage to another with the same masterpage without storing the
values in RAM?

Kind regards,

Steve."Steve" wrote:

Quote:

Originally Posted by

I have 2 aspx pages both with the same master page and I wish to pass
values from one to the other.


Try using session variables, which should persist across page requests at a
user level:

1)
Session("SettingName") = strSettingValue

2)
strSettingValue = CStr(Session("SettingName"))

Passing values between pages using Forms Authentication

I want to know how can i pass a value from my database to another page using Forms Authentication.

In this example:

1Sub Logon_Click(ByVal senderAs Object,ByVal eAs EventArgs)Handles Submit1.Click23Dim objConnectionAs Data.SqlClient.SqlConnection4Dim objCommandAs Data.SqlClient.SqlCommand5Dim usernameAs String6 Dim passwordAs String7 Dim strSQLQueryAs String8 Dim RecordCountAs Integer910 username = userTextBox.Text11 password = passTextBox.Text1213If Len(Trim(username)) > 0Then14 objConnection =New Data.SqlClient.SqlConnection("Data Source=localhost;" _15 &"Initial Catalog=web_dados;User Id=sa;Password=platinum;" _16 &"Connect Timeout=15;")1718 strSQLQuery ="SELECT * FROM conserto WHERE web_user ='" & username & "' AND web_pass = '" & password & "' "19 objCommand = New Data.SqlClient.SqlCommand(strSQLQuery, objConnection)202122 Try23 objConnection.Open()24 RecordCount = CInt(objCommand.ExecuteScalar())25 Catch ex As Exception26 Finally27 objConnection.Close()28 End Try2930 If RecordCount = 0 Then31 Msg.Text = "Identificação de conserto ou código de acesso inválido."32Else33 FormsAuthentication.RedirectFromLoginPage _34 (userTextBox.Text, Persist.Checked)35End If3637 objConnection.Close()38End If394041 End Sub42

I want to store the value of the field named <numero> of the database, and when the user authenticates, i want to print that variable in the default.aspx page.

You can use a Session variable to do so. If you are using ASP.NET 2.0, then you could use a Profile object too.

Does this help?

Regards


i've just tried to use sessions, but when the user autheticates and are redirected to the default.aspx page, it lost the session value.

1 username = userTextBox.Text2 password = passTextBox.Text3 Session("USERNAME") = username45If Len(Trim(username)) > 0Then6 objConnection =New Data.SqlClient.SqlConnection("Data Source=localhost;" _7 &"Initial Catalog=web_dados;User Id=sa;Password=platinum;" _8 &"Connect Timeout=15;")910 strSQLQuery ="SELECT * FROM conserto WHERE web_user ='" & username & "' AND web_pass = '" & password & "' "11 objCommand = New Data.SqlClient.SqlCommand(strSQLQuery, objConnection)121314 Try15 objConnection.Open()16 RecordCount = CInt(objCommand.ExecuteScalar())17 Catch ex As Exception18 Finally19 objConnection.Close()20 End Try2122 If RecordCount = 0 Then23 Msg.Text = "Identificação de conserto ou código de acesso inválido."24Else2526 FormsAuthentication.RedirectFromLoginPage _27 (userTextBox.Text, Persist.Checked)

in this code in the default.aspx it doesn't display any value.

1Sub Page_Load(ByVal SrcAs Object,ByVal eAs EventArgs)2 userLabel.Text = Session("USERNAME")3End Sub4

why?

passing values between pages (one is previouspage) with asp.net 1.x

i have a page opens a popup in that popup i get some property values for control in the previous page

i need to pass the values to the control vwhen i clik a button

what is the best choise

when i need session i can'nt refresh the previous page correctly so it fails for me (browser asks me a msgbox)

when i want to pass with query string my value is a html tag it allso fails because of security

thanks for helps

i realy need help talk to me guys

Can you clarify the question a bit.

You have a window you pop up that gathers some data that you want to write back to the previous page that the window popped up from?

If so you can use javascript to do it:


function SelectItem(item, invalue)
{
if (window.opener)
if (window.opener.closed == false)
if (window.opener.document && window.opener.document.forms[0] &&
window.opener.document.forms[0].elements[item])
{
window.opener.document.forms[0].elements[item].value = invalue;
}
window.close();
}

Passing values between two usercontrols?

Hi

How do I pass values between two UserControls?

Can I just register the one usercontrol inside the other usercontrol and then use a public property?

ThanksThis is a very common question, but there is a good and a bad way to answer it.
The short, bad way is to expose a public property, then have one of the controls find the other using FindControl and then set the property after having cast to the right type.
The problem with this is that it introduces a strong coupling between your two controls. What if one of the controls is not on the page? What if it's been replaced with another control with the same ID? What if one control evolves and not the other?

Which leads to the good way to do it: not to do it. The page or a higher container control should act as a global controller here and manage the relationships between the controls it contains. The controls themselves should be self-contained and not depend on any external control to function. The page should handle the events from the controls and manage the communication between controls from there.

Does this make sense?
Hi

Making sense.

Thanks

Passing values between two pages

Hi

In my source page I am using;

Context.Items("Msg") = Msg
Response.Redirect("Destination_Page.aspx")

In my destination page in Page_Load event I am using;

lblMsg.Text = CType(Context.Items("Msg"), String)

But the value does not get to the destination page. Is there a more
reliable way to pass a string between pages?

Thanks

RegardsTry a Server.Transfer("WebForm2.aspx");
instead of Redirect.

Note this technique does not work if you use Response.Redirect. A Redirect
results in another round trip to the client and a new HTTP request - thus a
new Context object without our ArrayList. To span requests, you'll need to
use the Session object or another state container. Also, there are other
techniques you can use to pass state between two forms when using
Server.Transfer, these other techniques can be found in the resources
section of the article.
http://www.odetocode.com/Articles/111.aspx
"John" <John@.nospam.infovis.co.ukwrote in message
news:eqgC28EpGHA.504@.TK2MSFTNGP05.phx.gbl...

Quote:

Originally Posted by

Hi
>
In my source page I am using;
>
Context.Items("Msg") = Msg
Response.Redirect("Destination_Page.aspx")
>
In my destination page in Page_Load event I am using;
>
lblMsg.Text = CType(Context.Items("Msg"), String)
>
But the value does not get to the destination page. Is there a more
reliable way to pass a string between pages?
>
Thanks
>
Regards
>
>


If you use Server.Transfer then on the next page you can reference the
PreviousPage object and use the FindControl method to gain reference to
whatever control you want on the previous page (the one that did the
transfer).

--
-Demetri

"sloan" wrote:

Quote:

Originally Posted by

Try a Server.Transfer("WebForm2.aspx");
instead of Redirect.
>
>
Note this technique does not work if you use Response.Redirect. A Redirect
results in another round trip to the client and a new HTTP request - thus a
new Context object without our ArrayList. To span requests, you'll need to
use the Session object or another state container. Also, there are other
techniques you can use to pass state between two forms when using
Server.Transfer, these other techniques can be found in the resources
section of the article.
http://www.odetocode.com/Articles/111.aspx
>
"John" <John@.nospam.infovis.co.ukwrote in message
news:eqgC28EpGHA.504@.TK2MSFTNGP05.phx.gbl...

Quote:

Originally Posted by

Hi

In my source page I am using;

Context.Items("Msg") = Msg
Response.Redirect("Destination_Page.aspx")

In my destination page in Page_Load event I am using;

lblMsg.Text = CType(Context.Items("Msg"), String)

But the value does not get to the destination page. Is there a more
reliable way to pass a string between pages?

Thanks

Regards


>
>
>

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 User Controls

I programmatically add a user control to a page which has a data grid on it. The user can then click on a link button to drill down to detail information.

What I would like to do is unload the existing user control and add the new user control with the data grid showing the detail information.

The question is how do I pass the key values from the existing user control to the new user control ?

Thanks

MarkYou can add your Items to the CurrentContext in order to pass from one control to another or from Page to an control


Context.Items.Add("MyValue", myValue)

To retrieve


Context.Items["MyValue"]

The problem here is when I click on the LinkButton on the DataGrid its going to cause the Parent page to reload itself and in the parents Page_Load subroutine its going to unload the existing Datagrid and load up the User Control with the detail DataGrid on. Therefore, it will never pass through the LinkButton's event to set the Context value.

Unless the secret is to load up both User Controls, on the Post Back, but hide the Header DataGrid ? Or to use client side code to pass the key of the selected record to a hidden field which will get submitted back to the server and be available much sooner in the process ?

I would be interested to here what people think would be the best way of doing this or whether there is a way to still use the Context stuff.

Cheers

Mark
Hi,

you could use a delegate.This article explains it how you could do it.

Grz, Kris.
Here Context is the HttpContext which is always available in a page and user controls. You can use this on the Page Load to store some values and then retrieve it later in the User controls as shown in my previous post.

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 By javascript

I have two webforms with the names frm1 and frm2. When user hits a button at
the frm1, frm2 opens in a new window. After clicking one row in frm2, this
form is closing.. But i can't pass the values to the frm1 without
postingback frm1. Is ther anyway to pass the values from one WebForm to
another without postingback especially in Javascript?Yes we can use hidden field for that.
sample code
window.opener.document.getElementById("hdAddedSpots").value += ',' +
songId;
window.opener is frm1 that has a hidden field in the name of
"hdAddedSpots".
thanks,
PB
"Alper OZGUR" <alpozgur@.gmail.com> wrote in message
news:OCwAFiTPGHA.668@.TK2MSFTNGP11.phx.gbl...
>I have two webforms with the names frm1 and frm2. When user hits a button
>at the frm1, frm2 opens in a new window. After clicking one row in frm2,
>this form is closing.. But i can't pass the values to the frm1 without
>postingback frm1. Is ther anyway to pass the values from one WebForm to
>another without postingback especially in Javascript?
>
>
Here's an article with links to five different tutorials on how to do what
you need:
http://www.webdevelopersjournal.com...ass_values.html
Sincerely,
S. Justin Gengo, MCP
Web Developer / Programmer
www.aboutfortunate.com
"Out of chaos comes order."
Nietzsche
"Alper OZGUR" <alpozgur@.gmail.com> wrote in message
news:OCwAFiTPGHA.668@.TK2MSFTNGP11.phx.gbl...
>I have two webforms with the names frm1 and frm2. When user hits a button
>at the frm1, frm2 opens in a new window. After clicking one row in frm2,
>this form is closing.. But i can't pass the values to the frm1 without
>postingback frm1. Is ther anyway to pass the values from one WebForm to
>another without postingback especially in Javascript?
>
>
Lot's of thanks to both of you.
"S. Justin Gengo [MCP]" <justin@.[no_spam_please]aboutfortunate.com>, haber
iletisinde unlar yazd:u7Rj1uTPGHA.1696@.TK2MSFTNGP14.phx.gbl...
> Here's an article with links to five different tutorials on how to do what
> you need:
> http://www.webdevelopersjournal.com...ass_values.html
> --
> Sincerely,
> S. Justin Gengo, MCP
> Web Developer / Programmer
> www.aboutfortunate.com
> "Out of chaos comes order."
> Nietzsche
> "Alper OZGUR" <alpozgur@.gmail.com> wrote in message
> news:OCwAFiTPGHA.668@.TK2MSFTNGP11.phx.gbl...
>

Passing Values By javascript

I have two webforms with the names frm1 and frm2. When user hits a button at
the frm1, frm2 opens in a new window. After clicking one row in frm2, this
form is closing.. But i can't pass the values to the frm1 without
postingback frm1. Is ther anyway to pass the values from one WebForm to
another without postingback especially in Javascript?Yes we can use hidden field for that.

sample code
window.opener.document.getElementById("hdAddedSpots").value += ',' +
songId;

window.opener is frm1 that has a hidden field in the name of
"hdAddedSpots".

thanks,
PB

"Alper OZGUR" <alpozgur@.gmail.com> wrote in message
news:OCwAFiTPGHA.668@.TK2MSFTNGP11.phx.gbl...
>I have two webforms with the names frm1 and frm2. When user hits a button
>at the frm1, frm2 opens in a new window. After clicking one row in frm2,
>this form is closing.. But i can't pass the values to the frm1 without
>postingback frm1. Is ther anyway to pass the values from one WebForm to
>another without postingback especially in Javascript?
>
Here's an article with links to five different tutorials on how to do what
you need:

http://www.webdevelopersjournal.com...ass_values.html

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"Alper OZGUR" <alpozgur@.gmail.com> wrote in message
news:OCwAFiTPGHA.668@.TK2MSFTNGP11.phx.gbl...
>I have two webforms with the names frm1 and frm2. When user hits a button
>at the frm1, frm2 opens in a new window. After clicking one row in frm2,
>this form is closing.. But i can't pass the values to the frm1 without
>postingback frm1. Is ther anyway to pass the values from one WebForm to
>another without postingback especially in Javascript?
>
Lot's of thanks to both of you.
"S. Justin Gengo [MCP]" <justin@.[no_spam_please]aboutfortunate.com>, haber
iletisinde unlar yazd:u7Rj1uTPGHA.1696@.TK2MSFTNGP14.phx.gbl...
> Here's an article with links to five different tutorials on how to do what
> you need:
> http://www.webdevelopersjournal.com...ass_values.html
> --
> Sincerely,
> S. Justin Gengo, MCP
> Web Developer / Programmer
> www.aboutfortunate.com
> "Out of chaos comes order."
> Nietzsche
> "Alper OZGUR" <alpozgur@.gmail.com> wrote in message
> news:OCwAFiTPGHA.668@.TK2MSFTNGP11.phx.gbl...
>>I have two webforms with the names frm1 and frm2. When user hits a button
>>at the frm1, frm2 opens in a new window. After clicking one row in frm2,
>>this form is closing.. But i can't pass the values to the frm1 without
>>postingback frm1. Is ther anyway to pass the values from one WebForm to
>>another without postingback especially in Javascript?
>>
>>
>>
>>