posted 12 years ago
i try many things but they all are opening the webpage in other window.Can any one give ans "How to open a webpage(webForm1.aspx) in same window "
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div> <asp:Button ID="Button1" runat="server" Text="Button 1" OnClientClick="Func()"/>
<input type="text" id="text" />
</div>
</form>
</body>
</html>
<script type="text/javascript" language="javascript">
function Func() {
var Store = document.getElementById('text');
var abc= Store.value;
if (abc == "HI") {
//window.open("WebForm1.aspx");
//document.location = "WebForm1.aspx";
// top.frames[0].location = "WebForm1.aspx";
//self.location = "WebForm1.aspx";
//parent.location = "WebForm1.aspx";
window.location.href = "Default2.aspx";
}
else {
alert('Cancelled');
}
}
</script>