![]() |
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. |
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 |
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 03:36 AM. |
Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.