web stats analysis

Archive for May, 2012

The type or namespace name ‘Common’ does not exist in the namespace ‘Microsoft.SqlServer.Management’

Solution

1) Go to the solution explorer

2) Right click on your project or website name

3) Select Add Reference

4) And go to .net tab

5) Select Microsoft.SqlServer.ConnectionInfo assembly than click on OK button

Now compile your project or website.

How to Convert Currency into Words in Crystal Report

How to Convert Currency into Words in Crystal Report

Write one formula :

numbervar RmVal:=0;
numbervar Amt:=0;
numbervar pAmt:=0;
stringvar InWords :=”Rupees “;
Amt := {tbl_Cash.nFees};

if Amt > 10000000 then RmVal := truncate(Amt/10000000);

if Amt = 10000000 then RmVal := 1;
if RmVal = 1 then
InWords := InWords + ” ” + towords(RmVal,0) + ” crore”

else

Read the rest of this entry »

How to subtract time in asp.net

Solution

DateTime d1 = new DateTime();
DateTime d2 = new DateTime();
d1 = Convert.ToDateTime(“12:05:45 pm”);
d2 = DateTime.Now;
TimeSpan d3 = d2 – d1;
Response.Write(d3.Hours + ” Hours “);
Response.Write(d3.Minutes + ” Minutes “);
Response.Write(d3.Seconds + ” Seconds “);

how to get browser name and version in javascript

Solution

<script type=”text/javascript”>
var browser = ”;
var browserVersion = 0;

if (/Opera[\/\s](\d+\.\d+)/.test(navigator.userAgent)) {
browser = ‘Opera’;
} else if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)) {
browser = ‘MSIE’;
} else if (/Navigator[\/\s](\d+\.\d+)/.test(navigator.userAgent)) {
browser = ‘Netscape’;
} else if (/Chrome[\/\s](\d+\.\d+)/.test(navigator.userAgent)) {
browser = ‘Chrome’;
} else if (/Safari[\/\s](\d+\.\d+)/.test(navigator.userAgent)) {
browser = ‘Safari’;
/Version[\/\s](\d+\.\d+)/.test(navigator.userAgent);
browserVersion = new Number(RegExp.$1);
} else if (/Firefox[\/\s](\d+\.\d+)/.test(navigator.userAgent)) {
browser = ‘Firefox’;
}
if(browserVersion === 0){
browserVersion = parseFloat(new Number(RegExp.$1));
}

alert(browser + “-” + browserVersion);

</script>

 

Check if JavaScript is enabled with asp.net

Solution

<html>
<body>
<noscript>
javascript is disabled on your browser
<style>div { display:none; }</style>
</noscript>
<div>
your content
</div>
</body>
</html>

 

How can i get just 2 digits after comma in javascript

Solution

var a = 5.017456;
alert(a.toFixed(2));

 

 

 

making checkboxlist readonly

Solution

Type following code in page_load event

chk.Attributes.Add(“onclick”, “return false;”);

 

how to delete history of asp.net text box

Solution

Type autocomplete=”off” in form tage

Example :

<form id="Form1" method="post"  runat="server" autocomplete="off"></form>

 

Plesk domain is asking user id and password when opening it in browser.

Plesk domain is asking user id and password when opening it in browser.

Cause : Some permission has been failed to execute by the plesk panel.

Solution1 : It has always perform by the admin level.
before running any command you need to take the full backup .
If you are admin then you can run some command
cd %plesk_bin%
websrvmng –update-password –domain-name=domainname.com

Solution2 : If you are not an admin and you are taking the shared hosting and you are using plesk
then follow the below steps.
==>Login to the plesk panel
==>Select the particular domain under which you are facing this problem

Read the rest of this entry »

How to get readonly textbox value in codebehind

Solution

Type following code in aspx design page

<asp:TextBox ID=”TextBox1″ runat=”server” Text=”Hello”></asp:TextBox><br />

<asp:Button ID=”Button1″ runat=”server” Text=”Button” onclick=”Button1_Click” />

 

Type following code in code behind

protected void Page_Load(object sender, EventArgs e)
{
TextBox1.Attributes.Add(“readonly”, “readonly”);
}
protected void Button1_Click(object sender, EventArgs e)
{
Response.Write(TextBox1.Text);
}