Archives for the ‘ASP.NET’ Category

ASP.NETs Forms Based Authentication

By Jamsi • Oct 31st, 2008 • Category: ASP.NET

Websites that offer membership based services often require their important files to be secured from non-members. For this purpose, they need to implement form based authentication that ensures that only members can access the files and even if a non-member copies the exact location of the file on the server, he/she is denied access to [...]



The GridView fired event PageIndexChanging which wasn’t handled

By Jamsi • Oct 22nd, 2008 • Category: ASP.NET

If you’ve set a gridviews AllowPaging attribute to “true”, you’ll notice the following error;
The GridView fired event PageIndexChanging which wasn’t handled



Hiding Details view after update

By Jamsi • Mar 28th, 2008 • Category: ASP.NET

I had the need to hide a detailsview after an update. Forget using visible=false, this just hides it permanently!



Weird scrolling issue with Modalpopupextender

By Jamsi • Jan 21st, 2008 • Category: ASP.NET

Are you ripping your hair out over a issue with the AJAX modalpopupextender and a never-ending scrollbar?!? I had a panel with a style=absolute in the style= tag, causing the popup to show in the middle of the page. But for some reason, the page went wonky and I could scroll endlessly!
Here’s the fix;
I changed [...]



Using Windows Authentication under IIS7 (ASP.NET)

By Jamsi • May 23rd, 2007 • Category: ASP.NET, Windows Vista

Okay so I took me a few hours but I finally figured out how to turn on Windows Authentication under IIS7. For some reason, it’s turned off by default and in IIS7 under authentication you’ll only see anonymous.
I have a ASP.NET 1.1 application that requires Windows Authentication and this was the error I was receiving.
“You [...]



Check all function for Datagrids

By Jamsi • Dec 1st, 2006 • Category: ASP.NET

I had the need to create a datagrid check all function, similar to those that you see in yahoo, gmail, hotmail etc.
My Datagrid looked like this;

With the datagrid code above, make sure you modify the jsSelectAll parameters!
1st var: The name of your datagrid (In my example, dgList)
2nd var: The name of your check all checkbox
I [...]



NullableTypes Access is denied

By Jamsi • Feb 15th, 2006 • Category: ASP.NET

I came across a problem where everytime I recompiled my C# ASP.NET project and visited the website; it would report the following error.
Exception Details: System.IO.FileLoadException: Access is denied: ‘NullableTypes’
I asked the developers for a fix and they came through with a quick and easy solution.
First you must check that the ASPNET user (most likely NETWORK [...]



Adding sorting ability to a repeater control

By Jamsi • Feb 11th, 2006 • Category: ASP.NET

This code snippet shows you how to sort a repeater web form control. This is handy when you are using scrollable repeater tables.

DataView dv = ds.Tables[0].DefaultView;
dv.Sort = “firstname asc”;
rptUsers.DataSource = dv;



Australian or British Date format in ASP.NET

By Jamsi • Feb 8th, 2006 • Category: ASP.NET

Having problems with dates appearing in US format (mm/dd/yyyy) and not British or Australian format (dd/mm/yyyy)? Are you getting the famous “Invalid datetime format” error?
If your British, whack the following in your web.config file.

Else if you’re Australian, use the following.

Also, make sure your connection string has the following: ;Language=British



eWorld Calander manual input

By Jamsi • Feb 7th, 2006 • Category: ASP.NET

Do you use the eWorld calander control and want to allow your users to input the dates manually as well as allow selection from the calander popup?
Try using the following option.
DisableTextboxEntry = False



Setting a default list item in a drop down list

By Jamsi • Feb 2nd, 2006 • Category: ASP.NET

Ever wanted to add a default “select” item to a listbox after a databind?
The following should do the trick.

DropDownList1.DataSource = YourDataSet;
DropDownList1.DataBind();

// Add Default list item at index 0
DropDownList1.Items.Insert(0, new ListItem(”- select -”, “0″));

This adds a new item with a text title of “- select -” and a value of 0.