0
嘿希望javascript已经被确认后连接到另一个aspx文件,但不知何故它不会将浏览器导向到url。这里是我得到ASP/Javascript onClientClick安全检查()
<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");
}
}
感谢,但它仍然犯规重定向到的链接。我想它不理解链接的格式? – gsharpp
实际上,我只是用http://www.google.com取代了该链接,并且它不会将其直接发送到那里。 hmm – gsharpp
试试'window.location =“http://www.google.com/”;' – Samich