Posts

Donate

(AJAX Tab Container Error)htmlfile: Can't move focus to the control because it is invisible, not enabled, or of a type that does not accept the focus.

In my aspx page, I have an ajax tab container control, and inside each tab strip,i have server controls. During pageload,i want to set focus on a particular control but got this error during page load: htmlfile: Can't move focus to the control because it is invisible, not enabled, or of a type that does not accept the focus. the solution is in this page: Setting focus to a textbox when in a tab panel errors

JavaScript Format Decimal Precision

Here's a resource where i came to change decimal precision on of numbers using client script. It explained on how to use the toFixed() and toPrecision(). However, there are bugs on this. So it's much better to set precision of numbers using server side script. http://www.mredkj.com/javascript/nfbasic2.html

Gridview Samples From MSDN

Here's a link of samples from MSDN. I have'nt tested all of them, but this might help to other developers out there. GridView Examples for ASP.NET 2.0

Paste HTML Codes In Your Post

You might be wondering how the heck could i paste html code in my post. Well, there's a handy tool for that in this site: Blogger Paste or this Hilite.Me

Scalar And Inline Table Functions In T-SQL and SQL Server

After reading some articles on TSQL, I made some experiments on User defined functions. Actually, there are three types of UDF. First we have the Scalar functions that returns a single value of the data type referenced in the RETURNS clause of the CREATE FUNCTION statement. The returned data can be of any type except text, ntext, image, cursor, or timestamp. Next we have Inline table-valued function which returns a variable of data type table whose value is derived from a single SELECT statement. Lastly, we have multi-statement table-valued function which is slightly more complicated than the other two types of functions because it uses multiple statements to build the table that is returned to the calling statement. (Source: http://www.sqlteam.com ) For the sake of simplicity, I'll tackle the first two types of functions. 1. Scalar function example: create function ComputeSum(@FirstNum int, @SecondNum int) returns int as begin Declare @ sum int set

Simple jQuery Manipulation In Asp.Net WebForms

I started learning jquery recently. This is a simple tutorial using asp.net website to show alert message and to change background color of label control. Add a label control, an asp.net button control, and input html button. Make sure to reference the jQuery library in your asp.net website. jQuery Script: 1 2 3 4 5 6 7 8 9 10 11 $( document ).ready( function () { $( '#btnAlert' ).click( function () { alert( 'my first jquery app!' ); }); $( '#btnChangeBackColorLabel' ).click( function () { $( 'span' ).css( "background-color" , "blue" ); }); $( "span" ).click( function () { $( this ).css( "background-color" , "yellow" ); }); }); HTML CODE: 1 2 3 4 5 6 7 <div> <asp:Button ID= "btnAlert" runat= "server" Text= "Show Alert" /> <br /> Click Change Me label itself to change backgrou

jQuery Intellisense With Visual Studio 2008

I recently played with jquery to work with asp.net/asp.net ajax. 1. Perform these steps in this website: jQuery Intellisense in Visual Studio 2008 2. Download jquery-1.4.1-vsdoc.js and jquery-1.4.1.min.js from jquery website. 3. Include them in your asp.net website. 4. remove the min in jquery-1.4.1.min.js. So the new jquery library would be like this: jquery-1.4.1.js 5. Add reference to the jquery library in your javascript file. That's it...Cheers!!!

How To Call SQL Server Stored Procedure Using LINQ And C#.NET

Good evening. Here's a basic example of how to call a SQL Server Stored Procedure Using LINQ And C#.NET 1. Make sure you have Northwind database in your Sql server. 2. Create a simple stored procedure to retrieve customers based on a specific country. The parameter of the stored procedure is of type varchar. 3. Create a simple asp.net website or winforms or console project. 4. Add a Linq to SQL class to your project. 5. Make sure to add the stored procedure in your linq to sql class. 6. In your asp.net website, add a button,textbox and a gridview. 7. In your button event click, add the following snippet: 1 2 3 4 5 6 7 8 protected void Bind () { string country = this .txtCity.Text.Trim(); var cr = new NorthWindDataContext(); var north = cr.CustomerByCountry(country); this .gridCustomers.DataSource = north; this .gridCustomers.DataBind(); } That's it...

Incorrect Syntax Near % Sql Parameter In C#.NET and SQL Server

When writing sql statements in your business logic layer, you often want to append % which is a literal in your query. An example would be like this: string query = "Select * from Patient where LastName like '" + "@family" + " %'" ; However, this would give you an error, since the @family parameter is inside the tick marks that makes it a literal, but the % sign should be inside the tick marks. So, the correct sql syntax would be this way: string query = "Select * from Patient where LastName like (@family + '%')" ; Source: VBForums Link

Set Top Property Of Text And Field Object Of Crystal Reports During Runtime

I have encountered a scenario when creating crystal reports for a specific customer. In my reports, I have four controls. 1. Comments (Text Object) and Comments (Field object )w/ top properties of 3465. 2. Recommendations (Text Object) and Recommendations (Field object ) w/ top properties of 4505. Here's what i need to do. 1 2 3 if ((recommendations field object ! = null) && (comments field object == null))) 2 : If true , set top properties of Recommendations Text 3 : object and commendations Field object to 3465. Solution in VBForums. Greg

Donate