Ask a Question related to ASP.NET General, Design and Development.
-
Yatin Bhuta #1
Hidden field?
Hi,
I have WebPage1 which has a link to go to WebPage2. This link passes a value
to WebPage2. In the page_load event I get this value using
Request.QueryString and put it in a public data member of WebPage 2.
WebPage2 has a button on it and when this button is clicked the page is
posted back to the server.
My question is when the page is posted back to the server do I still have
the value that was passed from WebPage1 (Which I had stored in the public
datamember). If it's not then, I guess I will have to use hidden box and if
that's the case then, what is the syntax for creating a hidden text box?
Also, if this WebPage1 creates a datatable in dataset then, can this
datatable be used in WebPage2. If yes then, how?
Thanks
Yatin
Yatin Bhuta Guest
-
from text field to hidden field
Can you collect data from a text field and store it into a hidden field all one the same asp form so that on submit the value of the hidden field is... -
Set Text of Hidden Field
It sure would be great if Set Text Of... supported hidden fields as well as Text, Password and TextArea. I thought I could add this support by... -
Setting hidden field value eq to a form field value.
Ok guys help a dumb blond out. I need to pass the value of a form field to two different file fields. Here is an example of what I have; <form... -
inserting into db from hidden field
On Tue, 8 Jul 2003 16:44:16 +0200, "awebb" <andywebb25@hotmail.com> wrote: I'm curious why you are using an entire table cell for a hidden... -
hidden field
hi! Is it possible to have a textbox web server control as hidden ? and how ? When I use the visible property the textbox isn't rendered. -
Lachlan James #2
Hidden field?
link passes a value>-----Original Message-----
>Hi,
>
>I have WebPage1 which has a link to go to WebPage2. ThisWebPage 2.>to WebPage2. In the page_load event I get this value using
>Request.QueryString and put it in a public data member ofclicked the page is>WebPage2 has a button on it and when this button isdo I still have>posted back to the server.
>
>My question is when the page is posted back to the serverstored in the public>the value that was passed from WebPage1 (Which I hadNo. You only have it when the page first loads. When you>datamember).
post back a new instance of your page is created so you
loose the value in your property.
If it's not then, I guess I will have to use hidden box
and ifhidden text box?>that's the case then, what is the syntax for creating a
<asp:textbox id="txtHidden" visible="false"
runat="server" />
then, can this>
>Also, if this WebPage1 creates a datatable in datasetThis is possible. You could put the datatable in the pages>datatable be used in WebPage2. If yes then, how?
Context.Items collection, and do a Server.Transfer to
WebPage2.
However you may want to rethink your design, it's not a
good idea to be passing tables around in the request.
>
>Thanks
>
>Yatin
>
>
>.
>Lachlan James Guest
-
Natty Gur #3
Re: Hidden field?
If you need to persist the data between page postback you can also put
it in the ViewState.
Natty Gur, CTO
Dao2Com Ltd.
34th Elkalay st. Raanana
Israel , 43000
Phone Numbers:
Office: +972-(0)9-7740261
Fax: +972-(0)9-7740261
Mobile: +972-(0)58-888377
*** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
Don't just participate in USENET...get rewarded for it!
Natty Gur Guest
-
Ram #4
Re: Hidden field?
First question:
Hidden Field: When your WebPage2 is loading, in the pageload event
write this line of code to register a hidden variable and set a value
for it.
RegisterHiddenField("VariableName", VariableValue)
During the post back you can get back the value using
Request.Form("VariableName")
Second question:
After the code behind page is completed processing all your variables,
objects created in the page will be no longer available for you to
use. Because they have only Page level scope. If you want to create an
object in one page and want to use that in another page, there are
many ways to do it. You store that object in Session or Application,
Cache or Static(shared) variable, then you can access them in other
pages. Application and Cache also will work similar to static
variables and you will have only one instance of them for all the
users. If you want to have different objects for different users, you
need to use a session variable.
"Yatin Bhuta" <ybuhta@comcast.net> wrote in message news:<DfDXa.66555$uu5.6110@sccrnsc04>...> Hi,
>
> I have WebPage1 which has a link to go to WebPage2. This link passes a value
> to WebPage2. In the page_load event I get this value using
> Request.QueryString and put it in a public data member of WebPage 2.
> WebPage2 has a button on it and when this button is clicked the page is
> posted back to the server.
>
> My question is when the page is posted back to the server do I still have
> the value that was passed from WebPage1 (Which I had stored in the public
> datamember). If it's not then, I guess I will have to use hidden box and if
> that's the case then, what is the syntax for creating a hidden text box?
>
> Also, if this WebPage1 creates a datatable in dataset then, can this
> datatable be used in WebPage2. If yes then, how?
>
> Thanks
>
> YatinRam Guest



Reply With Quote

