Saturday, December 19, 2009

How to add validations to a FileUpload control in c#

I found a great article that demonstrates how to validate a File Upload control in APS.net.Here we can use simple asp.net required field validators & regular expression validators easily to filter file formats.

The following article gives an excellent demostration.

http://msdn.microsoft.com/en-us/library/aa478971.aspx

Thursday, December 17, 2009

How to Poppulate a dropdown in a gridview in Row Editing

protected void gv_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow &&
(e.Row.RowState & DataControlRowState.Edit) == DataControlRowState.Edit)
{
// Here you will get the Control you need like:
DropDownList dl = (DropDownList)e.Row.FindControl("ddlPBXTypeNS");
}
}

That if will only be valid for a DataRow (the actually row with data) and if it's in Edit mode... because you only Edit one row at a time the e.Row.FindControl("ddlPBXTypeNS") will only find the control that you want.

For More Info....

Visit

http://stackoverflow.com/questions/833490/asp-net-3-5-gridview-row-editing-dynamic-binding-to-a-dropdownlist

Tuesday, December 15, 2009

asp.net ajax client-side framework failed to load.

I got an error saying that "asp.net ajax client-side framework failed to load."

But it was working fine yesterday.Even code reverting didn't work for me.Then I found .Net 3.5 SP1 in my Control Panel - Add/Remove Programs. I clicked Change... and was relieved to see a "Repair" option.

With bated breath I waited for Windows to complete the repair. After a few minutes, I saw that the repair was complete. Now for the test. I ran my web application and all of the Ajax errors disappeared.

Perhaps this was coincidental; who knows. I suppose I could go through my logs, but I'm back in business and that is good enough for me. Of course, this doesn't explain how Ajax got broken in the first place.

Sunday, December 13, 2009

Ajax Grid View With Insert Edit Delete

I found an excellent article on internet.

http://ramanisandeep.wordpress.com/2008/11/16/gridview-insert-update-delete/

Thursday, December 3, 2009

Disadvantages in content editor web part in sharepoint

Unfortunately there are several serious issues with Content Editor :

  1. Content Editor Web Part content isn’t versioned. You can create as many versions the web part page as you like, the actual content – which is contained within the Content Editor Web Part – isn’t versioned. This is a wider problem with web parts in general, but especially of note when attempting to provide web content management.
  2. Content Editor Web Part content can’t be searched. Yes, this is as bad as it seems. Add your content to the Content Editor Web Part and it can’t be seen by the WSS Search.

There is another issue with the Content Editor Web Part; whenever you re-open the web part to update content it turns all server-relative URLs into absolute URLs. Therefore if you have your content accessible from different addresses (when you have an extranet and an intranet for example) any linked content will be broken for one of them as soon as anyone updates the content. The only way around this is to edit the HTML directly. Hardly suitable for non-technical users.

Solution

In a nutshell: create a Content Type to contain the web content within the page itself and make use of the superior Telerik RadEditor Lite content editor.