Welcome to Bilal Haidar [MVP, MCT] Official Blog Sign in | Join | Help

July 2005 - Posts

Define an Event Handler for a HyperLink Server Control

Hello, a common question on the ASP.NET Forum is: How to define an Event Handler for a HyperLink? The solution as follows: protected System.Web.UI.WebControls.HyperLink HyperLink1; private void Page_Load( object sender, System.EventArgs e) { HyperLink1.Attributes.Add(
Posted by BilalHaidar [MVP] | 0 Comments
Filed under:

Add JavaScript Functionality to GridView

If you want to change the Cursor when the mouse is over the GridView, follow the simple steps below: protected void RowCreated ( object sender, GridViewRowEventArgs e) { e.Row.Attributes.Add( "onMouseOver" , "this.style.cursor='n-resize'" ); } Hope that

Extend GridView

I want ot point you to two important links on Extending GridView, by Frerik Normen: 1- http://fredrik.nsquared2.com/print.aspx?PostID=186 2- http://fredrik.nsquared2.com/print.aspx?PostID=177 Hope that helps, Regards

TemplateField in GridView

You can call a custom method inside the TemplateField of the GridView as follows: <TemplateField> <ItemTemplate> <%# GetSum((int)Eval(“Number1“), (int)Eval(“Number2“)) %> </ItemTemplate> </TemplateField> public string GetSum(int

DateTime Methods

I had today to work with some DateTime calculations. I need two methods: 1- Get time difference between two dates, in such a way to have the following formats in the returned value: - Hours - Minutes (01 -> 1 minute, 10 -> 10 minutes,...) - Seconds

Facts about GridView

I would like to share with you some facts about the Events fired in the GridView: ---------------------------------------------------------- RowCommand Is Fired BEFORE SelectedIndexChanging Is Fired BEFORE SelectedIndexChanged -----------------------------------------------------------