Server.Transfer

V

Venkat Chellam

Hi all

I am new to asp.net. I am using C# for my code behind.

I have a main page which loads some data in datagrid. One column in
the page is button column and on the click event of that button, i do
some validation and on some condition like if amount > balance, i have
to show a confirmation kind of thing saying that customers balance is
less than the amount requested. Are you sure you want to accept the
amount and if say yes, i have to update the record and else i don't.
Which is a better solution to show confirmation like showing another
page and doing server.transfer or any other way of showing
confirmation. If i use server.transfer and once user hits yes button
in the second page how do i take the user back to the original page
with same state from where he came to the second page.


Thanks in advance and any help would be appreciated
 
M

Mark Fitzpatrick

You can use panels. Panels can be turned on and off by setting both the
Enabled and Visible properties to true or false. You can put anything you
want in the panels. If you have a situation where you need to show something
like two different content pieces based on the users response, you can
programatically turn the appropriate panel on and make sure the others are
turned off. You can have the button that you want in the panel and set the
click event of the button to an event handler that will process the yes
response.

Moving to ASP.Net takes a bit, but the most significant thing is we can do a
lot more with less pages now and don't have to do tons or re-directs to
handle things like this thankfully.

Server.Transfer is something that is often avoided in ASP.Net because it
messes with the persistant viewstate information of a page a lot of the
time.

Hope this helps,
Mark Fitzpatrick
Microsoft MVP - FrontPage
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,073
Latest member
DarinCeden

Latest Threads

Top