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.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Amit MohantyRank #112 · 20K reputationPosted Jul 5, 2022, 8:58 AM EDT
RohanRank #1,548 · 1K reputationPosted Jul 5, 2022, 9:20 AM EDT
Amit Mohanty Thanx save my life
RohanRank #1,548 · 1K reputationPosted Jul 6, 2022, 3:43 AM EDT
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);