Browser back button triggers previous post action in .NET webform application – solved

Recently while working on one of my .NET application I was stuck in a strange problem. I created a button and its click event to insert some entry in database and at the end of this action I used below statement to redirect the page for next step.

Response.Write("<script>top.location="next step page url";</script>");

Note: I used this method to redirect the page because I was doing it in an iframe and wanted to redirect parent page after this step is completed and next step is started. Keep on reading

Create multiple custom controls dynamically in Google Map API

If we want to create google map javascript api’s custom control then we can find the solution in developer guide of google map api but if we want to create custom control dynamically by sending its html and position in PHP then, we did not find its solution easily. I have created the custom control dynamically using javascript and PHP, so I am posting my content here, so anyone can get help. My code is here :

//Define custom control html and position here
//Here I am creating more than one custom control
<?php
$custom_control_html = array(
0 => array(‘html’=>’Control 1’, ‘position’=>’TOP_LEFT’),
1=> array(‘html’=>’Control 2’, ‘position’=>’TOP_CENTER’)
);
?> Keep on reading

Geocoding & Reverse Geocoding in Google Map Javascript API

Geocoding is a technique of Google Map API which is used to get complete information about an address like its geographic coordinates (latitude, longitude), its city, state, postal_code, country etc. In javascript, we can just simply use below code to get geographic coordinates of any location :

<script type=”text/javascript”>
var geocoder_obj = new google.maps.Geocoder(); Keep on reading

How to use Google Map Geocoding API in PHP

Google Map API has geocoding technique from which we can get information about latitude/longitude, complete address information like region, city, country etc.. of any address. We can also perform reverse geocoding by passing the latitude and longitude of a place and then can get its address and other additional information. Sometimes, we may need to use google map api in  PHP instead of javascript.

So, whenever you need to use Google Map API’s geocoding service, you can use it by sending request to this url https://maps.googleapis.com/maps/api/geocode/json?address={your_address}&key={#YOUR_API_KEY} using curl method of PHP as : Keep on reading

[Solved] How to allow user to do login after submission of gravity form

We can create gravity form of having any type of fields. If we want to create a login form using gravity form, then to allow user to do login , we will have to perform extra actions for it. Suppose if I have a gravity form having ID 1 and having username, email fields and login button, then I will have to perform extra actions in the gform_after_submission filter of gravity form, as :

add_action( ‘gform_after_submission_1’, ‘do_login’, 10, 2 ); Keep on reading

Update WordPress Post URL also, whenever Post Title gets changed

In our wordpress theme or wordpress plugins, there may be have used many methods or filters to add/edit posts or custom type posts. We know, once a post is created and then we edit its title then its slug or url does not change automatically.

To change the URL of wordpress post according to its title, we will have to use this filter hook in our functions.php : Keep on reading

[Solved] How to set dynamic confirmation url in ajax enabled gravity form OR Redirect user to the newly created post by gravity form

In gravity form settings, there are two kind of confirmations, first is redirect url and second is text. You can either redirect user to another page like thank you page after form submission or you can show the confirmation text like thank you, your form is submitted successfully.

For the redirect setting, we can use there form field values also, to set string etc, but we can’t set there completely dynamic url on based of conditions. For example, I have used Post fields in my gravity form, from which post creates automatically after submitting the form. Now, if I want ti redirect my user to the newly created post which is just created by him by submitting the form, then I cannot do it via Form settings. Keep on reading

wp nonce in ajax calls to secure ajax call request

We all know that it is a best protocol to use wp nonce methods in wordpress to secure the POST or GET requests. WordPress nonce method creates a string that can be used once and have a limited lifetime after they expire. Thus by verifying the created nonce we can authenticate the incoming request. To use wp-nonce in ajax calls, first we will have to pass the nonce to our jquery file, in which we are having code of ajax request.

To pass the nonce value in jquery file, we will have to localize the jquery script as : Keep on reading

Download Visual Studio 2017 ISO (offline installer) + Web Installer

This is a simple guide to download offline installer or ISO file for Visual Studio 2017.

As you all new Microsoft always provides web installer file for all new releases of Visual studio and on 7th March Microsoft has launched Visual Studio 2017 and this time also they haven’t provided offline installer or ISO file of the setup so we are here to explain how you can obtain offline installer or ISO file from this web installer EXE. Keep on reading