Hi,
How can i convert my url from http://localhost:344605 Details?name=jo to http://localhost:34405/Details/jo
my jquery query string to pass data is
$("#btnsubmit").click(function () {
var Textdata = $('#txtdata').val();
var url = "Details?name=" + encodeURIComponent(Textdata);
window.location.href = url;
});
and global.asax is
void Application_Start(object sender, EventArgs e)
{
RegisterRoutes(RouteTable.Routes);
}
public void RegisterRoutes(RouteCollection routes)
{
routes.MapPageRoute("Details", "Details{name}", "~/Details.aspx");
}
in Details.aspx.... cannot read query string value with the below code now(after adding Details.aspx to global.asax)
function getdealsearch() {
var name = window.location.search.split('=')[1] == undefined ? '' : window.location.search.split('=')[1];
$.ajax({
type: "POST",
url: "/WebService.asmx/Getbyname",
data: '{Name:"' + name + '"}',
contentType: "application/json; charset=utf-8",
dataType: "json"
});
}
Any code to read jquery query string and convert my url from http://localhost:34405/Details?name=jo to http://localhost:34405/Details/jo