473,652 Members | 3,039 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Changing hidden values

I have a form that contains two hidden values, among other controls. I was wondering, if I change these values in server script and immediately do a server.transfer , do these values get updated before the page is changed?

I want to say that because the values are changed but the page is never reloaded after the change, that these changes do not take effect before the server.transfer . Please let me know if I am correct here. I think I am finally getting the hang of asp.net.

Thanks,

Jeremy Ames
Nov 18 '05 #1
3 1976
A good way to find out is by turning on debugger and inspect values.

Charlie
"Jeremy Ames" <yo******@here. com> wrote in message
news:e2******** ******@TK2MSFTN GP10.phx.gbl...
I have a form that contains two hidden values, among other controls. I was
wondering, if I change these values in server script and immediately do a
server.transfer , do these values get updated before the page is changed?

I want to say that because the values are changed but the page is never
reloaded after the change, that these changes do not take effect before the
server.transfer . Please let me know if I am correct here. I think I am
finally getting the hang of asp.net.

Thanks,

Jeremy Ames
Nov 18 '05 #2
When you do a Server.Transfer , the called page has access to the Querystring
and Forms collections of the original server post. The transfering page is
unloaded, so all data there will be gone. The called page is a new instance
of the new page, so you are starting a fresh Page instance.

Jeffrey Palermo
"Jeremy Ames" <yo******@here. com> wrote in message
news:e2******** ******@TK2MSFTN GP10.phx.gbl...
I have a form that contains two hidden values, among other controls. I was
wondering, if I change these values in server script and immediately do a
server.transfer , do these values get updated before the page is changed?

I want to say that because the values are changed but the page is never
reloaded after the change, that these changes do not take effect before the
server.transfer . Please let me know if I am correct here. I think I am
finally getting the hang of asp.net.

Thanks,

Jeremy Ames
Nov 18 '05 #3
Hi Jeremy,

It will help if you don't think of your executable code as "script" but
objects instead. ASP.Net has 2 components in every Page: The server-side
objects, and the client-side HTML. Neither of these necessarily has much to
do with the other. It's more useful to think of them sending messages to
each other. That is, the server-side objects which generate the client-side
HTML "send messages" by changing the HTML in the page. The client-side HTML
"sends messages" by posting back to the server. Stick with me, and shortly
you'll understand why I'm putting it this way.

You say that you have "a form that contains two hidden values." However,
that form has 2 components to it: The server-side objects, and the
client-side HTML. The server-side objects can certainly create hidden form
fields in the client-side HTML. However, these client-side form fields are
not necessarily connected in any way with a server-side objects. After all,
HTML is just text. You could create a client-side hidden form field by
simply writing the appropriate HTML into your Response. If that is indeed
what you did, how will the server-side objects have any notion that you
changed their values? There are no corresponding objects on the server to
which they are wired.

When you do a Server.Transfer , you are performing a purely server-side
operation. No Response is sent to the browser, and the HTML that resided in
the browser is history. You are simply transferring the HttpContext from one
Handler (Page object) to another. Only objects in memory will be
transferred. In order to transfer some client-side form value to the new
Handler, you have to either use server-side objects (such as
HtmlInputHidden ) or place the values from the Request.Form Collection that
are not linked to any server-side objects INTO a server-side object, such as
a Public field or Property of the Page object. Or, you could just put the
values directly into the HttpContext. Any in-memory server-side object that
is accessible from the HttpContext after the transfer will be fine.

I hope the long explanation will help you to further get the hang of
ASP.Net. :)

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
"Jeremy Ames" <yo******@here. com> wrote in message
news:e2******** ******@TK2MSFTN GP10.phx.gbl...
I have a form that contains two hidden values, among other controls. I was
wondering, if I change these values in server script and immediately do a
server.transfer , do these values get updated before the page is changed?

I want to say that because the values are changed but the page is never
reloaded after the change, that these changes do not take effect before the
server.transfer . Please let me know if I am correct here. I think I am
finally getting the hang of asp.net.

Thanks,

Jeremy Ames
Nov 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
2566
by: Itai | last post by:
I have an aspx file named index.aspx which contains two ‘form' sections, one that has the runat=server attribute (e.g From1) and one which is a regular HTML form (e.g SignInForm). I am trying to copy values from two INPUT controls that are located within the Form1 section to hidden INPUT controls located in the SignInForm and post the SignInForm form hidden controls values to a different page (e.g login.aspx) Problem is that after...
3
4584
by: Jeff | last post by:
Hi I have a report with a graph on it and want to change the minimum and maximum values for the value axis when it is previewed. This can't be done by adding code in the Open event as once the report has started printing the properties can't be changed. It can be done with an MDB by opening it in design mode hidden, making the change, saving it and then opening it in preview mode. However, this obviously doesn't work in an MDE which...
2
1902
by: Marcus | last post by:
Hi, I have a strange problem here... I have a simple onclick event on an ASP.NET button that does the following Javascript... document.getElementById("Button1").text = "Cancelled"; However, when I inspect the Button1.text value from code behind the it shows the original value of Button1 and not what the Javascript has changed it to. The funny thing is that it works for an ASP.NET text
3
1451
by: Trevor Braun | last post by:
This is the dumbest thing I've seen in ASP.NET. I'm trying to submit information from one page to another external (it's a Moneris pay page), using post method of a form that has a Master page. However, ASP.NET renames all of my hidden fields so that they cannot be identified by the external site. I'm trying to send information from my site to a Moneris pay page, but every time the page loads, the id's of the hidden fields is appended...
11
3141
by: saurabh | last post by:
Can anybody tell me how to change the value of an html control from the c#.... eg i hv one asp.net radio button control and one html hidden variable... so on page load in case the radio button is checked i want to set this hidden variable to 1 else 0... I am not getting what to write in Page_Load(object sender, System.EventArgs e) function to change the value of this html variable...
3
2121
by: dcassar | last post by:
I am working on a complex server control that dynamically creates an HtmlInputHidden control that stores its value. As far as the postback process is concerned, this hidden input acts as the control itself. So when I render, I generate a proxy HtmlInputHidden like so: protected virtual void Render(HtmlTextWriter writer) { HtmlInputHidden hiddenInput = new HtmlInputHidden(); hiddenInput.ID = ClientID; hiddenInput.Name = UniqueID;
1
4522
by: rbinington | last post by:
Hi, I am trying to write a DNN module that has the ability to insert articles into an article repository. I want the users to be able to move pages around and enter text into the FCKEditor. I want only one instance of the FCKEditor on the screen at one time so I make tabs that the user can click and I store the values in variables behind the scenes. I change the CSS class on the link that is the currently selected one. I have a really...
4
1551
by: VK | last post by:
As per discussion in the thread http://groups.google.com/group/comp.lang.javascript/browse_frm/thread/117e4f3a30f4d1c3 I'm proposing to add new FAQ entry: ---------------------------------------------------------------- I'm changing my page but nothing is changing on the screen. Why? ---------------------------------------------------------------- You may be experiencing the repaint delay problem. All existing browsers do not update...
5
12380
by: Geethu03 | last post by:
Hi i have a array values in hidden format <form name="form2" method="post" action="test.php"> <input type="hidden" name="date_val" value="<%= date %>"> <input type="hidden" name="name_val" value="<%= name %>"></form> my question is how can i get the array values in php using array(). In foreach statement i got the result but i want to do it using array to retrive the values one by one. i want to store the hidden values in table...
0
8367
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8279
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8811
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8703
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8467
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6160
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4291
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2703
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1591
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.