blogspot visit counter

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.



Step 1 Create a file called index.aspx

  <%@ Page Language="C#" AutoEventWireup="true" CodeFile="index.aspx.cs" Inherits="index" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Ligh Box(http://dotnethubs.blogspot.in) </title>

    <link rel="stylesheet" type="text/css" href="css/style.css" />
<script type="text/javascript" src="js/jquery-1.9.1.js"></script>
<script type="text/javascript">
    function load_as_lightbox() {
        var DocumentHeight = $(document).height();
        $('.as_lightbox_wrapper').css('height', DocumentHeight); // Set document height for As_Lightbox wrapper
    }
    function ShowLightBox(DivId) {
        $('.as_lightbox_wrapper').show(); // Show the wrapper
        $('#' + DivId + '').show('slow'); // Show the Lightbox div, you can use another jQuery view functions such as fadeIn, fadeToggle for animations
    }
    function HideLightBox(DivId) {
        $('.as_lightbox_wrapper').hide('slow'); // Hide the As_Lightbox wrapper
        $('#' + DivId + '').hide(); // Hide the div
    }
    $(document).ready(function () {
        load_as_lightbox(); // call this function after document loads
        $('#Show_Lightbox').click(function () {
            ShowLightBox('Simple_Lightbox'); // call the As_Lightbox show function
            return false;
        });
        $('#as_lightbox_close').click(function () {
            HideLightBox('Simple_Lightbox'); // call the As_Lightbox close function
            return false;
        });
    });
</script>
<style type="text/css">
.as_wrapper{
    font-family:Arial;
    color:#333;
    font-size:14px;
    padding:20px;
    border:2px dashed #17A3F7;
    width:200px;
    margin:0 auto;
    margin-top:50px;
}
</style>
</head>
<body>
    <form id="form1" runat="server">
    <!-- AS_lightbox div (division) starts -->
<div class="as_lightbox_wrapper"></div> <!-- As_lightbox wrapper (half transparent background) -->
<div class="as_lightbox_container" id="Simple_Lightbox"> <!-- Set ID As_Lightbox here -->
    <div class="as_lightbox">
        <div class="as_lightbox_close" id="as_lightbox_close">
            <img src="images/close_flat_icon.png" alt="Close Lightbox" title="Close" />
        </div> <!-- As_Lightbox close icon -->
        <div class="as_clear"></div>
        <!-- As_Lightbox contents will starts here-->
        <p>As-Lightbox content will goes here. You can add any contents Texts, Images, Videos here. It wont conflict will other scripts Simple jQuery show(), hide() gives this lightbox</p>
        <!-- As_Lightbox contents ends here -->
    </div>
</div>
<!-- AS_lightbox div (division) Ends -->
<div class="as_wrapper">


<br/><br/>
<center>
<a id="Show_Lightbox" class="as_a">Show Lightbox</a>
</center>
</div>
    </form>
</body>
</html>

Step 2 create a file called style.css:

body{
    margin:0;
    padding:0;
    font-family:Arial;
}
.as_clear{
    clear:both;
}
.as_a{
    text-decoration:underline;
    color:#17A3F7;
    cursor:pointer;
}
.as_lightbox_wrapper{
    width:100%;
    position:absolute;
    top:0;
    left:0;
    z-index:100;
    background:url(../images/as_popup_wrapper_bg.png);
    display:none;
}
.as_lightbox_close{
    position:absolute;
    right:0;
    z-index:102;
    height:32px;
    width:32px;
    top:-25px;
    right:-25px;
    cursor:pointer;
}
.as_lightbox_container{
    z-index:101;
    position:fixed;
    width:200px;
    height:200px;
    background:#FFF;
    left:31%;
    top:13%;
    padding:10px;
    border-radius:2px;
    display:none;
}

Output as shown below at run time

 Click on show lightbox link then lightbox popup is shown as below



Download sample code attached

 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.



What is cls?
Ans -:common languge specifiction (CLS) ia a set of basic rules, which enable interoperabillity between two.NET-compliant languages supported by CLS can use each other's class libaries similar to their own. application programming interfaces which are designed by following the rules defined in CLS

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, 28 October 2013

Json with integer in php

Json with integer in php
Introduction :-
Here i am explain how to use  PHP  json_encode function.

In some cases numeric data may  appear as numeric strings, for example 1 as "1". While consuming the json data on a client app that would mean an extra parsing to get for example an int from the string.

The solution is to simply use an extra option (JSON_NUMERIC_CHECK) on the json_encode function call:

then you will not get the data in string format.You get the data like 1 without double quotes

use for json_encode
   



<?php echo json_encode($data, JSON_NUMERIC_CHECK); ?>

For example

{"data":[{"x":0,"y":0,"username":"%s","gender":"%s","location":"%s","id":"%s","age":30},{"x":0,"y":0,"username":"Ranvijay Singh","gender":"male","location":"Navi Mumbai (New Mumbai), India","id":1179445904,"age":30},{"x":10,"y":20,"username":"aman","gender":"male","location":"indore","id":123,"age":30}]}


Here x and y is integer values then not show double quotes

Thursday, 24 October 2013

How to Change Table Name in MySQL

Introduction :-
If you want to change the Table name without loss you data then it's very simple to change the table in MySQL database and sql server database.

Description : -

To change the name of an existing table first to second, use this command as shown below


RENAME TABLE first TO second;

For Example

You have table name like stodent_tab
and there are four fields like First_name,Last_Name,Stud_ID,Stud_Batch
and you want to change the name of  stodent_tab because you have done mistake in student_tab name

So Query Like This


RENAME TABLE stodent_tab TO student_tab;

Note -: This query is same if you want to use the sql server database.

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
.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.

Related Posts Plugin for WordPress, Blogger...