Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- http://localhost:4567/Test/Callback#state=test&access_token=....
- http://localhost:4567/Test/Callback
- var Uri = new Uri("http://localhost:4567/Test/Callback#state=test&access_token=....");
- // Contains the query
- Uri.Fragment
- #state=test&access_token=....
- Request.Url.ToString();
- http://localhost:4567/Test/Callback?state=test&access_token=...
- var url=@"http://localhost:4567/Test/Callback#state=test";
- var uri = new Uri(url);
- var result = uri.Fragment;
- string queryString = Request.Url.Query; // gives you "state=test&access_token=...."
- string state = Request.QueryString["state"]; // gives you "test"
- <script language="javascript" type="text/javascript">
- function JavaScriptFunction() {
- document.getElementById('<%= hdnResultValue.ClientID %>').value = document.URL;
- }
- </script>
- <asp:HiddenField ID="hdnResultValue" Value="0" runat="server" />
- <asp:Button ID="Button_Get" runat="server" Text="run" OnClick="Button_Get_Click" OnClientClick="JavaScriptFunction();" />
- protected void Button_Get_Click(object sender, EventArgs e)
- {
- string fullURL = hdnResultValue.Value;
- string URl = fullURL .Substring(fullURL .IndexOf('#') + 1);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement