Close the Browser when click on a button - asp.net

I have a project to order online and when the client finishes ordering I want to add a button to close the browser and return to WhatsApp messages where start ordering how can I close the browser when the client clicks not only one tap?
how can I close the browser when the client clicks not only one tap?

My guess is want to add a link to your website that sends the user back to your Whatsapp page. This does not involve manually closing a browser. Instead, you need to add a link to your webpage.
For example:
https://api.whatsapp.com/send?phone=18005551212&text=Hi!%20I%20want%20to%20increase%20my%20sales!
When clicked, this will send the user back to Whatsapp phone number 1-800-555-1212. You will need to change this to your phone number.
For additional information, Whatsapp instructions can be found at:
https://blog.wearedrew.co/en/3-steps-to-integrate-whatsapp-with-your-website

Related

How to insert a randomly generated number into an email using html with a button

I am very new to coding and would like to know if the below is possible:
I need to create an html email template with buttons that would essentially do the following:
I need an 'ACCEPT' button that would, when clicked on in the email, generate a unique/random 4-6 digit number for the client and also automatically send that number back to the sender as confirmation that the client has approved/accepted the quote. Almost like an OTP.
This number will serve as a confirmation number so I need it to be static, and for the client to therefor only be able to use the button once.
I will also be adding a 'REJECT' button which will cancel the client's appointment, but I would like to know if there is a way for it to then render the 'ACCEPT' button unusable?
The client cannot do this on the email itself, however, you can certainly do this when you generate the email.
That is:
On the back-end system you are using add the numbers to the accept and reject buttons, e.g. Accept
Send the email(s)
Customer opens the email and clicks Accept, going to https://www.website.com?number=12345
This page needs to be configured to read that number and record it in the database
The exact way to do this is dependent on the system you are using

How to view the address of the POST request made when an HTML button is clicked?

I am creating a project involving web scraping and web automation. I would like to first submit this form (http://rgsntl.rgs.cuhk.edu.hk/rws_prd_applx2/Public/tt_dsp_timetable.aspx) then once you submit this form, I want to scrape the HTML page that comes up. The problem is I am not sure how to submit this form through a Go program.
I was previously experimenting with Selenium to emulate a web browser but now I think there may be an easier way. I think that I should be able to make a POST request to the same address that the "submit" button of this form makes to and directly use the HTML page that is returned. The problem is that I cannot figure out how to get the address that the submit button makes a POST request to. I would like to ask if there is a way to monitor the address that the button makes a POST request to when it is clicked? Also if you see any flaws with my idea please do let me know. Thank you.
Right click mouse and select inspect option. After that select the Network tab.
When you fill all the entries and click submit button many urls flashes. Select the top url and under the headers tab you will see the request url for POST method.
See the image

Tracking clicks on Telegam inline keyboard buttons

We are using telegram bot to post advertisiment messages in channels. Ad message always has a text and inline keyboard button in reply markup. This button is a link to promoted resource. We want to track button clicks but there is a problem. As described here, button must contain exactly one of optional parameters - it means, that there will be no callback query if we use url for button. So, the qustion is - is there any cheating way to track clicks and keep button being link?
Current metod is adding layer on our server. Button is moving to our page on server, that redirects to final url. But it is very bad - often link is other telegram channel link and user's browser is opened, when there' is no need.
You need any shorten URL service like botanio for example.
Shorten url
Send GET request to
https://api.botan.io/s/?token={token}&url={original_url}&user_ids={user_id}
You get shortened url in a plain-text response (in case the response
code was 200). Codes other than 200 mean that an error occurred.
Also, in case of group chats you can add several user_ids:
&user_ids={user_id_1},{user_id_2},{user_id_3}, but currently this data
will not be used (because we don't know which particular user clicked
link).
Start chat with Botan in Telegram for getting token wich required in GET request and follow bot's recomendations. It can be helpful not only for URL track but for any click also.
Note that this service has problems in Russia as we can see from this issue. May be not in Russia only.
As the alternative you also may use Google URL Shortener, Bitly or many others.

Clear the browsing history on submit button click

I have a page with a about 200 controls on it and Submit, Close , SavenClose and Cancel buttons. My requirement is to clear the browsing history once any of these buttons are clicked.
As of now I am redirecting the users to the Home Page once any of these buttons are clicked where the users can click on GoBack on the browser and come back to main page which I dont want to .
Can anyone help me achieving this , probably give me a start up code pls.
Thank you.
You can't
This functionality is specifically within the browser's domain, and can't be accessed via javascript. It is for this reason many banks and organisations log you out when clicking 'back'.
You can however request the browser to not cache your pages, so clicking back will result in a "Cannot find this page - you need to refresh" message, this may be a suitable solution for you and is widely used.
I'm not sure but I think it's not possible to have control over a user browser functionality like "delete history".
You could add this javascript on the top of each webpage:
window.history.forward(1);
The user's browsing history is theirs to control. The best you can do is ask to close the tab via Javascript on the page after they submit. You can do this via window.close()

ASP.NET How can I disable re-sending of request to server on refresh?

I am developing a page whereby users can login and demo some pieces of functionality. I only want to allow the user to demo this once per day.
A small example:
I have a web page with 3 buttons (relating to 3 different scenarios). On page load, I look up the database and check if the current logged in user has run any one of the 3 scenarios available (via an audit table). Each button is enabled/disabled based on the results. If any buttons are enabled, then they have not run that demo yet. By clicking the relative button, the demo runs a record is written into the Audit Table, and the button is disabled.
This was working ok, however, I realised that when I refresh the page (and confirm I want to re-submit the information) the demo runs again.
How can I stop this from happening? I need to only allow the user to run the demo once!
Thanks.
I would suggest that you change your form submission to use the Post/Redirect/Get pattern to avoid a resubmission if they hit refresh on the demo page.
Also, it seems like you should just be able to change the code at the point where it writes the record into the audit table to check to see if the record already exists, and if so, return a different result. I'd be pretty wary about this approach though. The "refresh" functionality of the browser isn't generally something you should be trying to prevent. What happens if a user hits "refresh" in the middle of their demo?
you can check not only on the page load to enable/disable the buttons, but on the button events, you can verify if that task has already been performed

Resources