Skip to content Skip to footer

TIPS & TRICKS

TIPS & TRICKS

JavaScript

URLSearchParams returning null for the first query string

The URLSearchParams interface defines utility methods to work with the query string of a URL. const url = 'http://example.com?orderNumber=123456&pageSize=20'; const urlSearchParams = new URLSearchParams(url); console.log(urlSearchParams.get('orderNumber')); //result: null console.log(urlSearchParams.get('pageSize')); //result: 20 As shown in the above code snippet, it won't work as expected if you directly use the URL string in the URLSearchParams constructor. So the result of the first…

Read more

aspnet

Difference between Html.RenderAction and Html.Action

Html.RenderAction() and Html.Action()  methods   are available in ChildActionExtensions (System.Web.Mvc.Html) class in ASP.NET MVC. Generally both methods are used for calling action methods or child action methods  and rendering the result of action method in view. @Html.Action() – Invokes the specified child action method and returns the result as an HTML string. @{ Html.RenderAction(); } –…

Read more