Archive for 'ASP.NET'
Enter button in TextBox ASP.NET
This article is demonstrating how to wire up an enter key into a textbox. For example you have a search text box where you press enter then it will click go button and at the same page you have another textbox where you want to do another button click when you press the enter which [...]
Posted: August 17th, 2010 under ASP.NET, Javascript, VB.NET.
Tags: ASP.NET, Javascript, Keypress, VB.NET
Comments: none
ASP.NET Calendar selected day on click method
I’ve a case where I have an ASP.NET calendar that has a page load method that automatically select a date when it’s loaded. I also have an event defined for Selected_Changed which will be triggered only when the user select any other date other than pre-selected date on the load
Private Sub ctlCalendar_SelectionChanged(ByVal sender As Object, [...]
Posted: August 17th, 2010 under ASP.NET, Javascript, VB.NET.
Tags: ASP.NET, Calendar, Calendar javascript, Calendar Selected Date
Comments: none
Telerik SL Gridview Cell Foreground color dynamically based on multiple binding
I had a problem before where I build dynamic system (light dataset) for doing CRUD (Create, Read, Update and Delete) and I need to store the history of previous record before Update/Delete and at the same time I also need to indicate the column(e.g changing the color of the column) that has been changed per [...]
Posted: July 6th, 2010 under .NET, Silverlight, VB.NET.
Tags: Cell Converter, ItemDatabound, RadGridView Silverlight, Silverlight, Telerik
Comments: none
Reflection GetProperty case sensitive issue
Reflection on .NET by default is case sensitive for the class member. To make it case insensitive you need to pass BindingFlags.IgnoreCase . I’ve passed the ignorecase flag and now it doesn’t return anything!!!
Dim pi As PropertyInfo = Me.[GetType]().GetProperty(fieldname, BindingFlags.IgnoreCase)
Basically, if you pass one flag then the other flags will be overwritten by [...]
Posted: June 28th, 2010 under .NET, ASP.NET, C#, VB.NET.
Tags: Case Sensitive, GetProperty, Reflection
Comments: none
Compression in Silverlight Isolated Storage
Isolated storage in silverlight is used to store information or object therefore we don’t need to go to database to get all the information over and over again but again to use isolated storage or not should be based on case by case. Based on the implementation of the code below, I’ve found that it [...]
Posted: December 4th, 2009 under .NET, ASP.NET, VB.NET.
Tags: Isolated Storage, Silverlight
Comments: none
FormsAuthentication.GetRedirectUrl only get the first parameter of querystring
I found the issue with FormsAuthentication.GetRedirectUrl when it redirects then it redirects with the first querystring that you have while in fact you might have more than one querystring
e.g http://localhost/myweb/login.aspx?returnurl=myview.aspx?viewID=123&viewname=abc&viewall=false then the standard FormsAuthentication will redirect to http://localhost/myweb/myview.aspx?viewID=123
but where’s the remaining viewname querystring and viewall querystring??to fix this, just use the code below to pick [...]
Posted: August 7th, 2009 under .NET, ASP.NET, VB.NET.
Tags: ASP.NET, Forms Authentication
Comments: none
an activex control on this page might be unsafe to interact with other parts of the page. do you want to allow this interaction?
I keep getting this message “an activex control on this page might be unsafe to interact with other parts of the page. do you want to allow this interaction” when I try to access a page that use Javascript to access ActiveX Code. I’ve spent quite sometime to get rid of this error message and [...]
Posted: July 3rd, 2009 under .NET, C#, Javascript, VB.NET.
Comments: none
Resolve URL functions
This snippet code is credited to Scott’s Hanselman, This Resolve URL function is used where you want to implement it on your business layer.
Methods:
#region "Image URL helpers"
public static string ResolveUrl(string originalUrl)
{ [...]
Posted: May 31st, 2009 under .NET, ASP.NET, C#.
Tags: ASP.NET, C#, Resolve URL methods
Comments: none
Upload Multiple Files to FTP in .NET
I’ve played around with FTP couple of weeks back. My application is required to feed FTP folder with 1000+ files daily. I’ve been googling around and I found one of the methods is to use WebApplication so I decided to put this WebApplication method to upload while iterating every single files in the directory. After 5 files, [...]
Posted: May 24th, 2009 under .NET, ASP.NET, C#, VB.NET.
Tags: Asynchronous Upload, The remote server returned an error: (503) Bad sequence of commands, Upload Files to FTP
Comments: none
SQL Server Function using CLR
UPDATED: I’ve added one function to write from BLOB in SQL Server table to the disk straight away
I thought this article might be useful for anyone that wants to implement .NET code to SQL server level. In this case I really need CLR because I want to do compression of images and I believe it’s [...]
Posted: October 9th, 2008 under .NET, C#, SQL Server.
Tags: .NET, SQL Server, TSQL
Comments: 2