How to change the current URL without reloading or refresh of the page in ASP.Net,C# or in JavaScript. I have written the following code . It is working in IE but not working in Chrome and Firefox. Please suggest me, how i will do it.
--------------------JavaScript Code-------------------
<script type="text/javascript" >
function getNextURL() {
var s = document.getElementById("hdnCP").value
PdtGalleryImage.getImageNextURL(s, retA);
return true;
function retA(response) {
window.location.href = response.value;
return true;
}
}
</script>
------HTML Code------------------
<div style="float:right; padding:0px 3px;"><asp:HiddenField ID="hdnF" runat="server" Value="0" />
<asp:LinkButton ID="lbtnNext" runat="server" CausesValidation="false" OnClientClick="javascript:getNextURL(); return true;" ToolTip="Next Page"><img src="images/next.jpg" width="13" height="13" alt="Next Page" /></asp:LinkButton>
</div>
-----C# Code--------------------
[Ajax.AjaxMethod]
public string getImageNextURL(int URl)
{
try
{
URl += 1;
int x = URl + 1;
strURL = "PdtGalleryImage.aspx?pos=" + x;
return strURL;
}
catch (Exception ex)
{
return "Error! on the Page.";
}
}