Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Hidden values

Reply
Thread Tools

Hidden values

 
 
Roshawn Dawson
Guest
Posts: n/a
 
      03-24-2005
Hi,

Is it possible to pass the value of a hidden field in the querystring?
If not, how can you pass the value from page to page without using
server controls?

Thanks,
Roshawn
 
Reply With Quote
 
 
 
 
BillGatesFan
Guest
Posts: n/a
 
      03-24-2005
You can use Session Variables

 
Reply With Quote
 
 
 
 
Ken Cox [Microsoft MVP]
Guest
Posts: n/a
 
      03-25-2005
Hi Roshawn,

Here's a way to pass values from one page to another without the messy
querystring.

You can pass Context and then use Server.Transfer. The code below shows the
starting page first and then the receiver page.

Let us know if this helps?

Ken
Microsoft MVP [ASP.NET]


' Page with hidden textbox:

<form id="Form1" method="post" runat="server">
<p>
<asp:textbox id="TextBox1" runat="server"
visible="False">Pass this!</asp:textbox></p>
<p>
<asp:button id="Button1" runat="server"
Text="Button"></asp:button></p>
</form>

Private Sub Button1_Click _
(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles Button1.Click
Context.Items("txtValue") = TextBox1.Text
Server.Transfer("targetpg.aspx")
End Sub


' targetpg.aspx that shows the passed value

<form id="Form1" method="post" runat="server">
<asp:label id="Label1" runat="server">Label</asp:label>
</form>

Private Sub Page_Load _
(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles MyBase.Load
Label1.Text = CType(Context.Items("txtValue"), String)
End Sub

"Roshawn Dawson" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi,
>
> Is it possible to pass the value of a hidden field in the querystring? If
> not, how can you pass the value from page to page without using server
> controls?
>
> Thanks,
> Roshawn


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Populate Hidden field on post back and retrieve value from Hidden Field Rick ASP .Net 3 04-13-2010 05:38 PM
Win 7 folders hidden despite 'show hidden' checked Boppy NZ Computing 10 01-23-2010 02:56 AM
Re: sending hidden values AND option values at the same time ? Jukka K. Korpela HTML 1 09-12-2006 02:32 PM
How would I discover the text in a block element hidden by overflow:hidden style being set? SolarCanine Javascript 2 09-20-2005 06:27 PM
Hidden textbox values lost!! Rajesh ASP .Net 3 09-10-2003 02:39 PM



Advertisments