473,785 Members | 2,317 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Repost: Changing Forms

Well I am posting the information on a blank form, then submitting the
server.transfer . The first page is just to update the database. The second
page shows the updated information. There should be no postback information
at all. I am reading the form collection of the request class. Here is my
code:

CreateEmployee. aspx.cs (first page)
private void Page_Load(objec t sender, System.EventArg s e)

{

// Put user code to initialize the page here

string [] sarName = GetEmployeeName ((string) Request.QuerySt ring["Id"]);

CreateEmployeeR ecord(sarName);

lbEmployees.Val ue = FindNewEmployee (sarName);

Server.Transfer ("EmpDetail.asp x", false);

}

EmpDetail.aspx. cs (second page)

private void Page_Load(objec t sender, System.EventArg s e)

{

BuildEmployeeDe tail(Convert.To Int32(Request.F orm["lbEmployee s"]));

lbEmployees.Val ue = Request.Form["lbEmployee s"];

}
"Tom Carter" <tc********@hot mail.com> wrote in message
news:a4******** *************** ***@posting.goo gle.com...
Hi Jeremy,

A couple of quick insights on this will help I think. In the first
webform when you transfer the page then no other events on that page
will occur.. The indexChanged events (et.al) will not fire at this
point. So in your Page_Load routine for page one you could put in a
statement similar to this:

if (Page.IsPostBac k) {Server.Transfe r("secondpage.a spx");

If you read the data from page one and always transfer to page two
then page two will never be a postback (sans autopostback controls).
That is, if you are just displaying information from the first page
you will always be transferring to the page two as a new page (not a
postback).

In any case you can retrieve the information from the form elements on
the first page by adding something like this to page two:

string myvar_onpagetwo = Request.Form["someFormElemen tName"];

~~~~~~~~~~~~~
Tommie Carter
www.premiertechnology.com
--
"Jeremy Ames" <yo******@here. com> wrote in message
news:<#q******* *******@tk2msft ngp13.phx.gbl>. ..
I am having problems with Server.Transfer when I try to change pages. I have a page that I have created just to process the information from a previous
web form and then to go to the next page. The update routine puts a hidden
text box into the web form and populates it with an id from a database. When I reach the next page, the id is not sent, and in fact the URL in the
address bar does not even change. Is there a better way for me to do this?


Nov 15 '05 #1
0 1002

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

Similar topics

5
1759
by: Joe | last post by:
Please repost answer message did not make it last time Hello, Joe here, wanted to get the 411 on this article. I posted in the FrontPage forum but there is never an answer. So I have come here, where all my IIS problems have been solved (Thank YOU!!) I want to create a small utility web site with a logon page and a form connected to an Access database. The article below explains exactly how but when
0
1258
by: rawCoder | last post by:
Hi All, This is a repost of 'Disable DataGrid AutoScroll of 3/7/2005' Its related to "WinForm DataGrid" HOW can i force the grid NOT to Auto Scroll to the ( newly added item OR last selected item )? Currently as a new item is entered, the grid SCROLLS hence changing the
4
2010
by: Mike | last post by:
Please help this is driving me nuts. I have 2 forms, 1 user class and I am trying to implement a singleton class. Form 1 should create a user object and populate some properties in user. Form2 should then have access to those user properties. I am not getting the property value from user that was set in form1. Sorry for posting so much code but I need help bad. How do i make this work? Thanks Mike
7
6060
by: Stefan Finzel | last post by:
Hi, is there a way to change the display property on Windows Mobile 2003 SE Mobile/Pocket Internet Explorer? See following example. Please note: visibilty property has the same problem. Is there any other way to display/undisplay parts of web pages? TIA
3
1869
by: Adam | last post by:
I've posted about this previously, but failed to receive a satisfactory response, so have included a code sample: I am trying to receive messages from an HTML viewer control in compact.net (c#), but cannot use message window as the control's parent window, as this is invisible and so the html is not viewable! I have a code sample showing the problem at www.tenwisevirgins.com/Example.zip
0
2052
by: Doug | last post by:
This is a repost of an item that I still cannot resolve. I have 3 combo boxes. The first leads to the second to the third. When I have selected a value in the second box, the third box shows the available information based on the second combo box selection. But if I change my mind and select a different item in the second box, after the third box has been populated, the third box still retains the information that was previously...
1
1843
by: Harley | last post by:
i have an application that uses forms security to restrict access to a specific folder. now i need to secure another folder, in the same root, but redirect those users to another login. imagine, one folder for managers, another for assistants. no shared options between them, so dont try to suggest profiles =) the current configuration uses a web.config file on the root folder with this structure: <configuration>
18
2988
by: Colin McGuire | last post by:
Hi - this was posted last weekend and unfortunately not resolved. The solutions that were posted almost worked but after another 5 days of working on the code everynight, I am not further ahead. If you do have any ideas I would really like to hear them. Thanks Colin - 0 - 0 - 0 - I want a glorified popup/context menu on a button that shows only when
7
2973
by: Sakharam Phapale | last post by:
Hi All, How to preserve the old font properties while changing new one? I posted same question 2 months back, but I had very small time then. eg. "Shopping for" is a text in RichTextBox and already formatted as "Shopping" ---Bold "for" -----Regular Now I want to underline whole text by preserving old style i.e. Bold and
12
4554
by: GaryDean | last post by:
In the original post I failed so indicate that I am using framework 1.1....... I need to be able to change the background color of a page from code. I found an answer to this question in another forum from Peter Huang that said that an id="bg" as follows... <body MS_POSITIONING="GridLayout" runat="server" id="bg"> then we could do the following in our codebehind file....
0
9643
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
9480
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
10147
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...
0
9947
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8968
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6737
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4045
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
3645
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.