Get current url on PageLoad and assign that value to asp.net textbox control.
Ex: I get this url using the following script, in that url i want to get url of the last value and the name lakshmi.
http://www.dotnetsharepoint.com/2014/01/cannnot-connect-to-performance-point/lakshmi.aspx
<asp:TextBox ID="txt_name" runat="server"></asp:TextBox>
Script:
$(document).ready(function () {
var currenturl = $(location).attr('href');
//alert(currenturl ); //In currenturl i am getting current url
var pagename = jloc.substr(jloc.lastIndexOf(' /') + 1);
//alert(pagename); // In pagename i am getting "lakshmi.aspx"
var name = pagename.split('.')[0]; //In name am getting the "lakshmi"
//alert(name);
var fname = $("#<%=txt_txtname.ClientID%>" ).val(name); //assign value to asp textbox
$("#mytext").val(name); //html id type