Showing posts with label CSS. Show all posts
Showing posts with label CSS. Show all posts

Wednesday, 20 February 2013

How to get username from JQuery

 
Use below Jquery to get the Current User name
var thisUserAccount = $().SPServices.SPGetCurrentUser({
                fieldName: "Title",
                debug: false
});
Use below code to get the ID for Current User
var thisUserAccount = $().SPServices.SPGetCurrentUser({
                fieldName: "ID",
                debug: false
});
Use below code to get the LoginName for Current User
var thisUserAccount = $().SPServices.SPGetCurrentUser({
                fieldName: "Name",
                debug: false
});

Tuesday, 22 January 2013

line break in databound field gridview asp.net

Line break or new line html tags in databound field gridview asp.net:

Gridview Boundfield not allowing HTML tags, specifically < br >
Below code display a string with one or more linebreaks in an asp:gridview using <br/>. 

<asp:BoundField DataField="appText" HeaderText="Application Name"   
                        HtmlEncode="false" SortExpression="apptext"/>

Friday, 31 August 2012

How to set 2 two background image using css style class in body tag elements html

HTML CSS Tricks 1: ( To apply background image for whole page )

We could set two background images using html and body tag elements in CSS styles class.
The below sample code snippet used to set the background image (tile.jpg) / color for the whole page (html css) and bc_head.png image has to be displayed just above the background tile image / color.
 
html {
                    background: #000 url("images/tile.jpg")  repeat;
                }                            
body {
                    background: url("images/bc_head.png")  repeat-x;
                    background-position: left top;
                } 

HTML CSS Tricks 2:( To apply background image for not whole page and only for body  )


To apply background image for not whole page and only for body, Consider the following code.
We can create table / div elements inside body tag and write css style class names.

HTML Source:

<body>
<table> <tr>
<td class="a"><div class="b">...</div></td>
</tr></table>
 </body>

CSS style Class name:

.a
{
  background-image: url(a.png);
}
.b
{
  background-image: url(b.png);
}