PC Review


Reply
Thread Tools Rate Thread

confirmation and passing values

 
 
rsht
Guest
Posts: n/a
 
      13th Jan 2008
I am new to the ASP.Net and need some helps.

In ASP, page one can have a button event "confirm()" to pop-up a yes
or no window:
<form ... action="page2" >
....
<input onClick="confirm();">
</form>
and if user click yes to onfirm, the function can have form.submit to
post the form values to page2

Now I am having trouble to write aspx pages to do the same. Would
anyone can give some helps?

Thanks a lots!

 
Reply With Quote
 
 
 
 
Milosz Skalecki [MCAD]
Guest
Posts: n/a
 
      13th Jan 2008
<asp:Button runat="server" ID="whatever" OnClientClick="return
confirm('question...?')"/>

Regards
--
Milosz


"rsht" wrote:

> I am new to the ASP.Net and need some helps.
>
> In ASP, page one can have a button event "confirm()" to pop-up a yes
> or no window:
> <form ... action="page2" >
> ....
> <input onClick="confirm();">
> </form>
> and if user click yes to onfirm, the function can have form.submit to
> post the form values to page2
>
> Now I am having trouble to write aspx pages to do the same. Would
> anyone can give some helps?
>
> Thanks a lots!
>
>

 
Reply With Quote
 
rsht
Guest
Posts: n/a
 
      14th Jan 2008
Thanks Milosz!

Could you tell me how I can act differently base on which button user
clicks when responds to the "question...?"? Basically, this is a
confirmation for the database update with the current webform input.
If user click OK, the action should update the database with the user
inputs in the controls within the webform.


On Jan 14, 10:51*am, Milosz Skalecki [MCAD]
<mily...@DONTLIKESPAMwp.pl> wrote:
> <asp:Button runat="server" ID="whatever" OnClientClick="return
> confirm('question...?')"/>
>
> Regards
> --
> Milosz
>
>
>
> "rsht" wrote:
> > I am new to the ASP.Net and need some helps.

>
> > In ASP, page one can have a button event "confirm()" to pop-up a yes
> > or no window:
> > <form ... action="page2" >
> > ....
> > <input onClick="confirm();">
> > </form>
> > and if user click yes to onfirm, the function can have form.submit to
> > post the form values to page2

>
> > Now I am having trouble to write aspx pages to do the same. Would
> > anyone can give some helps?

>
> > Thanks a lots!- Hide quoted text -

>
> - Show quoted text -


 
Reply With Quote
 
Milosz Skalecki [MCAD]
Guest
Posts: n/a
 
      14th Jan 2008
The code i posted prevents the form from being posted if users click 'cancel'
button (nothing will happen). Amending the code to post the value to the
server, and then you may decide what to do:

<asp:Buton runat="server" ID="btn"/>
<asp:HiddenField runat="server" ID="hdn" />
<script type="text/javacsript">
function askUser()
{
document.getElementById('<%=hdn.ClientID%>').value = confirm('question');
}
</script>

-- c# code behinnd --
protected void btn_Click(object sender, EventArgs e)
{
bool confirmed = Convert.ToBoolean(hdn.Value);

if (confirmed)
{
// do something
}
else
{
// do something else
}

}
-- end c# code behind --

Hope this helps
--
Milosz


"rsht" wrote:

> Thanks Milosz!
>
> Could you tell me how I can act differently base on which button user
> clicks when responds to the "question...?"? Basically, this is a
> confirmation for the database update with the current webform input.
> If user click OK, the action should update the database with the user
> inputs in the controls within the webform.
>
>
> On Jan 14, 10:51 am, Milosz Skalecki [MCAD]
> <mily...@DONTLIKESPAMwp.pl> wrote:
> > <asp:Button runat="server" ID="whatever" OnClientClick="return
> > confirm('question...?')"/>
> >
> > Regards
> > --
> > Milosz
> >
> >
> >
> > "rsht" wrote:
> > > I am new to the ASP.Net and need some helps.

> >
> > > In ASP, page one can have a button event "confirm()" to pop-up a yes
> > > or no window:
> > > <form ... action="page2" >
> > > ....
> > > <input onClick="confirm();">
> > > </form>
> > > and if user click yes to onfirm, the function can have form.submit to
> > > post the form values to page2

> >
> > > Now I am having trouble to write aspx pages to do the same. Would
> > > anyone can give some helps?

> >
> > > Thanks a lots!- Hide quoted text -

> >
> > - Show quoted text -

>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Get values from submitted form page in confirmation fields =?Utf-8?B?UEFCTEVHdXk=?= Microsoft Frontpage 2 4th Oct 2007 09:56 AM
Newbie: By-passing confirmation dialog boxes =?Utf-8?B?TWlrZQ==?= Microsoft Access VBA Modules 3 9th Nov 2006 03:10 PM
Pay after confirmation(we clear ur microsoft and cisco exams)100% passing gaurantee vinayji Windows XP General 0 8th Sep 2005 09:18 AM
Using webbot field values on a confirmation page Tom Microsoft Frontpage 1 29th Nov 2004 02:36 AM
Confirmation Page Values not displayed jseth Microsoft Frontpage 0 4th Jun 2004 04:58 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:58 AM.