Postback, a hassle!?

S

SparvHok

I have big issues with the loading process of asp.net pages, especially
the Postback process.

Seriously, is it really supposed to help or mess things up?

I have a page, creates/edits and deletes news... nothing unusual. The
problem is that when using Querystring (action=delete&newsid=5) it
realoads the page totally blank!? Howcome?

The last instruction in the delete function tells the page to reload
(Response.Redirect, have also tried with Server.Transfer). It seems
though the page keeps the QueryString values and tries to repeat the
delete-process or something.

Could someone please explain whats happening or if there is a nicer way
of doing it?


--

+======================================================================+
| SparrowHawk The Magician |
| |
| |
| |
| |
+======================================================================+
| e-mail: sparvhok[NOSPAM]hotmail.com |
+======================================================================+
To send me an email, replace the [NOSPAM] tag with @ sign.
 
W

William F. Robertson, Jr.

You will probably need to post some more code. I have a hard time believe
Response.Redirect( "page.aspx" ) will have a querystring appended to it.

You could check if the page is posting back before you perform any
operations.

page_load

if ( !Page.IsPostBack )
{
//the first time the page loads.
}
else
{
//when the page is posting back to itself.
}

//run this everytime the page loads irregardless of postbacks.

bill
 
P

Patrice

Difficult to say without seeing some code. You should see exactly in the
browser if you have something int he querystring. You could alos trace to
make sure what is the control flow.

Most of the time, the action is posted as a form field rather than passed on
the querystring (part of the ASP.NET infrastructure that does quite a job at
simulating event driven programming.)...

Patrice
 

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

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top