Yes, i use that method ToolkitScriptManager.AddHistoryPoint., but i cannot do: "#&&Search=name/city/category/", because the automatic UrlEncode is giving me "#&&Search=name%2fcity%2fcategory%2f"
The question is - why it's encoding me the slash "/"?
It is security consideration that ToolkitScript tries to avoid the '/' character in the hash fragment. But you may yet try javascript see if it works in your browser
When i put it in the aspx asp:button OnClientClick="window.location.hash = 'name/city/category'" it's working, but when i tried to put it from codebehind it's not working.
Please advice how should i use window.location.hash from codebehind. I tried:
Digitborn.co...
Member
684 Points
450 Posts
ToolkitScriptManager.AddHistoryPoint UrlEncode
Apr 26, 2012 05:38 PM|LINK
Hello,
Is it possible to create a history point without the string got UrlEncoded. For example I want to have string in the addressbar like:
"#&&Search=name/city/category/"
the automatic UrlEncode is giving me "#&&Search=name%2fcity%2fcategory%2f"
One additional question is: What is the downside of using not UrlEncoded querystring except for the case:
..where you need to make difference between your main url and querystring itself and its parameters?
chetan.sarod...
All-Star
65759 Points
11153 Posts
Re: ToolkitScriptManager.AddHistoryPoint UrlEncode
Apr 26, 2012 06:03 PM|LINK
Hi, Please refer this
http://msdn.microsoft.com/en-us/library/system.web.ui.scriptmanager.addhistorypoint.aspx
Senior Software Engineer,
Approva Systems Pvt Ltd, Pune, India.
Digitborn.co...
Member
684 Points
450 Posts
Re: ToolkitScriptManager.AddHistoryPoint UrlEncode
Apr 26, 2012 06:42 PM|LINK
chetan,
Yes, i use that method ToolkitScriptManager.AddHistoryPoint., but i cannot do: "#&&Search=name/city/category/", because the automatic UrlEncode is giving me "#&&Search=name%2fcity%2fcategory%2f"
The question is - why it's encoding me the slash "/"?
BU XI - MSFT
All-Star
22367 Points
2704 Posts
Microsoft
Re: ToolkitScriptManager.AddHistoryPoint UrlEncode
Apr 30, 2012 07:55 AM|LINK
Hello
It is security consideration that ToolkitScript tries to avoid the '/' character in the hash fragment. But you may yet try javascript see if it works in your browser
window.location.hash = '&&Search=name/city/category';
If you have any feedback about my replies, please contact msdnmg@microsoft.com.
Microsoft One Code Framework
Digitborn.co...
Member
684 Points
450 Posts
Re: ToolkitScriptManager.AddHistoryPoint UrlEncode
Apr 30, 2012 10:40 AM|LINK
When i put it in the aspx asp:button OnClientClick="window.location.hash = 'name/city/category'" it's working, but when i tried to put it from codebehind it's not working.
Please advice how should i use window.location.hash from codebehind. I tried:
protected void Button1_Click(object sender, EventArgs e) { ClientScript.RegisterStartupScript(Page.GetType(), "ChangeToHash", "window.location.hash = 'name/city/category';", true); }I also tried:
protected void Page_Load(object sender, EventArgs e) { if (Request.Form.AllKeys.Contains("Button1")) { //it gets here in button1_click event ClientScript.RegisterStartupScript(Page.GetType(), "ChangeToHash", "window.location.hash = 'name/city/category';", true); } } //nothing in Button1_Click eventAlso, can i somehow avoid the "#" sign using the window.location.hash?