Wednesday, July 5, 2023

Mixed Content: The page at xxx was loaded over HTTPS, but requested an insecure

 Mixed Content: The page at 'https://www.test.com/signup.aspx' was loaded over HTTPS, but requested an insecure script 'http://api.Test.com/testform.js?field=Test'. This request has been blocked; the content must be served over HTTPS.

Error screen shot below


 to solve the error by adding this code to your html file:

script.src = ("https:" == document.location.protocol ? 'https' : 'http') + ":///api.Test.com/testform.js?field=Test?











Wednesday, September 30, 2020

Comma Separated List of all columns for tablename in the Database

 select t.name, 

        STUFF ((

            select ',' + c.name

            from sys.columns c

                join sys.tables tt on tt.object_id = t.object_id and t.object_id = c.object_id

                join sys.schemas s on tt.schema_id = s.schema_id

            order by t.name, c.column_id

            for xml path('')), 1, 1, '') as columns

from sys.tables t

            where t.name = 'Test'--'PutTableNameHere if you want to filter'

Monday, June 29, 2020

How to make Bootable Pendrive (USB Drive)

Boot a Pendrive
_______________________________

 Boot cmd :

step1: diskpart
step2: list disk
step3: select disk 1
step4: clean
step5: create partition primary
step6: format fs=fat32 quick or format fs=ntfs quick
step7: active
step8: assign
step9: exit
step10: exit

Wednesday, June 17, 2020

Check if a stored procedure has a specified parameter with a SQL script

INFORMATION_SCHEMA view that you could use is PARAMETERS. This query will list all stored procedures that have such a parameter:


SELECT DISTINCT p.SPECIFIC_NAME
FROM INFORMATION_SCHEMA.PARAMETERS p
WHERE p.PARAMETER_NAME = '@x'

Syntax


SELECT DISTINCT p.SPECIFIC_NAME
FROM INFORMATION_SCHEMA.PARAMETERS p
WHERE p.PARAMETER_NAME = '@Pageno'

Monday, March 16, 2020

How to use Querystring Parameters in Asp.Net MVC to Retrieve or Send Data


Query string in asp.net mvc with accessing from URL now let’s call Action Method from Action Link from passing Query string. Calling Action method from Action Link with Passing Query string.



With Optional Parameters 

@Html.ActionLink("Call Index Action", "Index", new { ID = 10, Name = 3, Department = "test" })

Without Optional Parameters 

@Html.ActionLink("Call Details Action", "Details", new { Name = 3, Department = "test" })

Friday, March 13, 2020

How to generate List of previous 12 months with year from DateTime.Now

var lastSixMonths = Enumerable.Range(0, 12)
                                   .Select(i => DateTime.Now.AddMonths(i -12))
                                    .Select(date => date.ToString("MMM"));


Output :
  "Mar"
"Apr"
"May"
"Jun"
"Jul"
"Aug"
"Sep"
"Oct"
"Nov"
"Dec"
"Jan"
"Feb"


var lastSixMonths = Enumerable.Range(0, 12) .Select(i => DateTime.Now.AddMonths(i -12)) .Select(date => date.ToString("MM/yyyy"));

Output :
  "03/2019"
"04/2019"
"05/2019"
"06/2019"
"07/2019"
"08/2019"
"09/2019"
"10/2019"
"11/2019"
"12/2019"
"01/2020"

"02/2020"

Wednesday, March 11, 2020

Visual Studio Expand/Collapse keyboard shortcuts

Ctrl+M,O would collapse all constructors, methods, properties in a file. It would also collapse all regions.

Ctrl+M,L would expand all constructors, methods, properties in a file. It would also expand all regions.



Visual studio 2017 except it is turned off by default. It can be enabled under Tools -> Options -> Text Editor -> C# -> Advanced -> Outlining -> "Collapse #regions when collapsing to definitions"



Visual Studio 2015:

Tools > Options > Settings > Environment > Keyboard
Defaults:

Edit.CollapsetoDefinitions: CTRL + M + O

Edit.CollapseCurrentRegion: CTRL + M +CTRL + S

Edit.ExpandAllOutlining: CTRL + M + CTRL + X

Edit.ExpandCurrentRegion: CTRL + M + CTRL + E

To set and use IntelliJ's shortcuts:

Edit.CollapsetoDefinitions: CTRL + SHIFT + NUM-

Edit.CollapseCurrentRegion: CTRL + NUM-

Edit.ExpandAllOutlining: CTRL + SHIFT + NUM+

Edit.ExpandCurrentRegion: CTRL + NUM+


Collapse to definitions
CTRL + MO
Expand all outlining
CTRL + MX
Expand or collapse everything
CTRL + ML

Mixed Content: The page at xxx was loaded over HTTPS, but requested an insecure

 Mixed Content: The page at ' https ://www.test.com/signup.aspx' was loaded over HTTPS, but requested an insecure script ' http ...