form submit question

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.
 
G

Guest

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
 
G

Guest

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="">
 

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

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,071
Latest member
MetabolicSolutionsKeto

Latest Threads

Top