Hello everyone please let me know how to get data from url using c#(in .net core)
for e.g this is my url localhost:44368/blog?page=4 here how to get number 4 using c# code
Hello everyone please let me know how to get data from url using c#(in .net core)
for e.g this is my url localhost:44368/blog?page=4 here how to get number 4 using c# code
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Amit MohantyPosted Jul 5, 2022, 12:58 PM
RohanPosted Jul 6, 2022, 7:43 AM
Amit Please let me know This is my two url so How to get after / value in .cshtml page .
for e.g I want to My pricing page url so only get pricing page name and blog page so how to get /blog?page=4
https://localhost:44368/pricing --
https://localhost:44368/blog?page=4
I have use this
string strPathAndQuery = Context.Request.GetEncodedUrl();
string url_value = strPathAndQuery.Substring(strPathAndQuery.LastIndexOf("=") + 1);
RohanPosted Jul 5, 2022, 1:20 PM
Amit Mohanty Thanx save my life