B
Betina Andersen
Hi
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
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