locked
Is it possible to use the base URL as a Parameter/Filter RRS feed

  • Question

  • User293269538 posted

    Is it possible to use ONLY the base URL as a filter/parameter on page load?

    I have built a number of single page websites for a client all based on a single, identical template. The page is displaying data that gets populated from a database using vb.net code behind hard coded with the necessary parameters for each single page website to show its stuff.

    URL parameters, of course, would be the easy logical path... but, therein lies the issue. The URL address must stay clean... www.mywebsite.com with no URL parameters visible to the visitor to filter the data to alter page content appropriately.

    So, consequently, each page, for each site, is in it's own folder as a single stand-alone website. I've been at this for 16 years and feel like I'm missing something obvious. What am I missing?

    How can I have a single page show it's own unique data using just the base URL as the filter?

    Thursday, March 15, 2018 2:17 PM

All replies

  • User475983607 posted

    Use an HTTP POST to send the filter data in the HTTP message body.  This only stops the user from sending an HTTP GET from the browser address bar.  

    Thursday, March 15, 2018 2:19 PM
  • User283571144 posted

    Hi smdevivo,

    s it possible to use ONLY the base URL as a filter/parameter on page load?

    Do you mean you want to pass parameter with the base url?

    As far as I know, there multiple way to pass parameter between the page .

    As mgebhard says, we could use POST method to send the filter data in the HTTP message body.

    Besides, if you just want to send the parameter to backend to get the data and show in the page , I suggest you could consider using ajax.

    By using ajax, it will not refresh your page, javascript will auto send the request to backend to get the data and return to the page.

    The customer will not find the url changed in the browser.

    More details about how to use ajax, you could refer to below article.

    https://www.aspsnippets.com/Articles/Call-ASPNet-Page-Method-using-jQuery-AJAX-Example.aspx 

    Best Regards,

    Brando

    Friday, March 16, 2018 9:08 AM