Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

right now I use this

 

Page.RegisterStartupScript("errorscript", "<script> alert('Account Number not Valid!');</script>")

 

as a messagebox/warning.

But what I want is to be able to display a Yes/No type alert and capture the choice for server-side processing.

I know that this is possible.. I just don't know how.

 

can anyone please help me.

Posted

Hello,

 

User the javascript Confirm() messagebox. You should be able to capture the YES/NO and decide accrodingly.

 

Some sampel from web -

 

<SCRIPT language="JavaScript">

<!--

function go_there()

{

var where_to= confirm("Do you really want to go to this page??");

if (where_to== true)

{

window.location="http://yourplace.com/yourpage.htm";

}

else

{

window.location="http://www.barbie.com";

}

}

//-->

</SCRIPT>

 

 

 

HTH.

Jitesh Sinha
Posted

Hi Jitesh and thank you very much.

 

I have tried this option but that I want to do is to execute some ServerSide code (ASP.Net) depending on the choice.

 

I have also tried to reference an object on the page - a hidden textbox, and it works "fine"

 

I really want to find a way for me to catch the choice using server side code.

Posted

You can write the javascript code to get the page submitted back to the server and there you can do the further processing. Something like-

 

document.FormName.submit();

 

Please check for the correct syntax.

 

HTH.

Jitesh Sinha

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...