c# - Find the referring URL and parse it -


okay problem there 2 websites 2 different servers. i'm trying write of buttons website 1, on page on server (website 2).

so approach is

  • user clicks on button website 1.
  • user redirected website 2.
  • i need know page came know product looking at. done getting referrer url.
  • i need parse url's productid's number.

example url: website1.com/productdetails/?referrerpage=1&productid=#######&tab=tile

i know need use piece of code store referrer url in string:

myreferrer = request.urlreferrer.tostring(); 

i don't know place tho. i'm guessing in .cs file button is?

protected void btnestimate_click(object sender, eventargs e) {     connection strings     {         stuff         {             stuff         } 

so question how referring url, , parse out item id?

thanks in advance. if unclear please ask... first time asking question may unclear. thanks!

this should give want:

making sense of asp.net paths

note qualified url including querystring , path uri instance rather string. can use uribuilder.query property extract query string parameter(s):

you need parse uri in page_load method of receiving site's page.

uribuilder.query property


Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -