Posts

Donate

Ajax Control PopupControlExtender GetProxyForCurrentPopup Not Showing In Visual Studio Intellisense

I was wondering why when I type PopupControlExtender. nothing happens. Supposedly, GetProxyForCurrentPopup method will show. The solution was so simple, I forgot to include the namespace of AjaxControlsToolkit. //add namespace AjaxToolkit using AjaxControlToolkit; //call commit method PopupControlExtender pce = PopupControlExtender.GetProxyForCurrentPopup( this ); pce.Commit( "hi" );

JavaScript Object Oriented Programming Using Prototype

Hello, In JavaScript, each Object can inherit properties from another object, called it's prototype . When evaluating an expression to retrieve a property, JavaScript first looks to see if the property is defined directly in the object. If it is not, it then looks at the object's prototype to see if the property is defined there. This continues up the prototype chain until reaching the root prototype. Each object is associated with a prototype which comes from the constructor function from which it is created. (Source: http://mckoss.com/jscript/object.htm ) Here's an example i created: <html> <head> <script type= "text/javascript" language= "javascript" > function NumberManip() { var result = 0; } NumberManip.prototype.add = function (num1, num2) { this .result = num1 + num2; } NumberManip.prototype.subtract = function (num1, num2) { this .result = num1 - num2; }

Inner Joins In SQL Server TSQL

Source: TSQL Programming Reference: An inner join applies two logical query processing phases—it applies a Cartesian product between the two input tables like a cross join, and then it filters rows based on a predicate that you specify. Like cross joins, inner joins have two standard syntaxes: ANSI SQL-92 and ANSI SQL-89. Using the ANSI SQL-92 syntax, you specify the INNER JOIN keywords between the table names. The INNER keyword is optional because an inner join is the default, so you can specify the JOIN keyword alone. You specify the predicate that is used to filter rows in a designated clause called ON. This predicate is also known as the join condition. Here are two basic implementations of inner join scripts i created, one with the inner keyword, and the other w/o the inner keyword. select distinct l.LoanNum, ( c .CusLastName + ', ' + c .CusFirstName + ' ' + c .CusMiddleInit) as Name, Status, DateGranted, AmountGranted from

ASP.NET Web Forms GridView RowUpdating Event Not Getting New Values From Controls

I have a code in rowupdating event which get's values from textbox controls during edit mode. However, when update command button is clicked, the values from the controls were cleared or null. So, I checked the page load event, and found out that I have a code which rebinds the grid when it is not post back since the update link button will trigger postback. Here is the page load code: if (! string .IsNullOrEmpty(Request.QueryString[ "LoanNum" ])) { ShowToControls(Convert.ToInt32(Request.QueryString[ "LoanNum" ])); BindGridDetails(Convert.ToInt32(Request.QueryString[ "LoanNum" ])); } So, the modified pageload code should add a IsPostback condition so that the binding of gridview will not be executed. Here's the modified script: if (! string .IsNullOrEmpty(Request.QueryString[ "LoanNum" ]) && !Page.IsPostBack) { ShowToControls(Convert.ToInt32(Request.QueryString[ "LoanNum" ])); BindGridDe

Online Syntax Highlighter For Code Posts

As I reviewed my blog, the code snippets seems to be a mess and unpresentable. So I did some googling earlier and found some online syntax highlighter that may come in handy. https://tohtml.com/jScript/ https://quickhighlighter.com/ https://hilite.me

How To Cast Numeric Numbers To Decimal Value Using Suffix In C#

Usually, i do decimal.parse(numeric value) to parse numbers to decimal. But there's a shortcut way to do this. Just append a suffix m or M to the numeric value. decimal balanceBank = 50000.5m; decimal balanceBank = 50000.5M; Source: MSDN

URL Rewritting Resolve URL In My External CSS And JavaScript Files

I have applied url rewritting from scott: URL Rewriting Tutorial to make my url's SEO friendly. However, my css and javascript files are created internally (w/ in the page itself). When i tried separating my css and .js files, I usually encountered javascript errors such as: 1. GetCustomerDetail is undefined [based from Mozilla Firebug] 2. Microsoft JS runtime error: object required [Internet explorer] I tried googling for hours about object required and have'nt found an answer. As i read again scott's article, the last paragraph was a hint regarding how to resolve CSS and image external links. The solution I came up with was using Control.ResolveUrl() so that my external javascript and css files will work. src= '<%= Page.ResolveUrl("yourjsfile")%>' 2: href= '<%= Page.ResolveUrl("yourcssfile")%>' A good resource, but haven't tested yet. Westwind Tutorial FROM MSDN: MSDN

Set Focus ASP.NET Web Forms Control Using Page Setfocus() Method

Hello, Most of the time, i usually have a JavaScript function to set focus a control during pageload. The control.focus() most of the time does not work in my asp.net page. But in an ASP.NET Page control, there is a handy method to focus. Page.Setfocus(Control.ClientID); where Control could be a textbox or button.

Highlight ASP.NET Web Forms GridView Row Using JavaScript

Here's the code on how to highlight an ASP.NET Web Forms GridView row using JavaScript. if (e.row.rowtype == DataControlRowType.DataRow) { e.Row.Attributes.Add( "onclick" , "document.getElementById('" + e.Row.ClientID + "') .style.backgroundColor = 'green';" ); }

Structures Example In C#.NET

Good evening team, Before migrating to .NET, i used to code a lot in C++/C.. One of the topics in data structures was structures .C# also has struct in its arsenal.A structure is similar to a class, but is a value type, rather than a reference type. Structures are declared using the keyword struct and are syntactically similar to classes. Here is the general form of a struct. struct name : interfaces { // member declarations } The name of the structure is specified by name.Structures cannot inherit other structures or classes, or be used as a base for other structures or classes. (Of course, like all C# types, structures do inherit object.) However, a structure can implement one or more interfaces. These are specified after the structure name using a comma-separated list. Like classes, structure members include methods, fields, indexers, properties, operator methods, and events. Structures can also define constructors, but not destructors. However, you cannot define a defaul

Donate