Remove gap between marquee tags


Thursday, October 8, 2009

Question: How to remove gap or space between marquee tags ?

Answer :

<html>
<style type="text/css">
img {
width: 200px;
height: 75px;
}
#marqueecontainer
{
position: relative;
width: 200px; /*marquee width */
height: 200px; /*marquee height */
background-color: white;
overflow: hidden;
border: 3px solid black;
padding: 2px;
padding-left: 4px;
}

</style>
<script type="text/javascript">
var delayTime=5
var marqueeSpeed=2
var pauseTime=1
var copySpeed=marqueeSpeed
var pauseSpeed=(pauseTime==0)? copySpeed: 0
var actualHeight=''

function ScrollMarquee()
{
if (parseInt(crossMarquee.style.top)>((actualHeight / 2)*(-1)+8))
crossMarquee.style.top=parseInt(crossMarquee.style.top)-copySpeed+"px"
else
crossMarquee.style.top=parseInt((marqueeheight - (actualHeight / 2)) / 2)+8 +"px"
}

function InitializeMarquee()
{
crossMarquee=document.getElementById("vmarquee")
crossMarquee.style.top=0
marqueeheight=document.getElementById("marqueecontainer").offsetHeight
actualHeight=crossMarquee.offsetHeight;
if (window.opera || navigator.userAgent.indexOf("Netscape/7")!=-1)
{
crossMarquee.style.height=marqueeheight+"px"
crossMarquee.style.overflow="scroll"
return
}
setTimeout('lefttime=setInterval("ScrollMarquee()",30)', delayTime)
}

if (window.addEventListener)
window.addEventListener("load", InitializeMarquee, false)
else if (window.attachEvent)
window.attachEvent("onload", InitializeMarquee)
else if (document.getElementById)
window.onload=InitializeMarquee

</script>
<div id="marqueecontainer" onMouseover="copySpeed=pauseSpeed" onMouseout="copySpeed=marqueeSpeed">
<div id="vmarquee" style="position: absolute; width: 98%;">

<div id="copy1" style="background: red;">
<div><img src="http://www.activemax.com/wp/wp-content/uploads/2008/10/google_sitemap.gif"></div>
<div><img src="http://ebinture.files.wordpress.com/2008/07/google-mobile-logo-copy.jpg"></div>
<div><img src="http://images4.pocket-lint.com/images/2Mlt/google-chrome-internet-browser-review-0.jpg"></div>
<div><img src="http://images.pcworld.com/news/graphics/165679-google_wave_logo_take2_180.jpg"></div>
<div><img src="http://www.coffeecup.com/images/software/icons/google-sitemapper_4.7.1_win_en.png"></div>
</div>

<div id="copy2" style="background: blue;">
<div><img src="http://www.activemax.com/wp/wp-content/uploads/2008/10/google_sitemap.gif"></div>
<div><img src="http://ebinture.files.wordpress.com/2008/07/google-mobile-logo-copy.jpg"></div>
<div><img src="http://images4.pocket-lint.com/images/2Mlt/google-chrome-internet-browser-review-0.jpg"></div>
<div><img src="http://images.pcworld.com/news/graphics/165679-google_wave_logo_take2_180.jpg"></div>
<div><img src="http://www.coffeecup.com/images/software/icons/google-sitemapper_4.7.1_win_en.png"></div>
</div>

</div>
</div>
</html>


Hope this post will help you,
if yes please put comment below of this page,
Rajesh Singh,
Asp.Net Developer
Indianic Infotech Ltd (India)
rajesh@indianic.com

Use of Cursor in Stored Procedure


Wednesday, October 7, 2009

Using below code you can learn, how to use cursor in Stored Procedure

DECLARE @dListingEnddate datetime

DECLARE cur_enddate1 CURSOR FOR( select top 10 dListingEnddate as dListingEnddate from jau_productmaster)

/* Open Corsor */
OPEN cur_enddate1

FETCH NEXT From cur_enddate1 INTO @dListingEnddate

WHILE @@Fetch_Status = 0

BEGIN
/*Put your sql query here*/
--INSERT INTO GK_ShareEvent (iShareEventID,iEventAudienceID)
--VALUES(@iEventID,@iEventAudienceID)

FETCH NEXT From cur_enddate1 INTO @dListingEnddate

END

/* Close Corsor */
CLOSE cur_enddate1

DEALLOCATE cur_enddate1

END




-------------------------------------------------------------------------------------------
Hope this post will help you,
if yes please put comment below of this page,
Rajesh Singh,
Asp.Net Developer
Indianic Infotech Ltd (India)
rajesh@indianic.com

Set IIS server as Default Server to Visual Studio


Monday, October 5, 2009

The ASP.NET Development Server is the default way to run the project from VS 2005.

To run the .net Application from the local IIS, Please follow the step given below.

1 Create Virtual Directory of your application in IIS on your local machine.

2 Go To Website / Start Options from the Menu or right click of project name form solution explorer and go to project property and select start option.

3 Select Start Options in the Tree on the left of the box.

4 Select Use Custom Server

5 Enter the URL of the database on the local box (http://localhost/MyWeb where "MyWeb" is the Virtual Directory.

This will put you back in the standard IIS debug.

This fixed a problem that I was having with the Infragistics controls that I am using.

Hope this post will help you,
if yes please put comment below of this page,
Rajesh Singh,
Asp.Net Developer
Indianic Infotech Ltd (India)
rajesh@indianic.com

Set Default button in Asp.Net




Sometime it happen, that you enter text in textbox and you press enter and some other submit button get pressed, so here is the solution below, using below code you can set your default button.

HTML code

enter your table inside div tag and put onkeypress event in div tag
-----------------------------------------------------------------------------------------

<div id="pnlSearch" onkeypress="javascript:return WebForm_FireDefaultButton(event, 'btnSearch')">



<table width="50%" cellpadding="0" cellspacing="0">

<tr>

<td>

Search :

</td>

<td>

<input name="txtSerach" type="text" id="txtSerach" />

</td>

<td colspan="2">

<input type="submit" name="btnSearch" value="Search" id="btnSearch" />

</td>

</tr>

</table>

</div>
------------------------------------------------------------------------------------------


Put this fuction inside script tag in your web page

------------------------------------------------------------------------------------------
function WebForm_FireDefaultButton(event, target) {

if (event.keyCode == 13) {

var src = event.srcElement || event.target;

if (!src || (src.tagName.toLowerCase() != "textarea")) {

var defaultButton;

if (__nonMSDOMBrowser) {

defaultButton = document.getElementById(target);

}

else {

defaultButton = document.all[target];

}

if (defaultButton && typeof(defaultButton.click) != "undefined") {

defaultButton.click();

event.cancelBubble = true;

if (event.stopPropagation) event.stopPropagation();

return false;

}

}

}

return true;

}
------------------------------------------------------------------------------------------

Hope this post will help you,
if yes please put comment below of this page,
Rajesh Singh,
Asp.Net Developer
Indianic Infotech Ltd (India)
rajesh@indianic.com

The base class includes the field 'headermain', but its type (Headermain) is not compatible with the type of control (ASP.include_headermain_ascx).


Wednesday, September 9, 2009

I had posted this question on http://forums.asp.net/

The question was

I am getting this error " The base class includes the field 'headermain', but its type (Headermain) is not compatible with the type of control (ASP.include_headermain_ascx). "


in line :

&lt;TD vAlign="top" align="left" width="100%" colSpan="2"><uc1:headermain id="headermain" runat="server"></uc1:headermain ></TD>
Please find my code :

The name space ,i am using is this 
 <%@ Register TagPrefix="uc1" TagName="Leftmain" Src="include/Leftmain.ascx" %><%@ Register TagPrefix="uc1" TagName="Leftmain" Src="include/Leftmain.ascx" %> <%@ Register TagPrefix="uc1" TagName="Headermain" Src="include/Headermain.ascx" %>
The code is 
<TD vAlign="top" align="left" width="100%" colSpan="2"><uc1:headermain id="headermain" runat="server"></uc1:headermain></TD> <TD vAlign="top" align="left" width="200" height="100%"><uc1:leftmain id="leftmain" runat="server"></uc1:leftmain></TD>   <TD vAlign="top" align="left" width="690" height="100%">     

The Solution which i got has just solved my bugs,
Please find my post on forums.asp.net at http://forums.asp.net/t/1468479.aspx

The solution i got is:
<TR>

<TD vAlign="top" align="left" width="100%" colSpan="2"><uc1:headermain runat="server"></uc1:headermain></TD>

</TR>

<TR>

<TD vAlign="top" align="left" width="200" height="100%"><uc1:leftmain runat="server"></uc1:leftmain></TD>

<TD vAlign="top" align="left" width="690" height="100%">

//-----------------------------------------------------------------------------------------------




Hope this post will help you,
if yes please put comment below of this page,
Rajesh Singh,
Asp.Net Developer
Indianic Infotech Ltd (India)
rajesh@indianic.com