Posts

Showing posts from 2010

Select Multiple Checkbox with Shift key in Gridview by javascript

Image
Hello Friends, Recently i was just looking at my Gridview where i have a checkbox in each row.. now i need to select all Check box.. for that lots of material is available on net.. and all are enough so i am not going to deep in it check out this… http://www.codeproject.com/KB/grid/GridCheckBox.aspx but now my problem was that i wanted to select few rows but not all let’s say in my gridview the number of records are around 100.. and i want to check the checkbox of first 35 records in that case i had to click on checkbox of all 35 rows. i thought, like all mail accounts like gmail, yahoo, live and in may more… i should be able to select multiple records by shift key. means select the first record and pressing shift key select the 35st record so all the records in between will be selected.. and for that i found lots of jquery or any other javascripts. but here i have tried to make something my own and i am happy to make it.. here is code on Page <asp:GridView ID=...

Epic Browser

Background of Epic The Epic Browser is the first-ever web browser for India and the first product from the software company Hidden Reflex. Hidden Reflex is a software product startup founded by Alok Bhardwaj in 2007 and based in Bangalore. Alok, who was raised in the U.S., was inspired by the success of open source software and web 2.0 innovations. Hidden Reflex began as a team of three but soon progressed and now has dedicated teams working on two products simultaneously – the Epic Browser and NewsDrink. The company also has three patents pending related to its product innovations. The company’s vision is to become the first globally recognized, consumer-oriented software product company in India. According to Alok Bhardwaj, CEO and Founder of Hidden Reflex, “We want to prove that India can be a hub for innovation in software and technology." Our mission with the Epic browser is to create the most secure, most productive and most “Indian” browsing experien...

Access ViewState From ClassFile

teHello Friends Manytime we need to use ViewState while working 3-tier Architecture but its difficult to use it. here i have made a sample to use Viewstate from Classfile ViewState: Viewstate is an object of Class StateBag  Here is sample of Viewstate in Class file in this example we will add names from Textbox to gridview using Viewstate. so in code behind <div> Name : <asp:TextBox ID="txtName" runat="server"></asp:TextBox><asp:Button ID="btnAdd" runat="server" Text="Add" /> </div> <div> <asp:GridView ID="grvNames" runat="server" AutoGenerateColumns="False" CellPadding="4" ForeColor="#333333" GridLines="None"> <RowStyle BackColor="#F7F6F3" ForeColor="#333333" /> <Columns> ...

Get Nth record from Table

Hello Friends Here is a simple query to get nth Record from Table SELECT @NewPriority=Priority FROM ( SELECT Id , Priority , ROW_NUMBER() OVER (ORDER BY priority) as row FROM Job where IsDeleted=0 and Id not in ( select jobId from Job_Cylinder where IsDeleted=0) ) a WHERE row=@cnt-(@NewPriority)+1 There are many ways to get this.. All the Best

Light-weight Popup using CSS and Javascript..

Image
Hello Friends Once Again with a Rocking point we have seen lots of Popup till now….. all are good at their places just search on Google “Model Popup” and you will get a long list of examples and javascripts for popup… Ajax Control toolkit Model Popup Extender http://www.asp.net/ajax/ajaxcontroltoolkit/Samples/ModalPopup/ModalPopup.aspx   then few more   http://www.modalpopups.com/blog/ http://www.jquery-dev.com/2008/12/02/jqmodal-jquery-modal-popup-plugin one more javascript framework is Dojo http://www.dojotoolkit.org/ here i am also one type of popup… but i am sure you will like it because it don’t require any kind of configuration and dependencies…      it is combination of CSS and javascript… with 70:30 ratio…. means here CSS is used more and rest is javascript…. then also its more power full so from first sight you can determine its light–weight compare to other model popups here i have an example… 1: < input i...

DataBase Specific Queries

Image
Hello friends Here are few Database Specific Queries Select All Database list   1: SELECT [name] FROM sys.databases 2: SELECT [name] FROM sys.sysdatabases This will Result Select All Tables of particular Database.   1: SELECT Name, type,type_desc FROM sys.objects 2: where Type= 'u' This will Result Here Fields Type and Type_Desc are Type Type_Desc C CHECK_CONSTRAINT D DEFAULT_CONSTRAINT F FOREIGN_KEY_CONSTRAINT FN SQL_SCALAR_FUNCTION IF SQL_INLINE_TABLE_VALUED_FUNCTION IT INTERNAL_TABLE P ...

RemoteDataPass- pass data from one page to Remote Page

As i Committed in my previous post , that i will post code for ReportDataPass. it is Quite difficult to pass Data from one Application to another application, because here Cookie , Session variable will not help. now a very simple way it Query string ,  But as our previous condition, we don’t want to use Query string . so the last way.. Post Method as we know, in any server side scripting languages, like asp, jsp, PHP.. on submit button, the Data is posted to another page or to itself. and using Request[“Filedname”] we can have its Value. the same logic we are going to apply.. but as we are using VS, where we have facilities of Masterpages and Content page,so when we are using any ContentPage, in that case we can not have form and its Post method. So we are going to make a dynamic Html Page, and  using dynamic Javascript we will post Data to another page. So create a Class like this 1: public class RemoteDataPass 2: { 3: 4: priva...

Popup new Window by Javascript

A very Common trick Open a new window as Popup by javascript… Clicking on any Server Button 1: < asp:Button ID ="Button1" 2: runat ="server" 3: OnClientClick ="window.open('Page2.aspx',null,'height=200,width=400 4: ,status=yes,toolbar=no,menubar=no,location=no,scroll=no'); 5: return false;" 6: Text ="Button" /> All The Best..

IsCrossPagePostback–pass data from one page to another

Hello friends again with new concept.. Page.IsCrossPagePostBack in many case we are supposed to pass data from one page to another page. So we can pass data through Querystring , Session variables , this options are quiet helpful when Data is less in quantity.. but now what if we want whole page to another page… ? and in previous page Data is in very big amount around 20 – 40 fields… so it is not feasible to pass that data in querystring or storing all data in session. there also another ways, like Cookie or hiddenfields using Post method.. but all this require more trouble.. but what if we get previous page controls like it is “on same page” for that we have a good option called IsCrossPagePostback   it is same like our Page.IsPostBack . Page.IsPostBack treats only for current page’s postback but to track weather postback is from Current page or previous page we can use IsCrossPagePostBack. One Important Note : Respose. Redirect will not help us to track ...