Bug in adding new category

Topics: Business Logic Layer, Controls
Mar 8, 2011 at 11:22 PM

Trying to add a new category, it gives the error "Guid should contain 32 digits with 4 dashes". After doing lots of research and debugging on this issue, found the problem in the following lines of code inside "/admin/Posts/Categories.aspx.cs"

 

void btnAdd_Click(object sender, EventArgs e)
	{
		....
		Category cat = new Category(txtNewCategory.Text, description);
                if (ddlNewParent.SelectedValue != "0")
                   cat.Parent = new Guid(ddlNewParent.SelectedValue);
                
		cat.Save();
              ....
	
	}

For some reason ddlNewParent.SelectedValue gets the empty string either you select the "none" category or any existing category or nothing. I am still not able to figure out the issue but if I comment out the "if(...)" condition, then I can create a new category. 

 FYI, I am using BE 2.0 with MS SQL database.  Thought it might be a bug which hasn't been yet identified or fixed. Please let me know if this issue is already fixed or someone fix it soon.

Thanks.

 

 

 


 

 

In admin/Posts/Categories.aspx.cs,