0

嘿,在它被确认链接到另一个 aspx 文件之后想要 javascript,但不知何故,它不会将浏览器定向到 url。这是我得到的

<asp:ImageButton ID="Donebtn" runat="server" ImageUrl="~/images/done.jpg" ToolTip="Done. Add new activity" CommandName="Done" CommandArgument='<%#Eval("ActivityID") %>' OnClientClick="return SecurityCheck();" /> 

javascript

function SecurityCheck() 
  {

      return window("Mark Activity as completed and add new Activity?");
      if (o == true) 
      {
          window.location.href = 'CustomerHome.aspx?CustomerId=<%#Eval("CustomerID")%>';

      }
      else 
      {
          return window("No changes will be made");
      }
  }    
4

1 回答 1

0

What is o object? You need to use following:

function SecurityCheck() 
{
  var answer = confirm("Mark Activity as completed and add new Activity?");
  if (answer) 
  {
      window.location.href = 'CustomerHome.aspx?CustomerId=<%#Eval("CustomerID")%>';
  }
  else 
  {
      alert("No changes will be made");
      return false;
  }
} 

Live

于 2011-09-16T10:36:01.627 回答