473,404 Members | 2,137 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

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(object sender, System.EventArgs e)

{

// Put user code to initialize the page here

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

CreateEmployeeRecord(sarName);

lbEmployees.Value = FindNewEmployee(sarName);

Server.Transfer("EmpDetail.aspx", false);

}

EmpDetail.aspx.cs (second page)

private void Page_Load(object sender, System.EventArgs e)

{

BuildEmployeeDetail(Convert.ToInt32(Request.Form["lbEmployees"]));

lbEmployees.Value = Request.Form["lbEmployees"];

}
"Tom Carter" <tc********@hotmail.com> wrote in message
news:a4**************************@posting.google.c om...
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.IsPostBack) {Server.Transfer("secondpage.aspx");

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["someFormElementName"];

~~~~~~~~~~~~~
Tommie Carter
www.premiertechnology.com
--
"Jeremy Ames" <yo******@here.com> wrote in message
news:<#q**************@tk2msftngp13.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 991

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

Similar topics

5
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...
0
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...
4
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...
7
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...
3
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#),...
0
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...
1
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,...
18
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....
7
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...
12
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
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,...
0
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...

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.