Re: confirm in asp.net
- From: "Patrice" <http://www.chez.com/scribe/>
- Date: Tue, 30 Oct 2007 14:36:24 +0100
Or you could see if a confirmation is needed when rendering the first page
and insert the javascript code that triggers this action when the event that
should trigger this confirmation is happening. Then when you are back to
running server side code you don't have to handle a client side confirmation
that was done before calling back the server side page.
"Betina Andersen" <byl@xxxxxxxxxxx> a écrit dans le message de news:
e6G%23CQvGIHA.4880@xxxxxxxxxxxxxxxxxxxxxxx
I have some code, from that code plus what the user has entered in the
browser, I creates an sql that checks something in a database, if there are
rows, the user has to be asked whether they will continue or not, if yes I
then has to proceed with my code - later in the code, again I have to ask
whether they will continue or not and I need to alert them also in the
middle of the code in my nutton.
Regards Betina
"Dave Bush" <davembush@xxxxxxxxxxx> skrev i en meddelelse
news:EA4F8C540B714389B3CA8835C00D8972@xxxxxxxxxxxxxx
Your problem is that you are thinking of web development as though it is
windows development. When programming windows, your presentation layer
and processing layer are tightly coupled so that if you say, "do this
now" it actually happens exactly at that point.
When you are developing for the web, your code behind is creating the
entire presentation in one chunch, sending it back to the browser and
then the browser renders it in one chunk.
It may be best if you describe the problem you are trying to solve
rather than describing the solution you are trying to implement.
-----Original Message-----
From: Betina Andersen [mailto:byl@xxxxxxxxxxx]
Posted At: Tuesday, October 30, 2007 8:16 AM
Posted To: microsoft.public.dotnet.framework.aspnet
Conversation: confirm in asp.net
Subject: confirm in asp.net
Hi
The following was posted in microsoft.public.dotnet.languages.vb - but
they
sait it could not be done, and that I should have posted here instead.
I am using vb in asp.net and I need to have a confirm in the middle of
my
code(code-behind), but cannot get the confirm to display when I want it,
but
it comes when my button has ended it code, any help appriciated.
Sub Button_Click
<code>
.
.
Dim scriptString As New StringBuilder
scriptString.Append("<script language='javascript'
type='text/javascript'>")
scriptString.Append("var ok=confirm('Budget findes i forvejen - Ønskes
det
overskrevet?\n" & strIkkeKopieret & "');" & "document.getElementById('"
&
Skjult.ClientID & "').value=ok;")
scriptString.Append("</")
scriptString.Append("script>")
ScriptManager.RegisterStartupScript(sender, Me.GetType, "Info",
scriptString.ToString, False)
.
.
<mere kode>
End Sub
Then the box shows here and not where I definded it to? I tries both the
ScriptManager.RegisterStartupScript and
theScriptManager.RegisterClienScriptBlock, I am using Ajax, so it has to
be
ScriptManager I have to use, as I understand it.
Regards Betina
.
- Follow-Ups:
- Re: confirm in asp.net
- From: Betina Andersen
- Re: confirm in asp.net
- References:
- confirm in asp.net
- From: Betina Andersen
- Re: confirm in asp.net
- From: Dave Bush
- Re: confirm in asp.net
- From: Betina Andersen
- confirm in asp.net
- Prev by Date: Re: confirm in asp.net
- Next by Date: Next GridView Question - how do you add a DropDown to an autogener
- Previous by thread: Re: confirm in asp.net
- Next by thread: Re: confirm in asp.net
- Index(es):