form submit question

  • Thread starter Thread starter pbd22
  • Start date Start date
P

pbd22

Hi.

I am trying to figure out how to execute a block of code
after the user submits the form. The block of code is in
page_load. Basically, in pseudo code:

Page_Load {

if the event is an initial page_load, a postback, or a refresh,
do nothing. Otherwise, if the form is loading because the user has
clicked a submit button, enter the below block of code:


// do something cool here


End.

}

On my form, I am using <input type=submit value=submit>

Is there a way to do this without using the runat=server tag?

Any help? Thanks.
 
Hi.

I am trying to figure out how to execute a block of code
after the user submits the form. The block of code is in
page_load. Basically, in pseudo code:

Page_Load {

if the event is an initial page_load, a postback, or a refresh,
do nothing. Otherwise, if the form is loading because the user has
clicked a submit button, enter the below block of code:

// do something cool here

End.

}

On my form, I am using <input type=submit value=submit>

Is there a way to do this without using the runat=server tag?

Any help? Thanks.

I think you can try to set hidden value via javascript and check if
that value is presented

<input type=submit value=submit onclick="document.getElementById
('hiddenvar')='1');">

.....

Page_Load() {

if Request.Form("hiddenvar") == "1" {
....

Hope this helps
 
I think you can try to set hidden value via javascript and check if
that value is presented

<input type=submit value=submit onclick="document.getElementById
('hiddenvar')='1');">

....

Page_Load() {

if Request.Form("hiddenvar") == "1" {
...

Hope this helps

<input type="hidden" name="hiddenvar" value="">
 
Back
Top