473,394 Members | 1,960 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,394 software developers and data experts.

Need som quick advice

Hi everyone,

I'm new to C# and I am building website which allows users to fill out
various forms. All is going well, however I'm having a bit of trouble
with one particular issue.

The main page enables users to enter information, and connect to other
pages where they can enter additional details. After entering those
additional details on the other pages, they are redirected back to the
main page. I know I could use Session variables, but thats not very
efficient. I could use Server.Transfer, but that will be a pain since
the flow of the form is a "hub and spokes" topology which could get
messy and complicated.

Essentially what I want to accomplish is to allow the user start at the
main page, click a link and end up on a secondary page where they edit
details. When done editing the details they are redirected to the main
page again, and those details are summarized as well as the fields that
were modified on the main page remain unchange (or rather edit boxes
that were filled are still filled).

I know this can be done by submitting to the database on every redirect
to the sub pages, but I'm trying to speed things up a little and simply
the code.

Any help would be greatly appreciated.

Jun 22 '06 #1
6 1482
Youo have several alternatives. You can use Session, which is not as bad as
you seem to think, and could well be the simplest solution to your problem.
If you concerned about memory usage, once you've inserted the data into the
database (in the end), just clear the user's Session of all unnecessary
data.

As you mentioned, you can also use a database to store the data temporarily,
but not only is that a performance issue, but can get quite complex as well
(what to do if the user stops in the middle and surfs elsewhere, for
example).

Another solution is to post the data to the following form. With ASP.Net,
this can be a bit tricky, as it typically redirects or transfers to the next
form, but you can pass the data when you use Server.Transfer, or you can
post it from one form to the next, by putting it into a second hidden form
and posting that. However, again, that can be a bit tricky.

Perhaps Session *is* your best bet!

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Chicken Salad Alchemist

I recycle.
I send everything back to the planet it came from.

<en****@gmail.com> wrote in message
news:11**********************@u72g2000cwu.googlegr oups.com...
Hi everyone,

I'm new to C# and I am building website which allows users to fill out
various forms. All is going well, however I'm having a bit of trouble
with one particular issue.

The main page enables users to enter information, and connect to other
pages where they can enter additional details. After entering those
additional details on the other pages, they are redirected back to the
main page. I know I could use Session variables, but thats not very
efficient. I could use Server.Transfer, but that will be a pain since
the flow of the form is a "hub and spokes" topology which could get
messy and complicated.

Essentially what I want to accomplish is to allow the user start at the
main page, click a link and end up on a secondary page where they edit
details. When done editing the details they are redirected to the main
page again, and those details are summarized as well as the fields that
were modified on the main page remain unchange (or rather edit boxes
that were filled are still filled).

I know this can be done by submitting to the database on every redirect
to the sub pages, but I'm trying to speed things up a little and simply
the code.

Any help would be greatly appreciated.

Jun 22 '06 #2
Hi there,

Thanks for the suggestion, maybe Session is my best bet. The next
question is how to do I best use the Session? Can I create a struct
and put it into the Session? And if so, where do I declare the struct
so that it can be accessible on all pages of the web app? Or do I need
to redeclare the struct's structure on every page? (I've tried the
global.asax and since I'm using code-behind, I can't use Includes)

Thanks again,
Nicholas

Kevin Spencer wrote:
Youo have several alternatives. You can use Session, which is not as bad as
you seem to think, and could well be the simplest solution to your problem.
If you concerned about memory usage, once you've inserted the data into the
database (in the end), just clear the user's Session of all unnecessary
data.

As you mentioned, you can also use a database to store the data temporarily,
but not only is that a performance issue, but can get quite complex as well
(what to do if the user stops in the middle and surfs elsewhere, for
example).

Another solution is to post the data to the following form. With ASP.Net,
this can be a bit tricky, as it typically redirects or transfers to the next
form, but you can pass the data when you use Server.Transfer, or you can
post it from one form to the next, by putting it into a second hidden form
and posting that. However, again, that can be a bit tricky.

Perhaps Session *is* your best bet!

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Chicken Salad Alchemist

I recycle.
I send everything back to the planet it came from.

<en****@gmail.com> wrote in message
news:11**********************@u72g2000cwu.googlegr oups.com...
Hi everyone,

I'm new to C# and I am building website which allows users to fill out
various forms. All is going well, however I'm having a bit of trouble
with one particular issue.

The main page enables users to enter information, and connect to other
pages where they can enter additional details. After entering those
additional details on the other pages, they are redirected back to the
main page. I know I could use Session variables, but thats not very
efficient. I could use Server.Transfer, but that will be a pain since
the flow of the form is a "hub and spokes" topology which could get
messy and complicated.

Essentially what I want to accomplish is to allow the user start at the
main page, click a link and end up on a secondary page where they edit
details. When done editing the details they are redirected to the main
page again, and those details are summarized as well as the fields that
were modified on the main page remain unchange (or rather edit boxes
that were filled are still filled).

I know this can be done by submitting to the database on every redirect
to the sub pages, but I'm trying to speed things up a little and simply
the code.

Any help would be greatly appreciated.


Jun 22 '06 #3
The Session is global to the application, but specific to the user Session.
You can store anything in it. As long as the class or struct is defined in a
namespace that is available to any given page, it is fine.

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Chicken Salad Alchemist

I recycle.
I send everything back to the planet it came from.

<en****@gmail.com> wrote in message
news:11**********************@m73g2000cwd.googlegr oups.com...
Hi there,

Thanks for the suggestion, maybe Session is my best bet. The next
question is how to do I best use the Session? Can I create a struct
and put it into the Session? And if so, where do I declare the struct
so that it can be accessible on all pages of the web app? Or do I need
to redeclare the struct's structure on every page? (I've tried the
global.asax and since I'm using code-behind, I can't use Includes)

Thanks again,
Nicholas

Kevin Spencer wrote:
Youo have several alternatives. You can use Session, which is not as bad
as
you seem to think, and could well be the simplest solution to your
problem.
If you concerned about memory usage, once you've inserted the data into
the
database (in the end), just clear the user's Session of all unnecessary
data.

As you mentioned, you can also use a database to store the data
temporarily,
but not only is that a performance issue, but can get quite complex as
well
(what to do if the user stops in the middle and surfs elsewhere, for
example).

Another solution is to post the data to the following form. With ASP.Net,
this can be a bit tricky, as it typically redirects or transfers to the
next
form, but you can pass the data when you use Server.Transfer, or you can
post it from one form to the next, by putting it into a second hidden
form
and posting that. However, again, that can be a bit tricky.

Perhaps Session *is* your best bet!

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Chicken Salad Alchemist

I recycle.
I send everything back to the planet it came from.

<en****@gmail.com> wrote in message
news:11**********************@u72g2000cwu.googlegr oups.com...
> Hi everyone,
>
> I'm new to C# and I am building website which allows users to fill out
> various forms. All is going well, however I'm having a bit of trouble
> with one particular issue.
>
> The main page enables users to enter information, and connect to other
> pages where they can enter additional details. After entering those
> additional details on the other pages, they are redirected back to the
> main page. I know I could use Session variables, but thats not very
> efficient. I could use Server.Transfer, but that will be a pain since
> the flow of the form is a "hub and spokes" topology which could get
> messy and complicated.
>
> Essentially what I want to accomplish is to allow the user start at the
> main page, click a link and end up on a secondary page where they edit
> details. When done editing the details they are redirected to the main
> page again, and those details are summarized as well as the fields that
> were modified on the main page remain unchange (or rather edit boxes
> that were filled are still filled).
>
> I know this can be done by submitting to the database on every redirect
> to the sub pages, but I'm trying to speed things up a little and simply
> the code.
>
> Any help would be greatly appreciated.
>

Jun 22 '06 #4
Hi,

The main page enables users to enter information, and connect to other
pages where they can enter additional details. After entering those
additional details on the other pages, they are redirected back to the
main page. I know I could use Session variables, but thats not very
efficient.
Why? you told you that?
I could use Server.Transfer, but that will be a pain since
the flow of the form is a "hub and spokes" topology which could get
messy and complicated.
Agree , I prefer to use Redirect , a Transfer may not be reflected in the
address bar whether a Redirect will
Essentially what I want to accomplish is to allow the user start at the
main page, click a link and end up on a secondary page where they edit
details. When done editing the details they are redirected to the main
page again, and those details are summarized as well as the fields that
were modified on the main page remain unchange (or rather edit boxes
that were filled are still filled).
I would display the summary in a separate page (not the main) and from there
you can have links to each section's page.

I know this can be done by submitting to the database on every redirect
to the sub pages, but I'm trying to speed things up a little and simply
the code.


Again; What is wrong with using Session variables? As a matter of fact I
think you could easily solve your problem using them.
--
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
Jun 22 '06 #5
en****@gmail.com wrote:
Hi there,

Thanks for the suggestion, maybe Session is my best bet. The next
question is how to do I best use the Session? Can I create a struct
and put it into the Session? And if so, where do I declare the struct
so that it can be accessible on all pages of the web app? Or do I need
to redeclare the struct's structure on every page? (I've tried the
global.asax and since I'm using code-behind, I can't use Includes)
1. You can create the struct either in a separate class library project
and reference that from your website
2. Or you can place the structname.cs file in your app_code directory (2.0)
3. Or as a separate structname.cs file anywhere in your webroot (1.0).

Make sure you only make all classes and structs that will be saved to
the session Serializable, this will prevent problems should you need to
run out of process session state.

Jesse Houwing

Thanks again,
Nicholas

Kevin Spencer wrote:
Youo have several alternatives. You can use Session, which is not as bad as
you seem to think, and could well be the simplest solution to your problem.
If you concerned about memory usage, once you've inserted the data into the
database (in the end), just clear the user's Session of all unnecessary
data.

As you mentioned, you can also use a database to store the data temporarily,
but not only is that a performance issue, but can get quite complex as well
(what to do if the user stops in the middle and surfs elsewhere, for
example).

Another solution is to post the data to the following form. With ASP.Net,
this can be a bit tricky, as it typically redirects or transfers to the next
form, but you can pass the data when you use Server.Transfer, or you can
post it from one form to the next, by putting it into a second hidden form
and posting that. However, again, that can be a bit tricky.

Perhaps Session *is* your best bet!

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Chicken Salad Alchemist

I recycle.
I send everything back to the planet it came from.

<en****@gmail.com> wrote in message
news:11**********************@u72g2000cwu.googlegr oups.com...
Hi everyone,

I'm new to C# and I am building website which allows users to fill out
various forms. All is going well, however I'm having a bit of trouble
with one particular issue.

The main page enables users to enter information, and connect to other
pages where they can enter additional details. After entering those
additional details on the other pages, they are redirected back to the
main page. I know I could use Session variables, but thats not very
efficient. I could use Server.Transfer, but that will be a pain since
the flow of the form is a "hub and spokes" topology which could get
messy and complicated.

Essentially what I want to accomplish is to allow the user start at the
main page, click a link and end up on a secondary page where they edit
details. When done editing the details they are redirected to the main
page again, and those details are summarized as well as the fields that
were modified on the main page remain unchange (or rather edit boxes
that were filled are still filled).

I know this can be done by submitting to the database on every redirect
to the sub pages, but I'm trying to speed things up a little and simply
the code.

Any help would be greatly appreciated.

Jun 23 '06 #6
Thanks to all, I've created my structs in a class file in App_Code, and
I'm passing them back and forth with Session variables.

You've all been very helpful.

Thanks,
Nicholas

Jesse Houwing wrote:
en****@gmail.com wrote:
Hi there,

Thanks for the suggestion, maybe Session is my best bet. The next
question is how to do I best use the Session? Can I create a struct
and put it into the Session? And if so, where do I declare the struct
so that it can be accessible on all pages of the web app? Or do I need
to redeclare the struct's structure on every page? (I've tried the
global.asax and since I'm using code-behind, I can't use Includes)


1. You can create the struct either in a separate class library project
and reference that from your website
2. Or you can place the structname.cs file in your app_code directory (2.0)
3. Or as a separate structname.cs file anywhere in your webroot (1.0).

Make sure you only make all classes and structs that will be saved to
the session Serializable, this will prevent problems should you need to
run out of process session state.

Jesse Houwing

Thanks again,
Nicholas

Kevin Spencer wrote:
Youo have several alternatives. You can use Session, which is not as bad as
you seem to think, and could well be the simplest solution to your problem.
If you concerned about memory usage, once you've inserted the data into the
database (in the end), just clear the user's Session of all unnecessary
data.

As you mentioned, you can also use a database to store the data temporarily,
but not only is that a performance issue, but can get quite complex as well
(what to do if the user stops in the middle and surfs elsewhere, for
example).

Another solution is to post the data to the following form. With ASP.Net,
this can be a bit tricky, as it typically redirects or transfers to the next
form, but you can pass the data when you use Server.Transfer, or you can
post it from one form to the next, by putting it into a second hidden form
and posting that. However, again, that can be a bit tricky.

Perhaps Session *is* your best bet!

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Chicken Salad Alchemist

I recycle.
I send everything back to the planet it came from.

<en****@gmail.com> wrote in message
news:11**********************@u72g2000cwu.googlegr oups.com...
Hi everyone,

I'm new to C# and I am building website which allows users to fill out
various forms. All is going well, however I'm having a bit of trouble
with one particular issue.

The main page enables users to enter information, and connect to other
pages where they can enter additional details. After entering those
additional details on the other pages, they are redirected back to the
main page. I know I could use Session variables, but thats not very
efficient. I could use Server.Transfer, but that will be a pain since
the flow of the form is a "hub and spokes" topology which could get
messy and complicated.

Essentially what I want to accomplish is to allow the user start at the
main page, click a link and end up on a secondary page where they edit
details. When done editing the details they are redirected to the main
page again, and those details are summarized as well as the fields that
were modified on the main page remain unchange (or rather edit boxes
that were filled are still filled).

I know this can be done by submitting to the database on every redirect
to the sub pages, but I'm trying to speed things up a little and simply
the code.

Any help would be greatly appreciated.


Jun 24 '06 #7

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

Similar topics

10
by: Jeff Wagner | last post by:
I am in the process of learning Python (obsessively so). I've been through a few tutorials and read a Python book that was lent to me. I am now trying to put what I've learned to use by rewriting...
2
by: Carolyn Gill | last post by:
I have already created an asp login/database for a learning/quiz section on a small site. There will be multiple quizzes through the site and what I need now would be help: tutorials or advice that...
41
by: Psykarrd | last post by:
I am trying to declare a string variable as an array of char's. the code looks like this. char name; then when i try to use the variable it dosn't work, however i am not sure you can use it...
1
by: aredo3604gif | last post by:
On Sun, 10 Apr 2005 19:46:32 GMT, aredo3604gif@yahoo.com wrote: >The user can dynamically enter and change the rule connection between >objects. The rule is a "<" and so given two objects: >a <...
2
by: MrNobody | last post by:
I would like to make a quick little hex editor so I need to display hex string pairs like a grid- if anyone is familiar with hex editors you'll know what I mean. I could accomplish this by using a...
6
by: Mike L. | last post by:
Hi, Pls, beware that I'm new to this :) I've developed several web appl, either with ASP or ASP.NET. All using SQL server as the back end. In my development environment, I have a single...
9
by: laststubborn | last post by:
Dear All, We have a big concern in our Database system. We have 2000 transactions daily in our database. We need to replicate some how the database for our fail over setup. I tried transactional...
1
by: =?Utf-8?B?eFNBTkRJeA==?= | last post by:
I cant get i tunes/ quicktime working on the computer, I had both of these before but they are not working now for some reason. Advice given on Apple site was to uninstall and then install...
9
by: jim | last post by:
I'd like to get some .net sample code that shows me how to make a complete backup of a hard drive (like my C: drive) to another location (say my D: drive) while the C: drive is in use. ...
2
by: giddy | last post by:
hi, I'm an MCP(70-536) so i know C# pretty well, the last app i made i had to resort to using a hideously confusing design to print reports, charts etc, and eventually it didn't work out well....
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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,...
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
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...
0
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...
0
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...

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.