Click here to Skip to main content
15,912,897 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: GridView.Columns Pin
eggsovereasy22-Jun-06 7:46
eggsovereasy22-Jun-06 7:46 
GeneralRe: GridView.Columns Pin
Mike Ellison22-Jun-06 8:42
Mike Ellison22-Jun-06 8:42 
GeneralBrilliant! Pin
eggsovereasy22-Jun-06 9:30
eggsovereasy22-Jun-06 9:30 
GeneralRe: Brilliant! Pin
Mike Ellison22-Jun-06 10:20
Mike Ellison22-Jun-06 10:20 
QuestionAdding DataRow in DataTable Pin
peshawarcoder22-Jun-06 5:08
peshawarcoder22-Jun-06 5:08 
AnswerRe: Adding DataRow in DataTable Pin
Paddy Boyd22-Jun-06 5:52
Paddy Boyd22-Jun-06 5:52 
GeneralRe: Adding DataRow in DataTable Pin
peshawarcoder22-Jun-06 5:57
peshawarcoder22-Jun-06 5:57 
QuestionObjectDatasource Deletemethod w custom Business Object [modified] Pin
patt22-Jun-06 4:37
patt22-Jun-06 4:37 
Hi, I've tried to create a business object that can fully bind to the ObjectDatasource to be used in a DetailsView object for example. Everything works f Dead | X| ine here, but I cannot seem to get the deletemethod to do anything. This is the testobject I created:

public class BO
{
private int _id = 0;
public int Id
{
get { return _id; }
set { _id = value; }
}
private string _Field = string.Empty;
public string Field1
{
get { return _Field; }
set { _Field = value; }
}
private string _Field2 = string.Empty;
public string Field2
{
get { return _Field2; }
set { _Field2 = value; }
}

public BO() { }

public BO(string fld1, string fld2)
{
Field1 = fld1;
Field2 = fld2;
}

public BO LoadMe()
{
return (HttpContext.Current.Session["bo"] != null)?(BO)HttpContext.Current.Session["bo"]:new BO();
}

public void AddMe(BO bo)
{
HttpContext.Current.Session["bo"] = bo;
}

public void DeleteMe(BO bo)
{
BO InMem = (HttpContext.Current.Session["bo"] != null) ? (BO)HttpContext.Current.Session["bo"] : new BO();
if (InMem.Id == bo.Id) // Why is bo empty ??
HttpContext.Current.Session["bo"] = new BO();
}

I created a page with an objectdatasource, selecting LoadMe as the SELECT method, AddMe() as the INSERT method, and DeleteMe() as the DELETE method. The odd thing is that DeleteMe() fires, but the parameter bo is passed with just empty values..

Does anyone know what I'm doing wrong (if I'm doing something wrong) ?

Never mind the working of the object, I just need the Delete method to work.

tia,

Patt

-- modified at 10:37 Thursday 22nd June, 2006
AnswerRe: ObjectDatasource Deletemethod w custom Business Object Pin
minhpc_bk22-Jun-06 5:30
minhpc_bk22-Jun-06 5:30 
GeneralRe: ObjectDatasource Deletemethod w custom Business Object Pin
patt22-Jun-06 5:48
patt22-Jun-06 5:48 
GeneralRe: ObjectDatasource Deletemethod w custom Business Object Pin
minhpc_bk22-Jun-06 15:01
minhpc_bk22-Jun-06 15:01 
QuestionFree AJAX enabled Controls [modified] Pin
wEb GuRu...22-Jun-06 4:33
wEb GuRu...22-Jun-06 4:33 
AnswerRe: Free AJAX enabled Controls Pin
RichardGrimmer22-Jun-06 4:49
RichardGrimmer22-Jun-06 4:49 
QuestionHow to handle a click of a hyperlink Pin
widget122-Jun-06 4:16
widget122-Jun-06 4:16 
AnswerRe: How to handle a click of a hyperlink Pin
RichardGrimmer22-Jun-06 4:52
RichardGrimmer22-Jun-06 4:52 
GeneralRe: How to handle a click of a hyperlink Pin
widget122-Jun-06 5:57
widget122-Jun-06 5:57 
AnswerRe: How to handle a click of a hyperlink Pin
Dustin Metzgar22-Jun-06 4:58
Dustin Metzgar22-Jun-06 4:58 
GeneralRe: How to handle a click of a hyperlink Pin
widget122-Jun-06 5:08
widget122-Jun-06 5:08 
GeneralRe: How to handle a click of a hyperlink Pin
Dustin Metzgar22-Jun-06 5:21
Dustin Metzgar22-Jun-06 5:21 
AnswerRe: How to handle a click of a hyperlink Pin
patt22-Jun-06 5:08
patt22-Jun-06 5:08 
Questionasp.net 2.0 GridView Pin
fmardani22-Jun-06 4:11
fmardani22-Jun-06 4:11 
AnswerRe: asp.net 2.0 GridView Pin
minhpc_bk22-Jun-06 5:31
minhpc_bk22-Jun-06 5:31 
QuestionShow image in datagrid Pin
maryam_a22-Jun-06 3:11
maryam_a22-Jun-06 3:11 
AnswerRe: Show image in datagrid Pin
varshavmane22-Jun-06 3:15
varshavmane22-Jun-06 3:15 
AnswerRe: Show image in datagrid Pin
varshavmane22-Jun-06 3:17
varshavmane22-Jun-06 3:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.