473,405 Members | 2,187 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,405 software developers and data experts.

Learning problems...

Hi Newsgroupies,

I have a friend with 10 years MFC experience and who is now learning C#
and WebForms and who has run up against a conceptual problem.

I, erm I mean he, wants to know how to save and restore information
between renderings of a WebForms page before during and after a button
click for example.

A useful example would be to increment a number on each press of a
button and then paste the new value as the buttons text.

Many thanks!

Newsgroupie & friend
Nov 16 '05 #1
3 1216
Some ideas:
Session state
ViewState
Hidden input fields

Different ones are good for different types of situations and have their own
advantages and disadvantages. You can find tons of info about each approach
on google.

"newsgroupie" <ne*********@nospam.com> wrote in message
news:Pa**************@rjmeltd.demon.co.uk...
Hi Newsgroupies,

I have a friend with 10 years MFC experience and who is now learning C#
and WebForms and who has run up against a conceptual problem.

I, erm I mean he, wants to know how to save and restore information
between renderings of a WebForms page before during and after a button
click for example.

A useful example would be to increment a number on each press of a
button and then paste the new value as the buttons text.

Many thanks!

Newsgroupie & friend

Nov 16 '05 #2

"newsgroupie" <ne*********@nospam.com> wrote in message
news:Pa**************@rjmeltd.demon.co.uk...
Hi Newsgroupies,

I have a friend with 10 years MFC experience and who is now learning C#
and WebForms and who has run up against a conceptual problem.

I, erm I mean he, wants to know how to save and restore information
between renderings of a WebForms page before during and after a button
click for example.

A useful example would be to increment a number on each press of a button
and then paste the new value as the buttons text.


Drop a button on your webform and put this code behind it:

private void Button1_Click(object sender, System.EventArgs e)
{
if (Session["WebForm1.HitCount"] == null)
{
Session["WebForm1.HitCount"] = 0;
}
int i = (int)Session["WebForm1.HitCount"];
i += 1;
Session["WebForm1.HitCount"] = i;
Button1.Text = "HitCount: " + i;
}

David

Nov 16 '05 #3
Thanks Maria!

That's exactly the sort of thing I, erm I mean he was looking for;
Application/Session State

;-)

Newsgroupie, UK

In message <uN**************@TK2MSFTNGP12.phx.gbl>, Marina
<so*****@nospam.com> writes
Some ideas:
Session state
ViewState
Hidden input fields

Different ones are good for different types of situations and have their own
advantages and disadvantages. You can find tons of info about each approach
on google.

"newsgroupie" <ne*********@nospam.com> wrote in message
news:Pa**************@rjmeltd.demon.co.uk...
Hi Newsgroupies,

I have a friend with 10 years MFC experience and who is now learning C#
and WebForms and who has run up against a conceptual problem.

I, erm I mean he, wants to know how to save and restore information
between renderings of a WebForms page before during and after a button
click for example.

A useful example would be to increment a number on each press of a
button and then paste the new value as the buttons text.

Many thanks!

Newsgroupie & friend


Nov 16 '05 #4

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

Similar topics

4
by: neil f | last post by:
I'm thinking of investing in a copy of VB6 and was going to go for the Learning Edition (maybe Deluxe). Now I've seen a comment that the Learning Edition does not create .exe files. I presume that...
5
by: Ron Stephens | last post by:
The newly rechristened Python Learning Foundation is a web site dedicated to the assistance of people learning the Python programming language. Features include: 1. Daily lists of new and recent...
29
by: Jhon smith | last post by:
Hi,all,I was just wondering if I am likly to have any problems trying to learn C from older books,I have some from the late 80`s,mid/late 90`s. I am using Dev-C++ on the pc windows platform,But I...
90
by: Jhon smith | last post by:
Hi all,Just wondering are there any problems with learning c from older books,as I have picked up some from 1988,1994,1997,1998. By using books of this age(Im on a tight budget)am I going to...
14
by: andrew | last post by:
hi I know VB6 but dont know about VB.net. can anyone recommend a good book on VB.net and an online resource on how to learn.? I havent bought VB.net and I read I need to buy visual studio.net to...
4
by: Ricky W. Hunt | last post by:
I have two mixed questions, sorry for the unclear subject line. I downloaded the Visual Basic Resource Kit from MS but I can't get it to work. I have WinXP Home so I don't know if that's part of...
1
by: David Van D | last post by:
Hi there, A few weeks until I begin my journey towards a degree in Computer Science at Canterbury University in New Zealand, Anyway the course tutors are going to be teaching us JAVA wth bluej...
14
by: Rich | last post by:
Hi, (this is a probably a bit OT here, but comp.lang seems rather desolated, so I'm not sure I would get an answer there. And right now I'm in the middle of learning Python anyway so...) ...
7
by: Michael | last post by:
Hey, I'm, I guess, an itermediate programmer and I have a question about learning any programming language. I understand that as a programmer you're going to probably constantly be re-writing code...
10
by: Michael Reach | last post by:
Can anyone suggest a really good course in Javascript that my son can take online, starting right away? It should be for someone without much programming experience, and I mean a real course, that...
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?
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
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...

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.