<html> <head> <style> body { margin: 0px; overflow: hidden; background: #000; } #background { position: absolute; margin-top: 50px; width: 1024px; height: 600px; } #container { height: 600px; width: 1024px; position: absolute; top: 100px; } span { color: #bcd2ee; font-size: 28px; } </style> <script> function center_object(v) { var obj = document.getElementById(v); if (parseInt(navigator.appVersion)>3) { if (navigator.appName=="Netscape") { var ww = window.innerWidth; var gw = obj.clientWidth; var l = ((ww-gw)/2)-4; obj.style.left = l+"px"; } if (navigator.appName.indexOf("Microsoft")!=-1) { var ww = document.body.offsetWidth; var gw = obj.offsetWidth; var l = ((ww-gw)/2)+16; obj.style.left = l+"px"; } } } </script> </head> <body onload="center_object('background');center_object('container');" onresize="center_object('background');center_object('container');"> <img id="background" src="myImage.jpg" width="512" height="100%" border="6" /> <div id="container"> <span> <p>The div with the ID "container" is used as the new body of your web page.</p> <p>Any thing you want displayed above the background image, must be contained in this div.</p> <p>The "container" div is totally independant of the background image.</p> <p>The background image's dimensions can be set to any dimensions you choose.</p> <p>The background image and the "container" div can be positioned anywhere on the screen you choose.</p> <p>The JavaScript function center_body() is used to center the main elements within the body.</p> </span> </div> </body> </html>
Life is a Short Span, try to earn knowledge in every Field.
Thursday, 8 March 2012
The JavaScript function center_body() is used to center the main elements within the body.
Tuesday, 6 March 2012
How to get the Paged GridView row count
var currentCount = (gv.PageIndex - 1) * gv.PageSize + gv.Rows.Count;
if gv is the grid view
Customizing color of the cell as per the value/condition in a Paged DataGrid
private void GetData()
{
dgParticipantList.DataSource = dataAccess.GetAllParticipants();
dgParticipantList.DataBind();
int pageCount = dgParticipantList.PageCount;
for (int pageno = 1; pageno <= pageCount; pageno++)
{
int rowCount = dgParticipantList.Items.Count;
for (int row = 0; row < rowCount; row++)
{
Literal status = dgParticipantList.Items[row].
FindControl("litStatus") as Literal;
FindControl("litStatus") as Literal;
if (status != null && status.Text.Equals("Selected"))
{
dgParticipantList.Items[row].Cells[4].BackColor = Color.Green;
dgParticipantList.Items[row].Cells[4].ForeColor = Color.White;
}
else if (status != null && status.Text.Equals("Not Selected"))
{
dgParticipantList.Items[row].Cells[4].BackColor = Color.Red;
dgParticipantList.Items[row].Cells[4].ForeColor = Color.White;
}
}
}
}
How to Design a Form just like in a tabular format without using Table
<HTML>
<head><titlt>TableLess Form</title>
<style type="text/css">
label, input, select, textarea { display: block; float: left; width: 150px; margin-bottom: 10px; } label { width: 110px; text-align: right; padding-right: 10px; margin-top: 2px; } textarea { height: 50px; } br { clear: left; }
</style>
</head>
<body>
<form>
<label for="firstname">First Name:</label>
<input type="text" name="firstname" id="firstname" tabindex="1"/>
<label for="address">Address:</label>
<input type="text" name="address" id="address" tabindex="5"/><br/>
<label for="lastname">Last Name:</label>
<input type="text" name="lastname" id="lastname" tabindex="2"/>
<label for="city">City:</label>
<input type="text" name="city" id="city" tabindex="6"/><br/>
<label for="emailaddress">Email Address:</label>
<input type="text" name="emailaddress" id="emailaddress" tabindex="3"/>
<label for="province">State:</label>
<select name="state" id="state" tabindex="7">
<option value="0">--Select State--</option>
<option value="AP">Andhara Pradesh</option>
<option value="OD">Odisha</option>
<option value="BH">Bihar</option>
<option value="WB">West Bengal</option>
<option value="UP">Uttar Pradesh</option>
</select><br/>
<label for="comments">Comments:</label>
<textarea name="comments" id="comments" tabindex="4"></textarea>
<label for="postalcode">Postal Code:</label>
<input type="text" name="postalcode" id="postalcode" tabindex="8"/><br/>
</form>
</body>
</html>
Labels:
HTML-CSS
Location:Mayur Marg, Begumpet, Hyd-16, India
Berhampur, Orissa, India
Validating Date in C# using CultureInfo
Write this code in the aspx page or in the utility file.
private bool ValidateDate(string date) { bool isDateValid = true; try { IFormatProvider culture = new CultureInfo("fr-FR", true); DateTime.ParseExact(date, "dd/MM/yyyy", culture); } catch (Exception exceptionObject) { isDateValid = false; } return isDateValid; }
// call the function passing with a date
Monday, 5 March 2012
rotation in IE-7
<!-- This DIV is the target container for an image. -->
<DIV ID="oDiv" STYLE="position:absolute; left:270px;" >
An Image - >
<IMG SRC='/workshop/graphics/earglobe.gif' />
</DIV>
<BUTTON onclick="oDiv.style.filter=
'progid:DXImageTransform.Microsoft.BasicImage(rotation=3)'">
Rotate 270 degrees</BUTTON><BR/>
<BUTTON onclick="oDiv.style.filter=''">Clear Filter</BUTTON><BR/>
Removing Dotted Border on Clicked Links Using CSS
css:---
/* hide the dotted lines around an element when it receives focus */
* { _noFocusLine: expression(this.hideFocus=true); } /* ie7 */
::-moz-focus-inner {border:0;} /* firefox */
:focus {outline:none;} /* ie8, chrome, etc */
Reference:
Unable to evaluate expression because the code is optimized or a native frame is on top of the call stack
Unable to evaluate expression because the code is optimized or a native frame is on top of the call stack
" Unable to evaluate expression because the code is optimized or a native frame is on top of the call stack" - This is one of the common error we see in forum where people request solution for it.
Below is a small explanation and resolution to resolve this issue,
This error normally occurs when we use Response.Redirect or Server.Transfer or Response.End in your code before completing the actual process the page was doing.
In this case what you have to do is
In place of Response.End you have to use HttpContext.Current.ApplicationInstance.CompleteRequest
and in place of Response.Redirect, use the Response.Redirect ("Paganame.aspx", false);
and in place of Server.Transfer, use the Server.Execute method
There is also a KB article related to this issue,
Deleting Duplicates From 1D array
int * DeleteDuplicateItems(int array[])
{
int n=array.length;
for(int i=0;i<n-1;i++)
{
for(int j=i+1 ; j<n ; j++ )
{
if(array[i] = = a[ j])
{
n=n-1;
for(int k=j ; k<n ; k++ )
{
a[k]=a[k+1];
j=j+1
}
}
}
}
Removing Dotted Border on Clicked Links using JQuery
var links = document.getElementById('nav').getElementsByTagName('a'); for ( var i = 0; i < links.length; i++ )
{ links[i].onmousedown = function ()
{ this.blur(); return false; } links[i].onclick = function()
{ this.blur(); }
if ( /msie/i.test(navigator.userAgent) && !/opera/i.test(navigator.userAgent) )
{ links[i].onfocus = function() { this.blur(); }
}
}
$('a').live('mousedown', function(e) { e.target.blur(); e.target.hideFocus = true; e.target.style.outline = 'none' }).live('mouseout', function(e) { e.target.blur(); e.target.hideFocus = false; e.target.style.outline = null; });
Subscribe to:
Posts (Atom)