Archive

Posts Tagged ‘CSS’

Send Email from a Static HTML

April 29, 2017 11 comments

Send an email without back-end/server side code.

There are many solutions available for sending an email here I am explaining steps to sending an email from html page using Google Apps mail.

1. Make a Copy of the Sample Spreadsheet.

Sample: https://docs.google.com/spreadsheets/d/1Bn4m6iA_Xch1zzhNvo_6CoQWqOAgwwkOWJKC-phHx2Q/

1

2.Open the Script Editor

Open the Script editor… by clicking “Tools” > “Script editor…

3

3. Set the TO_ADDRESS in the Script

4

4. Save a New Version of your Script

Goto File-> Manager Version option to set Version

5. Publish the Updated Script as a Web App

Goto menu Publish-> Deploy as Web app option to publish

Select the latest project version to deploy:

7

6. Authorize the Script to Send Emails

Click Continue to authorize this app

8

Copy the web app URL to your clip board / note pad. Then Click “OK”.

10

7. Create your basic HTML Form

11

8. Open the HTML Form (page) in your Browser

Fill in some sample data in the HTML Form:

12

Submit the form. You should see a confirmation that it was sent like

{“result”:”success”,”data”:”{\”color\”:[\”\”],\”name\”:[\”Rahul\”],\”message\”:[\”This is test \”],\”email\”:[\”rahulgbhatia@live.com\”]}”}

Alternate solution : Use Ajax to submit the form

Hope this help !

Background Reading

 

iFrame CSS setting to allow full screen (allowfullscreen/webkitallowfullscreen/mozallowfullscreen)


iframe id=”id1″ runat=”server” visible=”false” src=”” width=”410″ height=”230″ frameborder=”0″ webkitallowfullscreen mozallowfullscreen allowfullscreen

webkitallowfullscreen
mozallowfullscreen
allowfullscreen

Hope this help !

while using window.print() the background colors for table cells not printing

November 27, 2013 Leave a comment

Common Problem while using windows.print() is that the background colors for table cells not printing

If you’re using IE, that behavior is controlled by user’s settings, Please follow the following steps

The Print background colors and images setting from the Advanced Tab of the Internet Explorers Tools, Internet options pane does not adjust the Print background colors and images setting of the Page Setup options in Internet Explorer 8. 
To work around this issue, verify that the Print background colors and images setting in the Page Setup settings is set correct. To do this, follow these steps:

[1] In Internet Explorer 8 click File from the menu and click Page Setup

[2] On the Page Setup dialog box ensure that the Print background colors and images setting is checked.

Click OK to close the Page Setup window and print your page again

Bundling and minification in MVC3 and Asp.Net 4.0

March 6, 2013 1 comment

Adding references:

First of all add the references of System.Web.Optimization.dll and WebGrease.dll to your MVC3 and Asp.Net 4.0 projects as shown below. You can download the dll by using download link.


Creating Bundle:

Now create the bundle for your css and js files with in the Global.asax file as shown below.

Here, I have created the bundle of all required css and js files. You can also add your own css and js files with complete path using Include method.

Registering Bundle:

Adding Bundles to Layout Page in MVC3:

Now you can add the above created style and script bundles to the Layout page or where you want to use as shown below:

Adding Bundles to Master Page in Asp.Net 4.0:

Now you can add the above created style and script bundles to the Master page or where you want to use as shown below:

In Asp.Net 4.0 you also required to add System.Web.Optimization namespace and assembly Microsoft.AspNet.Web.Optimization.WebForms reference to the web.config file of your Asp.Net 4.0 project as shown below:

You need not to do any changes in web.config file of your MVC3 project.

Enabling Bundling and Minification in debug mode

Bundling and minification doesn’t work in debug mode. So to enable this features you need to add below line of code with in Application_Start event of Global.asax.

How it works..

Now run your application and you will see that all the css and js files are converted to single css and js file as shown below:

Minification

Minification is technique for removing unnecessary characters (like white space, newline, tab) and comments from the JavaScript and CSS files to reduce the size which cause improved load times of a webpage. There are so many tools for minifying the js and css files. JSMin and YUI Compressor are two most popular tools for minifying the js and css files. Use these tools for minifiying your css and js files and use in your application with “.min” suffix. So that you can easily identified that this is a minimize version of your css or js file.

Hope it helps!