2011-09-16 8 views
0

他のaspxファイルへのリンクを確認した後、javascriptが必要ですが、どういうわけかブラウザをURLに誘導しません。ここで私はASP/Javascript onClientClick SecurityCheck()

<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"); 
     } 
    }  

答えて

0

oオブジェクトがどのようなものです得たものでしょうか?

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

+0

おかげで、それはまだリンクにリダイレクトdoesntの:あなたは、次を使用する必要があります。私はそれがリンクの形式を理解していないと思いますか? – gsharpp

+0

実際には、私はリンクをhttp://www.google.comに置き換えただけです。 hmm – gsharpp

+0

'window.location =" http://www.google.com/ ";' – Samich

関連する問題