Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net (http://www.velocityreviews.com/forums/f29-asp-net.html)
-   -   form submit question (http://www.velocityreviews.com/forums/t689301-form-submit-question.html)

pbd22 06-27-2009 06:40 AM

form submit question
 
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.

Alexey Smirnov 06-27-2009 08:59 AM

Re: form submit question
 
On Jun 27, 8:40*am, pbd22 <dush...@gmail.com> wrote:
> 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

Alexey Smirnov 06-27-2009 09:00 AM

Re: form submit question
 
On Jun 27, 10:59*am, Alexey Smirnov <alexey.smir...@gmail.com> wrote:
> On Jun 27, 8:40*am, pbd22 <dush...@gmail.com> wrote:
>
>
>
>
>
> > 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


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


All times are GMT. The time now is 10:12 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.