Monday, February 9, 2009
Getting the list of files dragged on a control
In Drag Enter event just add the following code:
string[] Files = (string[])e.Data.GetData(DataFormats.FileDrop, false);
Where 'e' is the DragEventArg
The string array Files[] will contain the paths of the files dragged on to the control. After getting the files paths u can directly use them to get the desired functionality.
Friday, February 6, 2009
IMAGE SLIDING USING AJAX & JAVA SCRIPT
The design script code looks like (Note: As all you smart people know that tags are not allowed in blogspot, the starting and ending tags are replaced by '(' , ')' correspondingly)
(img id="imgZoomTarget" src="images/no daughter.bmp"
style="position: absolute;top: 92px; left: 378px; height: 343px; width: 308px" /)
(form id="form1" runat="server")
(asp:ScriptManager ID="ScriptManager1" runat="server" /)
(asp:TextBox ID="Slider2" runat="server")(/asp:TextBox)
(asp:TextBox ID="Slider2_BoundControl" runat="server")(/asp:TextBox)
(asp:TextBox ID="Slider3" runat="server")(/asp:TextBox)
(asp:TextBox ID="Slider3_BoundControl" runat="server")(/asp:TextBox)
(cc1:SliderExtender ID="heightSlider" runat="server" BehaviorID="Slider2"
TargetControlID="Slider2" BoundControlID="Slider2_BoundControl" Orientation="Vertical"
EnableHandleAnimation="true" Minimum="10" /)
(cc1:SliderExtender ID="widthSlider" runat="server" BehaviorID="Slider3"
TargetControlID="Slider3" BoundControlID="Slider3_BoundControl" Orientation="Horizontal"
EnableHandleAnimation="true" Minimum="10" /)
And now add the following java script code in body tag:
var HundredPercentHeight = 800;
var HundredPercentWidth = 800;
var controlID ="imgZoomTarget";
//Function to Modify Height according to Slider Value
function ZoomControlHeight(eventArgs)
{
var currentlyZoomingControl =$get(controlID);
//Calculate the new height
var newHeight = HundredPercentHeight * ( parseInt( eventArgs.get_Value() ) / 100 ) ;
//Assign the New Height
currentlyZoomingControl.style.height = parseInt(newHeight) +"px";
//Let go of the Control Reference
currentlyZoomingControl = null;
}
function ZoomControlWidth(eventArgs)
{
var currentlyZoomingControl =$get(controlID);
if( eventArgs.get_Value() == null)
return;
var newWidth = HundredPercentWidth * ( parseInt( eventArgs.get_Value() ) / 100 ) ;
currentlyZoomingControl.style.width = parseInt(newWidth) +"px";
currentlyZoomingControl = null;
}
function pageLoad(sender,e)
{
var sliderbehaviour = $find('Slider3');
sliderbehaviour.add_valueChanged(ZoomControlWidth);
sliderbehaviour = $find('Slider2');
sliderbehaviour.add_valueChanged(ZoomControlHeight);
sliderbehaviour = null;
}
A legend called .... RAHUL DRAVID
I remember the Test match at Perth. Dravid and Tendulkar shared a century stand. Sachin has scored 71 runs, before was declared out lbw.Dravid had reached a 93 when he played an silly shot only to be caught by Pointing...Another century had gone begging…..I almost broke a crystal vase at home…Nevertheless I expected Dravid’s picture in the next day’s newspapers…He obviously was the performer of the day. I got his picture, but as an ‘inset’…the papers had a poster side picture of Sachin and an INSET of Dravid….At that moment I knew why he was called the poor man’s Tendulkar, well who cares I’m the poor man then….
And then a new hero is in….Mahinder Singh Dhoni. He is the new darling of the nation. He brought home what nobody had ever done, a T-20 World Cup. People celebrated like it was India’s first ever victory in a major tournament. Them the CB series, for which people some what forgot to credit Sachin. Dhoni with his hard hit slogs, long hair, nasal voice charmed a large part of the females Cricket followers, and utterly disgusted me. I could never stand this man for a minute. His slogs made me change the channel, no technique full power. Imagine my anguish when I heard this man was to lead the ODI team after Rahul Dravid. Then came the question of Tests. A few former Cricketers said he was not mature enough to lead in Tests, I said he’s not mature enough to lead at all. I prayed to every God I knew, ‘Let Kumble be made the Test Skipper…’ Finally my prayers were answered and Anil Kumble was named the Test Skipper.
Dhoni showed that he had the power and chucked out two of my most favourite players in the Indian One Day team, Rahul Dravid and Saurav Ganguly. I felt pretty sick. A team sans of Dravid and Ganguly, No more ODIs for me……….
Now I have the Test Series in Sri Lanka to look forward for. I sincerely hope ALL the seniors – Dravid, Ganguly, Laxman, Tendulkar, Kumble…do very well. Lets show Dhoni’s Cricketing KIDS what ‘REAL’ Cricket looks like…
Apparently the selectors wanted Dravid to be the second Wicket Keeper…Why..??? Because he’s Rahul Dravid, the Man who will walk on broken glass for his team. It is strange how reputed men sitting in an air conditioned room can expect a 35 year old man to keep wickets in a Test match when not long back they marked the same man as being not fit to play a game of 50 overs….
Dhoni’s and Yuvraj’s, Raina’s and Gambhir’s may win a number of matches for India. Sehwag might hit a half century in 2 overs. Rohit Shamra’s might dive around spectacularly saving singles…..but during my final moments if I had one last wish I would want see Rahul Dravid's graceful Straight drive followed by a colourful cover drive.