Friday, 28 September 2012

Attractive drop down menu using css

Write Down The Code

    <div id="content-wrapper">
  <ul id="hb-menu">
<li><a href="#">Home</a></li>
<li>
<a href="#">Categories</a>
<ul>
<li><a href="#">CSS</a></li>
<li><a href="#">Graphic design</a><ul>
<li><a href="#">Link 1</a></li>
<li><a href="#">Link 2</a></li>
<li><a href="#">Link 3</a></li>
<li><a href="#">Link 4</a></li>
</ul>   </li>

Thursday, 27 September 2012

how can we upload and download file in asp.net

Code of upload/insert data in database:- 
 
protected void imgSubmit_Click(object sender, ImageClickEventArgs e)
    {
        SqlConnection con = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["con"].ToString());
        SqlCommand cmd = new SqlCommand("application", con);
        cmd.Connection = con;
        cmd.CommandType = CommandType.StoredProcedure;

        if (filephoto.HasFile && filedoc1.HasFile && filedoc2.HasFile && filedoc3.HasFile)
        {
            string fileExt = System.IO.Path.GetExtension(filephoto.FileName);

Friday, 21 September 2012

How can we validate .doc,.docx file using javascript

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title>Untitled Page</title>
<script type="text/javascript" language="javascript">
function validate() {
var uploadcontrol = document.getElementById('<%=FileUpload3.ClientID%>').value;
//Regular Expression for fileupload control.
var reg = /^(([a-zA-Z]:)|(\\{2}\w+)\$?)(\\(\w[\w].*))+(.doc|.docx|.DOC|.DOCX)$/;
if (uploadcontrol.length > 0)
{
//Checks with the control value.
if (reg.test(uploadcontrol))
{
return true;
}

Saturday, 8 September 2012

How can we select all check box in one click using javascript

<HeaderTemplate>
  <input id="chkAll"  
onclick="javascript:SelectchooseAllCheckboxes(this);" 
              runat="server" type="checkbox" />
</HeaderTemplate> 
 

Saturday, 9 June 2012

Important Functions used in sql server 2008/2005

The TOP Clause

The TOP clause is used to specify the number of records to return.
The TOP clause can be very useful on large tables with thousands of records. Returning a large number of records can impact on performance.

 Syntax

SELECT TOP number|percent column_name(s)
FROM table_name

Monday, 4 June 2012

How dll hell problem solve in .net

Dll Hell refers to a set of problems caused when multiple 
applications attempt to share a common component like a 
dynamic link library (DLL). The reason for this issue was 
that the version information about the different components 
of an application was not recorded by the system. 

Main Difference between C#3.0 vs c#4.0

C# 4.0
C# 3.5
C# 4.0 supports dynamic programming through dynamic objects.
C# 3.5 does not support dynamic programming.
In C# 4.0, dynamic keyword is associated with objects to represent them as dynamic objects.
The dynamic keyword is not recognized in C# 3.5.
C# 4.0 allows creation of dynamic variables.
Dynamic variables cannot be created in C# 3.5.
In C# 4.0, the method parameters can be specified with default values using optional parameters.
In C# 3.5, method parameters cannot be specified with default values. C# 3.5 does not support optional parameters.
C# 4.0 provides named parameters to represent the values of method parameters without following the order of declaration.
In C# 3.5, method parameters have to be specified in the same order as in method declaration in the method call. C# 3.5 does not provide named parameters.
In C# 4.0, usage of ref keyword is optional while executing methods which are supplied by the COM interfaces.
In C# 3.5, usage of ref keyword is mandatory while executing methods which are supplied by the COM interfaces.
The COM object’s indexed properties are recognized in C# 4.0.
The COM object’s indexed properties are not recognized in C# 3.5.
C# 4.0 enhances Generics by introducing co-variance and contra-variance.
Co-variance and contra-variance are not supported in Generics of C# 3.5.