Pages

Ads 468x60px

For New Update Use this Link http://dotnethubs.blogspot.in/ Offer for you

.

Sunday 13 April 2014

jQuery Menu

jQuery Menu
Categories :- Drop down menu using jquery,JQuery Mneu,JQuery Restrict to Allow Only Numbers in Textbox in Asp.net

Introduction :-  In this article i am explain how i can design header using jquery in asp.net.

Description :-  In my previous article i have explained  how we can create  jquery lightbox in asp.net .Now i have explained how we can make a stylish menu using jquery in asp.net as shown below.

Friday 4 April 2014

Jquery Menu Animation in Asp.net

c# .net interview question answers
Categories :-What is JQuery  , Different between Jquery and javascript , JQuery get user ip address , Jquery example using asp.net

Introduction :- In this article i am explained how to create a animated menu in asp.net. This is very nice and easy article for design a animation in menu.

Tuesday 1 April 2014

How to change package name in android eclipse

How to change package name in android eclipse
I have an Android project created in eclipse.I want to modify the package name and application of the project.How to do that in eclipse?

Step 1  :-  Open eclipse  IDE and

Right click the project and select Android Tools >> Rename Application Package. as shown below image



Step 2 :- Enter the new Package name 


Step 3 :-And click ok appear new windows in front of you as shown below


Click finsh button . Accept all the automatic changes it wants to makeSay yes to update the launch configuration...

Thursday 20 March 2014

jquery lightbox in asp.net

jquery lightbox in asp.net
In this article i am explained  how we can implement the jQuery lightbox in our site.This is very easy to implement follow the instruction below step by step 

 jQuery scripts used in your projects. Simple show(), hide() will make this ready to use jQuery Lightbox. It’s simple and free download and easy to integrate in your projects. Below code will explain you how to make this simple jquery lightbox.

Sunday 9 March 2014

What is cts?

What is cts? in asp.net

CTC -: Cts is the component of clr through which net framework provides support for multiple languge because it contains a type system that is comman acroos all languge . two cts compliant languges do not requier type conversion when calling the code written in one languge from with in code written in anthore languge CTS provides a ease set of data type for all the languge supported by NET. frame work this means that the size of integer and long varibles is the same across all NET.compliant programng languges however each languge uses alliases for the base data type provide by CTS.for example , CTS uses the data type system .int32 to represent a 4 byte integer value; however visul basic uses the alias integer for the same whereasC# uses the alias int. this is done for the sake of clarity and simplicity.

Friday 29 November 2013

Role of CLR in Dotnet Framework

Role of CLR in Dotnet Framework Interview Question

1 ) CLR Provides an environment to execute .Net Applications on target machines.

2) CLR is also a common runtime environment  for all .NET code irrespective  of their programming language, because the compilers of .NET framework convert every source code into a common language known a MSIL
3) CLR also provide various services to execute processes, such as memory management service and security services, CLR performs various tasks to manage the execution process of .NET application.

The list of CLR as shown below.....

Automatics memory management  -> CLR invokes various built-in-functions of .NET framework to allocate and de- allocate the memory of .NRT object.

Garbage Collection -> Garbage Collection is the major role of CLR, which prevents memory leaks during execution of program. The Garbage collector of CLR automatically determines the best time to free the memory, which is reserved by an object for execution .

Code Access Security  -> Code Access Security(CAS) model is used in .NET framework to impose restrictions and security during execution of programs.

Code Verification -> CLR enforces type safety and prevents a source code from performing illegal operations, such as accessing invalid memory location.

JIT compilation of .NET code -> CLR uses the services of the just-in-time(JIT) compiler to load MSIL code on traget machine for execution.

Monday 21 October 2013

What are the core components of .NET framework

What are the core components of .NET framework

Categories :- Benefits of net frameworkHR interview question and answer , 1-year-exp-asp.net interview question and answer , Interview questions and answers for 2 years , C# interview Question And Answer

 The Two Components of .NET Framework are
 1) Common Language Run time [CLR]
2)  .Net Framework class Library

 Other key components of .NET Framework:

NET Framework Class Library

  3)   Dynamic Language Runtimes (DLR)
   4 ) Application Domains
   5)  Runtime Host
   6)  Common Type System
   7)  Metadata and Self-Describing Components
    8) Cross-Language Interoperability
    9) NET Framework Security
    10) Profiling
    Side-by-Side Execution

Briefly describe MSIL

.Net Framework is shipped with compilers of all programming languages to develop programs. There are separate compilers for the visual basic,C#, and visual c++ programming languages in .Net Framework.Each .Net compiler produces code after compiling the source code. The intermediate code is common for all languages and is understandable only to .NET environment. This intermediate is know as MSIL.

MSIL file is executable file that can transferred various machines. Therefore, it is said that MSIL file are portable to nay machine.

Monday 14 October 2013

What are the benefits of net framework

What are the benefits of net framework
Categories :- 

.Net framework offers many benefits to application developers.some of this benefits are as follow :

 1) Consistent programming model :- 
 Dot net framework provide consistent object oriented  programming model across various language.You can use the model  to create a program s for performing different task, such as connecting to and retrieving data from database and reading from and writing to files.

2) Language interoperability :- 
 Language interoperability is a feature that enables a piece of code written in one language to be used in another  language.This facilities the reuse of code and therefore improves the efficiency of the development process.

3) Automatic management of resources :-
 While developing .NET application. You may use various resources, such as files, memory, and database connections. with .NET Framework, you do not need to manually free these resources when they are no longer required

4) Easy of deployment :- 
 .NET Framework makes the deployment of application easier. To install an application that is not based on .NET Framework, you need to copy it and its components on target computers. However, with .NET Framework, you can quickly install or deploy the application such that installation of new application or components does not affect the existing  application.

5) HTML code and source code is separate so modification is essay .

6) Asp.net Framework is language independent.


Saturday 12 October 2013

How to get xml data into grid view in asp.net

How to get xml data into grid view
Introduction :- In this article i have explain how to show XML file data in asp.net grid-view .

Description :- In  my previous post i have explained How to Generating XML file From MySQL database 
Create and read XML file in asp.net , Read data from XML file in asp.net , now i have explain how to show XML file data in grid view  using   asp.net

Step 1 :- Create a new asp.net web site.
Step 2:- Add a new page in your project and give the name to the page gridxml.aspx..
Step 3 :- Add  one xml file and write something like this which you want to show on gridview page of asp.net as show below.

Note  - This is a Employees.xml file already exist in your project.


<?xml version="1.0" standalone="yes"?>
<Employees>
  <Employee>
    <EmployeeID>Chitranjan</EmployeeID>
    <CompanyName>abc informatics</CompanyName>
    <ContactName>chintu </ContactName>
    <ContactTitle>Developer</ContactTitle>
    <Address>ganraj</Address>
    <City>Indore</City>
    <PostalCode>452001</PostalCode>
    <Country>India</Country>
    <Phone>00000000</Phone>
    <Fax>4545499</Fax>
  </Employee>
  <Employee>
    <EmployeeID>Aman</EmployeeID>
    <CompanyName>Y N Info</CompanyName>
    <ContactName>Aman</ContactName>
    <ContactTitle>Artiest</ContactTitle>
    <Address>Boriwali east</Address>
    <City>Pune</City>
    <PostalCode>3436</PostalCode>
    <Country>India</Country>
    <Phone>9549544345</Phone>
    <Fax>559935</Fax>
  </Employee>
  <Employee>
    <EmployeeID>Rahul</EmployeeID>
    <CompanyName>Gold Main</CompanyName>
    <ContactName>Hot</ContactName>
    <ContactTitle>Designer</ContactTitle>
    <Address>dfdf</Address>
    <City>bBombay</City>
    <PostalCode>5434546</PostalCode>
    <Country>India</Country>
    <Phone>54545</Phone>
  </Employee>
  <Employee>
    <EmployeeID>Ronak</EmployeeID>
    <CompanyName>Yeswant Niwas</CompanyName>
    <ContactName>Golo</ContactName>
    <ContactTitle>Producer</ContactTitle>
    <Address>345 Alock Nagar</Address>
    <City>Bhopal</City>
    <PostalCode>554677</PostalCode>
    <Country>India</Country>
    <Phone>5656</Phone>
    <Fax>0909ASD</Fax>
  </Employee>
  <Employee>
    <EmployeeID>Ravi</EmployeeID>
    <CompanyName>DFF</CompanyName>
    <ContactName>LJ</ContactName>
    <ContactTitle>PPOIU</ContactTitle>
    <Address>79879 JKJK</Address>
    <City>ABC</City>
    <PostalCode>6656DF</PostalCode>
    <Country>RFF</Country>
    <Phone>54554FGGG</Phone>
    <Fax>GGG555</Fax>
  </Employee>
  <Employee>
    <EmployeeID>JJ8</EmployeeID>
    <CompanyName>HJKGJ8</CompanyName>
    <ContactName>GGH55</ContactName>
    <ContactTitle>New Dehli</ContactTitle>
    <Address>Rambag</Address>
    <City>ASD</City>
    <PostalCode>87GG</PostalCode>
    <Country>India</Country>
    <Phone>7667654</Phone>
    <Fax>FGH45</Fax>
  </Employee>
  <Employee>
    <EmployeeID>Sumit</EmployeeID>
    <CompanyName>Sumo tech</CompanyName>
    <ContactName>Sumo</ContactName>
    <ContactTitle>Manager</ContactTitle>
    <Address>656 FFH</Address>
    <City>Strasbourg</City>
    <PostalCode>8788</PostalCode>
    <Country>Noida</Country>
    <Phone>665-778-545</Phone>
    <Fax>545.54.55</Fax>
  </Employee>
 
</Employees>

 Step 4 :- open the gridxml.aspx file and write the code as show below.



using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;

public partial class CS : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!this.IsPostBack)
        {
            this.BindGrid();
        }
    }

    private void BindGrid()
    {
        using (DataSet ds = new DataSet())
        {
            ds.ReadXml(Server.MapPath("~/Employees.xml"));
            GridView1.DataSource = ds;
            GridView1.DataBind();
        }
    }

    protected void OnPageIndexChanging(object sender, GridViewPageEventArgs e)
    {
        GridView1.PageIndex = e.NewPageIndex;
        this.BindGrid();
    }
}

Note -: Source code also available in vb.net

Download sample code attached



Sunday 6 October 2013

Generating Xml file From Mysql database

Generating XML FILE From MySQL database
Introduction :- In this article i have explain how to  generate  XML  File   from mysql database in asp.net .

Description :- In my previous article i have explain Crete and read XML file in asp.net   and  read data from XML file in asp.net . Now i am explain how to generate  XML file in  asp.net.

Friday 20 September 2013

How i can run apk file on emulator

How i can run apk file on emulator

 Categories : - Call asp.net web service from android application

Introduction :- In this article i am explain how to run any .apk file using android emulator.

Description : - In my previous article  i have explained call asp.net web service from android application   Now i am explain how to run .apk through emulator

Step 1  Fist Check jdk is installed  i you system other wise instal the jdk
Step 2  Set the  Environment Variable like this for windows 7
Write click on my computer and go to property -> popup is open and click on Advanced   System Setting ->Advanced->  Environment Varibles
and set path link this image



Note-> Click new then open this popup  and enter variable name and variable values and click ok

Step 3  open eclipse and run any project through emulator your emulator is run properly

Note -> If you have no android project then create a new android application and run the android application using emulator

Step 4  Keep your .apk file within folder of your android sdk\platform-tools

Step 5 - Open cmd prompt and go tto your  sdk\platform-tools folder
 and type the command on cmd

adb install your apk file name

GUI as shown below


You get success message if you .apk is install properly using command prompt

Step 6 -  Check you Apk on you emulator is show properly and click on akp icon of your app it's run properly

Wednesday 28 August 2013

How To Create A JSON Web Service In ASP.NET

How To Create A JSON Web Service In ASP.NET
Categories : -  How to create Ajax enable wcf web service in asp.net

Introduction : - 

 .ASP.NET makes it easy to create web services but they usually return XML. Like many web developers I now prefer JSON. This article and sample code will show you how to get your web service to return data in the JSON format.

Description : -

  For fetch the data from MySQL database using web service in asp.net json format  step as shown below.

 Step :- 1 Create a new web site 
Step : -2 Write click on website and add new web service 
Step : -3 Write a code on WebService.cs file

as shown below



using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;
using System.Web.Script.Services;
using MySql.Data.MySqlClient;
using System.Data;
using System.Web.Script.Serialization;
/// <summary>
/// Summary description for WebService
/// </summary>
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
// To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
// [System.Web.Script.Services.ScriptService]
public class WebService : System.Web.Services.WebService {

    public WebService () {

        //Uncomment the following line if using designed components
        //InitializeComponent();
    }

    [WebMethod]
    public string HelloWorld() {
        return "Hello World";
    }

     [WebMethod(Description = "Gets All Records.")]

       [ScriptMethod(ResponseFormat = ResponseFormat.Json)]

      public string GetAllRecords() {

          MySqlConnection objConnection = new MySqlConnection("server=localhost;User Id=root;database=databaseName;Pooling=false;Connect Timeout=10;Allow User Variables=True;");

          MySqlCommand objCommand = new MySqlCommand("SELECT * FROM info_tab  ORDER BY id", objConnection);

          DataSet objDataSet = new DataSet();

          MySqlDataAdapter objDataAdapter = new MySqlDataAdapter(objCommand);

           objDataAdapter.Fill(objDataSet, "reading");

           objConnection.Close();
             // Create a multidimensional jagged array
           string[][] JaggedArray = new string[objDataSet.Tables[0].Rows.Count][];

           int i = 0;

          foreach (DataRow rs in objDataSet.Tables[0].Rows)

          {

               JaggedArray[i] = new string[] { rs["user_id"].ToString(), rs["First_Name"].ToString(), rs["Last_Name"].ToString() };

               i = i + 1;

           }

             // Return JSON data

           JavaScriptSerializer js = new JavaScriptSerializer();

          string strJSON = js.Serialize(JaggedArray);

          return strJSON;

       }  

}
 
For Connect to my sql  use the Connector .MySql Connector Download Link is Click

Run your service and seen output like this


Click on  GetAlRecords




 Again Click on Invoke Button and output as shown below


Note : - In Connection String i am not use a password If you define a password at the time of installation of MySQL database then use password=y our password; in connection string

Friday 23 August 2013

Creating Ajax Enabled WCF Service in asp.net

Creating Ajax Enabled WCF Service in asp.net
Categories :- Introduction of WCF service , Advantages and Disadvantages of WCf  Service , Difference betweenWCF service and asp.net service

Introduction :- 

In my previous article i have explain to create restful wcf service api using post step by step .and i have also explained another example for create basic  wcf service step by step in asp.net. In this article, I will explain how to create an AJAX-enabled WCF Service and how to consume it using client-side script in an ASP.NET page. I have kept the example quiet simple so in order to keep our focus on creating and consuming AJAX Enabled WCF Services.

Description :-

AJAX-enabled WCF Service is a service that can be consumed using an AJAX client-side script.
I am using visual stdio 2010 for create a ajax enable wcf service in asp.net.This is very easy for create wcf enable service in asp.net.Follow the step for create a ajax enable web service in asp.net as shown below

Step 1 :-  Open Visual Studio 2010.    Go to File->New->WebSite     Select ASP.NET Empty WebSite

Step 2 : - Go to Solution Explorer and right-click.

    Select Add->New Item ,  Select WebForm ,     Default.aspx page open

Step 3 : -Define WCF Service :
 Go to Solution Explorer and right-click.
    Select Add->New Item ,  Select AJAX Enabled WCF Service ,  Define the Namespace

Step 4 :- Open Default.aspx page and click in [Design option].

 Drag and drop Scriptmanager Control  on the default.aspx web form. Image of form as shown below



Step 6 : -In [design] page right-click in scriptmanager control
Select Properties option
Define Services like this

Click the add option and select Service path like this

you can check this service on click on soure default.aspx design page


<asp:ScriptManager ID="ScriptManager1" runat="server">
            <Services>
                <asp:ServiceReference Path="ajax.svc" />
            </Services>
        </asp:ScriptManager>

Step7 : - You have already select AJAX Enabled WCF Service in your app_code folder .
select ajax.cs webservice and double click on code behind and write the following




  [ServiceContract(Namespace = "GreetNM")]
[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
public class ajax
{
    // To use HTTP GET, add [WebGet] attribute. (Default ResponseFormat is WebMessageFormat.Json)
    // To create an operation that returns XML,
    //     add [WebGet(ResponseFormat=WebMessageFormat.Xml)],
    //     and include the following line in the operation body:
    //         WebOperationContext.Current.OutgoingResponse.ContentType = "text/xml";
    [OperationContract]
    public void DoWork()
    {
        // Add your operation implementation here
        return;
    }
    [OperationContract]
    public string GetUser(string user)
    {
        return "Hello="+user;
    }
  
}


Here  GetUser is  method called GreetUser(string uname) which takes a username and returns a string with the “Hello” greeting appended to the user name. Decorate the method with the ‘OperationContractAttribute’ to indicate that the method is a part of the contract.

step 8 :-
Now add a Html Button, an HTML Input box and <Div> to the Deafult.aspx page.After renaming the controls and adding the onClick event of the button, the markup will appear similar to the following and image as shown above as step number 6




  <div id="ajax_wcf" title="getuser">
  
        <asp:ScriptManager ID="ScriptManager1" runat="server">
            <Services>
                <asp:ServiceReference Path="ajax.svc" />
            </Services>
        </asp:ScriptManager>
    <input type="button" id="ajax_wcf" onclick="return ajx_wcf_call()" value="Submit" />
    <input type="text" id="txtnm" />
    </div>

Java Script code :

Step 7 : Now go to Default.aspx page and select Design option.

    Click in the input Button
    Define Java Script code for the on click event

Code :


<script language="javascript" type="text/javascript">
        function ajx_wcf_call() {
            try {
                var greeto = new GreetNM.ajax();
                greeto.GetUser($get("txtnm").value, OnGeetingComplet, OnError);

            } catch (Error) {
            alert("Error");
        }
        }
  
    function OnGeetingComplet(result)
    {
        $get("txtnm").value = result;
        alert(result);
    }

    function OnError(result) {
        alert(result.get_message());
    }
  
    </script>

Compete code as shown below


  <html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script language="javascript" type="text/javascript">
        function ajx_wcf_call() {
            try {
                var greeto = new GreetNM.ajax();
                greeto.GetUser($get("txtnm").value, OnGeetingComplet, OnError);

            } catch (Error) {
            alert("Error");
        }
        }
  
    function OnGeetingComplet(result)
    {
        $get("txtnm").value = result;
        alert(result);
    }

    function OnError(result) {
        alert(result.get_message());
    }
  
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div id="ajax_wcf" title="getuser">
  
        <asp:ScriptManager ID="ScriptManager1" runat="server">
            <Services>
                <asp:ServiceReference Path="ajax.svc" />
            </Services>
        </asp:ScriptManager>
    <input type="button" id="ajax_wcf" onclick="return ajx_wcf_call()" value="Submit" />
    <input type="text" id="txtnm" />
    </div>
    </form>
</body>
</html>

The result as for enter the value in text box and click on button




Download sample code attached


Wednesday 14 August 2013

Could not find file exception in asp.net fileupload

Categories : - Create and read XML file in asp.net  , Interview question and answer , Regular expression image validation , Regular expression text box validate for numeric value onlyCould not find file exception in asp.net fileupload

Introduction :-

In this article i am explain how to avoid error file cloud not find when upload any image in folder using asp.net web form .

Error As shown below


Friday 9 August 2013

GridView Paging Not Displaying Data After Switching Page

GridView Paging Not Displaying Data After Switching Page
Categories : - The GridView 'GridView1' fired event PageIndexChanging which wasn't handled

Introduction : - 

In this article i am explaining how i can show GridView Paging Not Displaying Data After Switching Page. In my previous article i have explained Java script for gridview in edit mode , Gridview rowcommand object reference not set to an instance of object

Description : -

I am having a bit of trouble with Paging within a GridView grid I have set up. I have added the paging but whenever I click on the next page or the last page buttons, the page refreshes and displays blank
So Bind the  Gridview as show below




  protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
    {
        GridView1.PageIndex = e.NewPageIndex;
        BingGridViewData();//Call bind gridview function
    }


Create a new asp.net web site and add new page . Darg and drop gridview on page . and write this function on code behind of asp.net web page  as shown  below



protected void BingGridViewData()
    {
        _objcon = DonetionConnectionDB.GetConnection();
        DataTable dt = new DataTable();
        string query = "SELECT * FROM causes_tab order by ID DESC";
        MySqlDataAdapter _objda = new MySqlDataAdapter(query, _objcon);
        _objda.SelectCommand.CommandType = CommandType.Text;
    
        _objda.Fill(dt);
        GridView1.DataSource = dt;
        GridView1.DataBind();
        _objcon.Close();
    }



The gridview 'gridview1' fired event pageindexchanging which wasn't handled. c#

The gridview 'gridview1' fired event pageindexchanging which wasn't handled. Solution
Categories :-  Java script validation for Grid View in edit mode , Javascript validation for Gridview footer textbox  , Gridview RowCommand object reference not set to an instance of an object , onclick checkbox select data from gridview asp.net

Introduction  :-

In my previous article I have explained Gridview rowcommand object reference not set to an instance of object.  Now  i have  face this problem when i change the gridview AllowPaging="True" PageSize="1" .The Error message as shown below








 Description : -

Now i have a solution for this problem .
Select the Gridviw and click on PageIndexChanging Event of the Gridview and write a one line code as shown below



protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
    {
        GridView1.PageIndex = e.NewPageIndex;
        BingGridViewData();// GridView Paging Not Displaying Data After Switching Page
    }

Fired this event on code behind of the page and error is solved

Saturday 3 August 2013

Regular expression validator for image file extension

Regular expression image file extension

Introduction :- 
In this article i have explained how to validate image using Regular Expression Validator  in  asp.net  before upload in data base or image fonder.In my previous article  i have explained  Different Validation Control in asp.net Like this :- How to allow numeric values into textbox , How to upload multiple photo using asp.net , Asp.net Control With Example , Jquery form validation in asp.net , JavaScript validation for grid view footer textbox , JavaScript validation for grid view in edit mode

 Description :- 

 In this Post I have created a new  project and add use a Regular Expression Validator in asp.net as show below

step 1 -    Create a  new project .
Step 2 -   Write Click on project explorer and add a new form .
Step 3 -   Drag and drop a RegularExpressionValidator and file upload control on the page.
Step 4 -   Drap and drop a  button on the web  page for save the image on click button in the image folder.
Step 5-    Write Click and add new folder in your project.

Now set the property for validate the image using RegularExpressionValidator  as show below

Control to validate =FileUploade
Text = Invalid image icon
 ValidationExperssion  =^.*\.((j|J)(p|P)(e|E)?(g|G)|(g|G)(i|I)(f|F)|(p|P)(n|N)(g|G))$"

 Complete Code as show below


<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
  
        <asp:FileUpload ID="File1" runat="server" />
        <asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="Upload" />
        <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server"
            ControlToValidate="File1" ForeColor="Red"
            ValidationExpression="^.*\.((j|J)(p|P)(e|E)?(g|G)|(g|G)(i|I)(f|F)|(p|P)(n|N)(g|G))$">Invalide file !</asp:RegularExpressionValidator>
  
    </div>
    </form>
</body>
</html>


Output image as show below




Download sample code attached







Monday 29 July 2013

Latest asp.net interview questions and answers for experienced

Latest asp.net interview questions and answers for experienced
Introduction : -

I  have Collection new asp.net interview question and answer for experience and fresher .This is very important asp.net interview question with answer.
Every interviewer firstly ask 

1 . Tell me about Your Self ?

Ans  Good morning sir/madam.This is Chitranjan Singh Rathore My educational qualification are: I have completed my 10th standard in 2002 from  Little flower school and also 12th standard in 2004. I have completed my graduation in 2007 from Holkar science college. I have completed my post graduation in 2010 from Medicaps Colloege indore .
For More Click Here

 
2 . What is asp.net ?

Ans  Dot Net is a Framework technology, that means which is integrated with multiple technologies like windows, web, web services, etc.It is Use to develop web based, windows based application.
For More Click Here

3. Difference Between Form authentication and windows authentication ?

For Get the answer- Form authentication and windows authentication

4 . What is authentication and authorization in asp.net ?

Answer . This is very important question .every technical interview round ask this question
               authentication and authorization in asp.net

5.  What is web form ,windows form and client server architecture ?

Ans  - This is very important and interesting question.Now we will talk about(web form and windows form)

Web from :-

1 ) As we know web from use browser presentation(asp.net form has no exception )
2 ) ASP.NET Form inherits Page class (contained in System.Web.UI namespace).
3 ) Web Forms to create Web-based applications that display in a Web browser.
 4 ) Webapplications run on webservers (usually IIS)

Windows From : -

1 ) Window form has own presentation .
2 ) A Form of Windows Forms inherits Form class (contained in System.Windows.Forms namespace).
3 ) Windows Forms to create rich applications that install and run locally on a machine.
4 ) Windows forms are used in desktop based applications which heavily rely on the GDI.

Friday 26 July 2013

How to upload multiple photos using asp.net

How to upload multiple photos using asp.net
Introduction :- 

In my previous  article i have explain the Ajax-asyncfileupload-control-example in asp.net. Now in this article we will upload multiple image using single file upload control in asp.net.

Description :- 

In this Article we take on file upload control and on button on asp.net web from.This is very important article for upload multiple image in database and folder .now we upload the multiple images in a folder some  easy process

Step 1 - Create a asp.net web project and add new from like this
Open visual stdio go to File->new ->Project  and write the name of the project

Step 2 - Write click on solution explorer and add new item ->select new web form->write the name of form

step 3 -  Drag and drop the file upload control on the form
Step 4 - Drag and drop the  asp.net Button on the form
Step 5 - Drag and drop one label on the form for count how many image you have select
Step 6 - Write click on Project (Solution Explorer) and add new folder and give the name to the folder is image

Note -: Write multiple="true" for select multiple file or  image using file upload control of asp.net
Note - use this namespace    using System.IO;

Complete Source Code as shown below

<asp:FileUpload runat="server" ID="UploadImages" multiple="true"/>
    <asp:Button runat="server" ID="uploadedFile" Text="Upload" OnClick="uploadFile_Click" />
    <asp:Label ID="listofuploadedfiles" runat="server" />



double Click on asp.net button control or write click on from and select  View Code .Go to code Behind File and write a code for upload a images in folder.

Code as shown below


      HttpFileCollection fileCollection = Request.Files;
        for (int i = 0; i < fileCollection.Count; i++)
        {
        HttpPostedFile uploadfile = fileCollection[i];
        string fileName = Path.GetFileName(uploadfile.FileName);
        if (uploadfile.ContentLength > 0)
        {
        uploadfile.SaveAs(Server.MapPath("~/image/slider/") + fileName);
      
        listofuploadedfiles.Text += String.Format("{0}<br />",uploadfile.FileName);
    }
    }



Tuesday 23 July 2013

How to allow only Numeric values into a textbox

How to allow only Numeric values into a textbox
Introduction :-

In my previous article i have explained how i can use validation control in asp.net.In this article I am explain how i can allow online integer values for text box using regular expression in asp.net.

Description : -
In my Previous article i have explained how to validated form using jquery in asp.net.And i have Provided Full Description with example for  each and every  control in asp.net. Name of Controls are

RequiredFieldValidation,RangeValidator,RegularExpressionValidator,CompareValidator,CustomValidator,
CustomValidator

In this article i have explain how to validate textbox using regular expression allow only integer values

Process :-
1 : - Create a new project in asp.net and add new from and drag and drop a text box and provide the id to the textbox.In this article the id of text box is txt_priority  .
2 : - Drag and drop the Regular Expression validator on the form and set the property as show below
ID =RegularExpressionValidator1
ControtoValidate= txt_priority   [this is textbox id]
ErrorMessage=Please enter numbers only
ForColor=Red
ValidationExpression=\d+

complete example as show below


<asp:RegularExpressionValidator id="RegularExpressionValidator1"
                   ControlToValidate="txt_priority"
                   ValidationExpression="\d+"
                   Display="Static"
                   EnableClientScript="true"
                   ErrorMessage="Please enter numbers only"
                   runat="server" ForeColor="Red"/>


 

..




New Updates

Related Posts Plugin for WordPress, Blogger...

Related Result