Showing posts with label button. Show all posts
Showing posts with label button. Show all posts

Thursday, March 29, 2012

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 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?
>>
>>
>>
>>

Passing values from a child window

hi all,
I have a parent window default.aspx which has a textbox(txtBox1) with
multiline property and a button.when the button is clicked a child
window pops up child.aspx.
I have four textboxes in child.aspx and a submit button.What I want to
happen is when I click the submit button all the values must be
displayed in the multiline textbox in a table format with header and
the values below or any formatted display with headers.
I am using,
window.opener.documents.forms[0].txtBox1.value method to pass the
values.
can anybody help me to fix the values from the child window to the
parent window in a formatted display.I have been trying this for a day.
thanksHello ssrivani@.gmail.com,
From what I understood, after opening the child window and filling in the ch
ild form, you want to be able to:
1- Format the form field values in an html table.
2- copy the resulting html to the opening window and have it inserted into t
he multi line text field.
Try the attached files and see if it works for you.

> hi all,
>
> I have a parent window default.aspx which has a textbox(txtBox1) with
> multiline property and a button.when the button is clicked a child
> window pops up child.aspx.
> I have four textboxes in child.aspx and a submit button.What I want to
> happen is when I click the submit button all the values must be
> displayed in the multiline textbox in a table format with header and
> the values below or any formatted display with headers.
> I am using,
> window.opener.documents.forms[0].txtBox1.value method to pass the
> values.
> can anybody help me to fix the values from the child window to the
> parent window in a formatted display.I have been trying this for a
> day.
>
> thanks
>

Monday, March 26, 2012

Passing values from one page to another

How do I pass values from one page to another without using a button for redirection. That means on my source page I have a hyperlink that redirects to some target page. I have a label on the source page whose text I want to pass to the target page. How can I do that?

Use the querystring.

http://www.codeproject.com/aspnet/QueryString.asp

Passing values between pages

http://www.firoz.name/2006/05/07/passing-values-between-pages/

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 into SQL Server

Hi: I create two textboxes and a button and try to pass values from the
textboxes into SQL Server by using Save Button Can any one please tell
me do i write some code on save button or i bind the textbox with the
SQL Server fields as i bind the fields in VB.NET

Thanks,Few controls have automagic binding in a web app. Try something like this:

Dim textbox1Value as TextBox1.Text
Dim textbox2Value as TextBox2.Text

Dim sql as String = "INSERT INTO SomeTable VALUES (@.Val1, @.Val2)"
Dim conn As New SqlConnection("Your Connection string Here")
Dim cmd as New SqlCommand(sql, conn)

Dim param1 As new SqlParameter("@.Val1", SqlDbType.VarChar, 50)
Dim param2 As new SqlParameter("@.Val2", SqlDbType.VarChar, 50)

cmd.Parameters.Add(param1)
cmd.Parameters.Add(param2)

Try
conn.Open()
cmd.ExecuteNonQuery()
Catch ex As Exception
'Not sure how you want to handle exceptions
Finally
conn.Dispose()
End Try

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
http://gregorybeamer.spaces.live.com
********************************************
Think outside the box!
********************************************
<colleen1980@.gmail.comwrote in message
news:1165317810.925443.207280@.79g2000cws.googlegro ups.com...

Quote:

Originally Posted by

Hi: I create two textboxes and a button and try to pass values from the
textboxes into SQL Server by using Save Button Can any one please tell
me do i write some code on save button or i bind the textbox with the
SQL Server fields as i bind the fields in VB.NET
>
Thanks,
>

Passing values into SQL Server

Hi: I create two textboxes and a button and try to pass values from the
textboxes into SQL Server by using Save Button Can any one please tell
me do i write some code on save button or i bind the textbox with the
SQL Server fields as i bind the fields in VB.NET
Thanks,Few controls have automagic binding in a web app. Try something like this:
Dim textbox1Value as TextBox1.Text
Dim textbox2Value as TextBox2.Text
Dim sql as String = "INSERT INTO SomeTable VALUES (@.Val1, @.Val2)"
Dim conn As New SqlConnection("Your Connection string Here")
Dim cmd as New SqlCommand(sql, conn)
Dim param1 As new SqlParameter("@.Val1", SqlDbType.VarChar, 50)
Dim param2 As new SqlParameter("@.Val2", SqlDbType.VarChar, 50)
cmd.Parameters.Add(param1)
cmd.Parameters.Add(param2)
Try
conn.Open()
cmd.ExecuteNonQuery()
Catch ex As Exception
'Not sure how you want to handle exceptions
Finally
conn.Dispose()
End Try
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
http://gregorybeamer.spaces.live.com
****************************************
****
Think outside the box!
****************************************
****
<colleen1980@.gmail.com> wrote in message
news:1165317810.925443.207280@.79g2000cws.googlegroups.com...
> Hi: I create two textboxes and a button and try to pass values from the
> textboxes into SQL Server by using Save Button Can any one please tell
> me do i write some code on save button or i bind the textbox with the
> SQL Server fields as i bind the fields in VB.NET
> Thanks,
>

passing variable to open a new window

I am new to asp.net. I am wondering how I can open a new window from a button or link. I need to pass a value so both windows are linked. I will appreciate any help, code vb.net

The main page has a label is that stores the ID number, I need to pass this value so I can display in the new window information about this id. Please help. Thanks.

use the Querystring to pass variables to other pages

ie.


Response.Redirect("www.myplace.com/mynewpage.aspx?someValue=399393","_blank");

check this out

http://www.codeproject.com/aspnet/QueryString.asp

hth,

mcm


how about javascript?

<asp:button onclientClick='window.open(.....);' Text='Open New Window' runat=server />


Thanks for the answer. However, I need to open a new window. Could you please help me out? I am using vb.net. Thanks.

javascript DOES open a new window.

read about it. -->http://www.javascript-coder.com/window-popup/javascript-window-open.phtml

mcm


You can test the below code in page_load event which will open a new window using javascript

Page.ClientScript.RegisterStartupScript(me.GetType(),"open","window.open('WebForm2.aspx?id=123','','height=400,width=300');",true)

Where WebForm2.aspx is the name of the window you would like to open. Now in webform2 you can get the value of id using

Dim id as String = Request.QueryString("id")

HC


Yes. But I need to pass from the current window, a value which is saved in a label, to the new window. Thanks for the answer.

dim yourPassInVar as string

Page.ClientScript.RegisterStartupScript(me.GetType(),"open","window.open('WebForm2.aspx?id='" + yourPassInVar + ",'','height=400,width=300');",true)

How about this?



In the current window page_load event use the below code if you want the window to open direclty when the page is being loaded

Page.ClientScript.RegisterStartupScript(me.GetType(),"open","window.open('WebForm2.aspx?id=' + '"+Label1.Text+"','','height=400,width=300');",true)

If you want for example to open it on button click event use the below code

Button1.Attributes.Add("onclick","window.open('WebForm2.aspx?id=' + '"+Label1.Text+"','','height=400,width=300');")

Where Button1 is the button you want to open the window when being clicked

HC


Thanks. How can I do it with a button? When clicking on the button, the variable that holds the id value let's say 123 will be passed to webform2.aspx. Again, thanks for the help.

Great. Thank you for all the help!

;-)

passing variable to new page with LinkButton

I need to pass a variable from a master page to a details page when a user clicks on a link in a DataList. Right now I have a link button, but I don't know how to put the variable into the link at runtime. Hopefully this is just a matter of syntax? How can I make this work?

<asp:DataListID="DataList1"runat="server"DataSourceID="SqlDataSource1">

<ItemTemplate><asp:LinkButtonID="NameLinkButton"runat="server"Text='<%# Eval("Name") %>'PostBackUrl="details.aspx?sponsorID={0}"Font-Bold="true"></asp:LinkButton>

...

</ItemTemplate></asp:DataList>

try this tutorial

Tuorial #4 Understanding Web Application State in the begnner section ofhttp://www.asp.net/learn/videos/default.aspx?tabid=63#howdoi

helped me out alot on understanding how to pass from one page to the other.

Ragscoon =<^_^>=


could you define a string variable and set it equal to the text property of your linkbutton (I'm assuming the text property will be the data item you want to pass to your other page). Then add that string variable to the querystring that will be passed to your other page.

I had to do something like you are doing, except it was a linkbutton in a gridview. It came out like this:

sLocationCode = grdLocationCode.DataKeys(iIndex).Item("ALCODE").ToString()
sCountryCode = grdLocationCode.DataKeys(iIndex).Item("ALCCODE").ToString()
Response.Redirect("LocationCodeDetail.aspx?" & sCountryCode & ";" & sLocationCode)

I believe this addresses your question.


Thanks for the responses. What I am asking is: what is the syntax for concatenating the destination URL with the variable that I want to pass (the sponsorID)?

If I use:

<

asp:HyperLinkID="NameLabel"runat="server"Text='<%# Eval("Sponsor") %>'NavigateUrl='myDetails.aspx?sponsorID=<%# Eval("SponsorID") %>'Font-Bold="true"></asp:HyperLink>

I get:

http://localhost:2097/myFolder/myDetails.aspx?sponsorID=<%#%20Eval("SponsorID")%20%>

It does not parse the SponsorID variable.


To clarify the last line in my previous message:

I get:

http://localhost:2097/myFolder/myDetails.aspx?sponsorID=<%#%20Eval("SponsorID")%20%>It does not parse the SponsorID variable.

Saturday, March 24, 2012

Passing Variables

I have a asp page named welcome.asp where I have three input text
fields and a button named submit.
When I fill text in these text fields and click on button it passes
all those information to another aspx page.
the difference is my source page is written in classic asp and my
destination page is aspx.
Is this possible to pass values from asp page to aspx page. If so,
could you please send me xsom code.

Thanks,On Jun 11, 11:41 pm, bba...@.yahoo.com wrote:

Quote:

Originally Posted by

I have a asp page named welcome.asp where I have three input text
fields and a button named submit.
When I fill text in these text fields and click on button it passes
all those information to another aspx page.
the difference is my source page is written in classic asp and my
destination page is aspx.
Is this possible to pass values from asp page to aspx page. If so,
could you please send me xsom code.
>
Thanks,


Request.Form["text_field_from_asp"] ?
On Jun 11, 2:45 pm, Alexey Smirnov <alexey.smir...@.gmail.comwrote:

Quote:

Originally Posted by

On Jun 11, 11:41 pm, bba...@.yahoo.com wrote:
>

Quote:

Originally Posted by

I have a asp page named welcome.asp where I have three input text
fields and a button named submit.
When I fill text in these text fields and click on button it passes
all those information to another aspx page.
the difference is my source page is written in classic asp and my
destination page is aspx.
Is this possible to pass values from asp page to aspx page. If so,
could you please send me xsom code.


>

Quote:

Originally Posted by

Thanks,


>
Request.Form["text_field_from_asp"] ?


Is Request.form should be in destination web form or source webform.
<bbawa1@.yahoo.comwrote in message
news:1181603240.417819.11150@.a26g2000pre.googlegro ups.com...

Quote:

Originally Posted by

On Jun 11, 2:45 pm, Alexey Smirnov <alexey.smir...@.gmail.comwrote:

Quote:

Originally Posted by

>On Jun 11, 11:41 pm, bba...@.yahoo.com wrote:
>>

Quote:

Originally Posted by

I have a asp page named welcome.asp where I have three input text
fields and a button named submit.
When I fill text in these text fields and click on button it passes
all those information to another aspx page.
the difference is my source page is written in classic asp and my
destination page is aspx.
Is this possible to pass values from asp page to aspx page. If so,
could you please send me xsom code.


>>

Quote:

Originally Posted by

Thanks,


>>
>Request.Form["text_field_from_asp"] ?


>
Is Request.form should be in destination web form or source webform.
>


http://groups.google.com/group/micr...5addf17bc2a9da2

Passing Variables

Hi. I need to be able to pass a few variables on a button click to refill a
form on a new page. I am using a few textbox's but when the button is
clicked the values are lost - I am convinced that these variables are being
disposed - but why? - and how can I fix it.

thanks
JamesAnd make sure you're not resetting the values in your Page_Load by testing
for !IsPostBack before initializing any values. Keep in mind that Page_Load
runs before your button event.

Dale

"James" <James@.REMOVEMEtamarsolutions.co.uk> wrote in message
news:cahrpo$4lt$1@.newsg1.svr.pol.co.uk...
> Hi. I need to be able to pass a few variables on a button click to refill
a
> form on a new page. I am using a few textbox's but when the button is
> clicked the values are lost - I am convinced that these variables are
being
> disposed - but why? - and how can I fix it.
> thanks
> James

Passing Variables

I would like to pass variables on a button click to another module that is not visible until it gets the variables from the first module. First, can this be done? If so, how?

I found some articles on how to pass variables using server.transfer but I do not know if this will work or not because I want to use .ascx files.

Any thoughts?Hi,

you can pass information to the user control by creating properties on the control, fill them up through your page in a button click eventhandler or so.

Grz, Kris.

Passing Variables

Hi. I need to be able to pass a few variables on a button click to refill a
form on a new page. I am using a few textbox's but when the button is
clicked the values are lost - I am convinced that these variables are being
disposed - but why? - and how can I fix it.
thanks
JamesJames,
Check that EnableViewState is set to True in the page directive.
Hth,
Phil Winstanley
Microsoft ASP.NET MVP
http://www.myservicescentral.com
And make sure you're not resetting the values in your Page_Load by testing
for !IsPostBack before initializing any values. Keep in mind that Page_Load
runs before your button event.
Dale
"James" <James@.REMOVEMEtamarsolutions.co.uk> wrote in message
news:cahrpo$4lt$1@.newsg1.svr.pol.co.uk...
> Hi. I need to be able to pass a few variables on a button click to refill
a
> form on a new page. I am using a few textbox's but when the button is
> clicked the values are lost - I am convinced that these variables are
being
> disposed - but why? - and how can I fix it.
> thanks
> James
>
James,
Yes as Dale states, it's important to check you're not wiping out your
hard work in the Page_Load event! But make sure the order of your
events is right too, use the Trace to check, but as a rule of thumb,
try and do all page specific stuff in the PreRender event.
Hth,
Phil Winstanley
Microsoft ASP.NET MVP
http://www.myservicescentral.com

Passing Variables

I have a asp page named welcome.asp where I have three input text
fields and a button named submit.
When I fill text in these text fields and click on button it passes
all those information to another aspx page.
the difference is my source page is written in classic asp and my
destination page is aspx.
Is this possible to pass values from asp page to aspx page. If so,
could you please send me xsom code.
Thanks,On Jun 11, 11:41 pm, bba...@.yahoo.com wrote:
> I have a asp page named welcome.asp where I have three input text
> fields and a button named submit.
> When I fill text in these text fields and click on button it passes
> all those information to another aspx page.
> the difference is my source page is written in classic asp and my
> destination page is aspx.
> Is this possible to pass values from asp page to aspx page. If so,
> could you please send me xsom code.
> Thanks,
Request.Form["text_field_from_asp"] ?
On Jun 11, 2:45 pm, Alexey Smirnov <alexey.smir...@.gmail.com> wrote:
> On Jun 11, 11:41 pm, bba...@.yahoo.com wrote:
>
>
> Request.Form["text_field_from_asp"] ?
Is Request.form should be in destination web form or source webform.
<bbawa1@.yahoo.com> wrote in message
news:1181603240.417819.11150@.a26g2000pre.googlegroups.com...
> On Jun 11, 2:45 pm, Alexey Smirnov <alexey.smir...@.gmail.com> wrote:
> Is Request.form should be in destination web form or source webform.
>
http://groups.google.com/group/micr...5addf17bc2a9da2

Passing variables between pages

Hello, I have a page where I ask the user to enter text into a text box, and clicking a button which sends them to another page. I am using the code (in C#):

void Button1_Click(object sender, EventArgs e)
{
Server.Transfer("results.aspx?q=" + TextBox1.Text);
}

which works fine, but how would I call upon the variable in the results page? Also, how could I check the TextBox1.Text to see if it is blank? I tried:

If (TextBox1.Text = "")

but it tells me that I can't change from a string to a bool. Any help would be great, thanks.Well, in VB to check for empty strings I do this.

If TextBox1.Text Is String.Empty Then
' Yell at the person for not entering any text
Else
' Thank them for entering something
End If

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
>

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

Friday, March 16, 2012

Passung CheckBox Values Question

After a user selects checkboxes and submits by clicking a button i can
retrieve the values True/False by calling the
Context.Items("Message") in the page_load of the retrieving page like
below

Sub doSubmit(ByVal Source As Object, ByVal E As EventArgs)
Context.Items.Add("Message", MessageBank.Checked)
Server.Transfer("page2.aspx")
End Sub

But what if page2.aspx contain strings like
"page2.aspx?sid=<#DataBinder>"
Whats the right thing to do if i want to retrieve those values on the
page like above i need it because i want to insert the record to a
table.
Any ideas?

*** Sent via Developersdex http://www.developersdex.com ***using context will be better coz it is secure than the second methos. one
can manipulate a query string not a context item.