WebControls.calendar and java script

  • Thread starter Thread starter Junior
  • Start date Start date
J

Junior

I have a calendar object that is connected to a database. When the
user clicks on a date that has no entry in the database I issue a java
script popup message that asks the user if he wants to add an entry. I
need to get the true or false from the message box back to the server
but I dont know how. I've tried various solutions found on these
forums but I haven't gotten them to work. Any suggestions are welcome!
 
Hi,

Did you rty to insert the result into hidden field ?


<form id="Form1" method="post" runat="server">
<input runat="server" type="hidden" id="rv" name="rv">

function ask_onclick() {
document.body.all["rv"].value = confirm("Yada Yada");
}

private void Page_Load(object sender, System.EventArgs e)
{
if (this.rv.Value == "true")
{

HTH

Natty Gur[MVP]

blog : http://weblogs.asp.net/ngur
Mobile: +972-(0)58-888377
 
I can't get it to work properly... What I want to do is to make a kind
of rendezvous between the java script pop-up and the server code:
if(!hasData){
RegisterClientDataScript("confirm","<script
language=Javascript>confirm('Do you want to add data?');</script>";
// if confirm returns true do something else just continue...
is this even possible? the code above happens in the
Calendar_SelectionChanged mehtod.
 
Hi,

You can't return directly values from java client script into server
side script. the only way to transfer data between server and client
sides is through input HTML elements embedded in Form.

Natty Gur[MVP]

blog : http://weblogs.asp.net/ngur
Mobile: +972-(0)58-888377
 
Back
Top