DetailsView和ObjectDataSource - 如何获取更新的对象 [英] DetailsView and ObjectDataSource - how to get updated object

查看:63
本文介绍了DetailsView和ObjectDataSource - 如何获取更新的对象的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在传递整个对象或者在我的选择和更新中传递参数

方法。


如果设置UpdateMethod,我可以获取更新的对象,让ASP.NET自动生成

更新按钮,然后在进行更改后按更新,但我不想b $ b想要更新按钮。


当用户按下我的其他

操作按钮时,如何获取更新的对象?


谢谢,


Jim

I am passing the whole object instead or parameters in my select and update
methods.

I can get the updated object if I set UpdateMethod, let ASP.NET autogenerate
an update button, and then press update after making changes, but I don''t
want that update button.

How can I get the updated object when the user presses one of my other
action buttons?

Thanks,

Jim

推荐答案

嗨Jim,


欢迎来到ASPNET新闻组。

至于ASP.NET 2.0的DetailsView控件,根据我的研究,在
之后我们在DetailsView上执行DataBinding,来自DataSource的所有数据

通过ViewState持久保存在DetailsView中,并且它们不是直接暴露给我们的
。目前,如果我们需要从paramters集合中检索OldValues和

NewValues和键值,最好的方法是使用detailsView的buildin Updating命令。
。如果你不想要

来使用buildin编辑/更新/取消按钮,当然我们可以使用我们自己的

按钮,我们可以添加一个自定义字段并将我们自己的提交或链接按钮放在

中。但我们需要为它们设置正确的commandName,例如编辑,

更新,取消等。 ...


谢谢,


Steven Cheng

微软在线支持


安全! www.microsoft.com/security

(此帖子按原样提供,不作任何保证,并且不授予

权利。)


------------ --------

| Thread-Topic:DetailsView和ObjectDataSource - 如何获取更新对象

| thread-index:AcXI + V3yM7Jnzt0DTLaRAvFSeSyfuQ ==

| X-WBNR-Posting-Host:209.137.235.2

| From:" =?Utf-8?B?SmltIEhhbW1vbmQ =?=" < Ji ************** @ nospam.nospam>

|主题:DetailsView和ObjectDataSource - 如何获取更新对象

|日期:2005年10月4日星期二08:36:19 -0700

|行数:13

|消息ID:< 65 ********************************** @ microsoft.co m>

| MIME版本:1.0

|内容类型:text / plain;

| charset =" Utf-8"

|内容传输编码:7位

| X-Newsreader:适用于Windows 2000的Microsoft CDO

| Content-Class:urn:content-classes:message

|重要性:正常

|优先级:正常

| X-MimeOLE:由Microsoft MimeOLE制作V6.00.3790.0

|新闻组:microsoft.public.dotnet.framework.aspnet

| NNTP-Posting-Host:TK2MSFTNGXA03.phx.gbl 10.40.2.250

|路径:TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl

|外翻:TK2MSFTNGXA01.phx.gbl

microsoft.public.dotnet.framework.aspnet:128896

| X-Tomcat-NG:microsoft.public.dotnet.framework.aspnet

|

|我正在传递整个对象或参数在我的选择和

更新

|方法。

|

|如果设置UpdateMethod,我可以获取更新的对象,让ASP.NET

自动生成

|更新按钮,然后在进行更改后按更新,但我不是
|想要更新按钮。

|

|当用户按下我的其他一个

|时,如何获取更新的对象动作按钮?

|

|谢谢,

|

| Jim

|

Hi Jim,

Welcome to ASPNET newsgroup.
As for the ASP.NET 2.0''s DetailsView control , based on my research, after
we perform DataBinding on the DetailsView, all the datas from DataSource
are persisted in the DetailsView through ViewState, and they''re not
directly exposed to us. Currently if we need to retrieve the OldValues and
NewValues and key values from the paramters collection ,the best means is
utilize the detailsView''s buildin Updating command. And if you don''t want
to use the buildin edit/update/cancel button, of course we can use our own
buttons, we can add a custom field and put our own submit or linkbutton in
it. But we need to set the proper commandName for them such as "Edit",
"Update", "Cancel" ...

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

--------------------
| Thread-Topic: DetailsView and ObjectDataSource - how to get updated object
| thread-index: AcXI+V3yM7Jnzt0DTLaRAvFSeSyfuQ==
| X-WBNR-Posting-Host: 209.137.235.2
| From: "=?Utf-8?B?SmltIEhhbW1vbmQ=?=" <Ji**************@nospam.nospam>
| Subject: DetailsView and ObjectDataSource - how to get updated object
| Date: Tue, 4 Oct 2005 08:36:19 -0700
| Lines: 13
| Message-ID: <65**********************************@microsoft.co m>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
| Xref: TK2MSFTNGXA01.phx.gbl
microsoft.public.dotnet.framework.aspnet:128896
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| I am passing the whole object instead or parameters in my select and
update
| methods.
|
| I can get the updated object if I set UpdateMethod, let ASP.NET
autogenerate
| an update button, and then press update after making changes, but I don''t
| want that update button.
|
| How can I get the updated object when the user presses one of my other
| action buttons?
|
| Thanks,
|
| Jim
|


开发人员真正需要的是一种指定DataItem的方法

当用户按下普通按钮时,应该填充DetailView的属性(使用数据对象),以便当前屏幕上具有值

的数据对象可用于该按钮的事件处理程序

点击。当我需要时,DataItem属性总是为null。


除了保存开发人员从

新值集合中构造数据对象,这将使开发人员能够在会话中存储对象

,这在

数据对象的选择和更新方法中是不可用的。此外,它将允许更直观的UI,因为按钮将不必在DetailView中,除非有意义。

Steven Cheng [MSFT]"写道:
What the developer really needs is a way to specify that the DataItem
property of the DetailView should be populated (with the data object) when
the user presses an ordinary button so that a dataobject with the values
currently on screen will be available in the event handler for that button
click. The DataItem property is always always null, when I need it.

In addition to saving the developer from constructing a data object from a
collection of new values, this would enable the developer to store the object
in the session, which is not availble in the select and update methods of the
data object. Also, it would permit a more intuitive UI because buttons would
not have to be in the DetailView except when that makes sense.
"Steven Cheng[MSFT]" wrote:
嗨Jim,

欢迎来到ASPNET新闻组。
至于ASP.NET 2.0的DetailsView控件,基于我的研究之后,我们在DetailsView上执行DataBinding,来自DataSource的所有数据都通过ViewState保存在DetailsView中,并且它们不会直接暴露给我们。目前,如果我们需要从paramters集合中检索OldValues和
NewValues和键值,最好的方法是使用detailsView的buildin Updating命令。如果你不想使用buildin编辑/更新/取消按钮,我们当然可以使用我们自己的
按钮,我们可以添加一个自定义字段并将我们自己的提交或链接按钮放入
它。但是我们需要为它们设置正确的commandName,例如Edit,
,Update,取消等。 ...

谢谢,

Steven Cheng
微软在线支持

获得安全! www.microsoft.com/security
(此帖已提供按原样,没有保证,也没有赋予
权利。)

--------------------
| Thread-Topic:DetailsView和ObjectDataSource - 如何获取更新的对象
| thread-index:AcXI + V3yM7Jnzt0DTLaRAvFSeSyfuQ ==
| X-WBNR-Posting-Host:209.137.235.2
| From:" =?Utf-8?B?SmltIEhhbW1vbmQ =?=" < Ji ************** @ nospam.nospam>
|主题:DetailsView和ObjectDataSource - 如何获取更新对象
|日期:2005年10月4日星期二08:36:19 -0700
|行:13
|消息ID:< 65 ********************************** @ microsoft.co m>
| MIME版本:1.0
|内容类型:text / plain;
| charset =" Utf-8"
| Content-Transfer-Encoding:7bit
| X-Newsreader:适用于Windows 2000的Microsoft CDO
| Content-Class:urn:content-classes:message
|重要性:正常
|优先级:正常
| X-MimeOLE:由Microsoft MimeOLE制作V6.00.3790.0
|新闻组:microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host:TK2MSFTNGXA03.phx.gbl 10.40.2.250
|路径:TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
|外翻:TK2MSFTNGXA01.phx.gbl
microsoft.public.dotnet.framework.aspnet:128896
| X-Tomcat-NG:microsoft.public.dotnet.framework.aspnet
|
|我正在传递整个对象或参数在我的选择和
更新
|方法。
|
|如果我设置UpdateMethod,我可以获取更新的对象,让ASP.NET
自动生成
|更新按钮,然后在进行更改后按更新,但我不是想要更新按钮。
|
|当用户按下我的其他对象时,如何获取更新的对象?动作按钮?
|
|谢谢,
|
| Jim
|
Hi Jim,

Welcome to ASPNET newsgroup.
As for the ASP.NET 2.0''s DetailsView control , based on my research, after
we perform DataBinding on the DetailsView, all the datas from DataSource
are persisted in the DetailsView through ViewState, and they''re not
directly exposed to us. Currently if we need to retrieve the OldValues and
NewValues and key values from the paramters collection ,the best means is
utilize the detailsView''s buildin Updating command. And if you don''t want
to use the buildin edit/update/cancel button, of course we can use our own
buttons, we can add a custom field and put our own submit or linkbutton in
it. But we need to set the proper commandName for them such as "Edit",
"Update", "Cancel" ...

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

--------------------
| Thread-Topic: DetailsView and ObjectDataSource - how to get updated object
| thread-index: AcXI+V3yM7Jnzt0DTLaRAvFSeSyfuQ==
| X-WBNR-Posting-Host: 209.137.235.2
| From: "=?Utf-8?B?SmltIEhhbW1vbmQ=?=" <Ji**************@nospam.nospam>
| Subject: DetailsView and ObjectDataSource - how to get updated object
| Date: Tue, 4 Oct 2005 08:36:19 -0700
| Lines: 13
| Message-ID: <65**********************************@microsoft.co m>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
| Xref: TK2MSFTNGXA01.phx.gbl
microsoft.public.dotnet.framework.aspnet:128896
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| I am passing the whole object instead or parameters in my select and
update
| methods.
|
| I can get the updated object if I set UpdateMethod, let ASP.NET
autogenerate
| an update button, and then press update after making changes, but I don''t
| want that update button.
|
| How can I get the updated object when the user presses one of my other
| action buttons?
|
| Thanks,
|
| Jim
|



感谢您的回复Jim,


是的, DateItem在DataBinding期间使用,之后,在
顺序页面reuqest中,它为null。所以我们无法在顺序回发事件中通过它检索

DataObject。如果你确实需要在回发事件中检索记录值,我们有以下方法:


1.使用BoundFields,并使用DetailsView.Rows收集和

DetailsViewRow.Cells集合访问TableCell.Text,它存储了当前记录的某些字段值。例如,假设我们在详细信息中有以下字段:


<字段>

< asp:BoundField DataField =" CategoryID"

HeaderText =" CategoryID" InsertVisible =" False"

ReadOnly =" True"的SortExpression = QUOT;类别ID" />

< asp:BoundField DataField =" CategoryName"

HeaderText =" CategoryName"的SortExpression = QUOT;类别名称" />

< asp:BoundField DataField =" Description"

HeaderText =" Description"的SortExpression = QUOT;描述" />


< / Fields>


,我们可以使用以下代码显示UI中显示的所有值:


protected void Button1_Click(object sender,EventArgs e)

{


foreach(DetailsView1.Rows中的DetailsViewRow dvr)

{

Response.Write("< br>" + dvr.Cells [1] .Text);

} < br $>
}


我们将获得三行,每行代表一个字段。 (CategoryID,

分类名称和描述)


2.此外,由于你没有使用buildin编辑/更新功能,我们可以

用我们的自定义模板字段替换boundfields。对于

,我们在DetailsView中定义以下模板字段


< asp:TemplateField>

< ItemTemplate>

< asp:TextBox ID =" txtCategoryID" runat =" server"

Text =''<%#Eval(" CategoryID")%>''/>

< / ItemTemplate>

< / asp:TemplateField>


然后在回发代码中,我们可以使用Findcontrol来检索TextBox

参考:


TextBox txt = DetailsView1.FindControl(" txtCategoryID")as TextBox;

Response.Write("< br> txtCategoryID:" + txt.Text);

#1和#2都只适用于当前显示的记录。


谢谢,


Steven Cheng

微软在线支持


安全! www.microsoft.com/security


--------------------

| Thread-Topic:DetailsView和ObjectDataSource - 如何获取更新对象

| thread-index:AcXKsvD0F + uHjQARQnK7GtRm1KeQJA ==

| X-WBNR-Posting-Host:209.137.235.2

| From:" =?Utf-8?B?SmltIEhhbW1vbmQ =?=" < Ji ************** @ nospam.nospam>

|参考文献:< 65 ********************************** @ microsoft.co m>

< V5 ************** @ TK2MSFTNGXA01.phx.gbl>

|主题:RE:DetailsView和ObjectDataSource - 如何获取更新对象

|日期:2005年10月6日星期四13:17:14 -0700

|行数:83

|消息ID:< CB ********************************** @ microsoft.co m>

| MIME版本:1.0

|内容类型:text / plain;

| charset =" Utf-8"

|内容传输编码:7位

| X-Newsreader:适用于Windows 2000的Microsoft CDO

| Content-Class:urn:content-classes:message

|重要性:正常

|优先级:正常

| X-MimeOLE:由Microsoft MimeOLE制作V6.00.3790.0

|新闻组:microsoft.public.dotnet.framework.aspnet

| NNTP-Posting-Host:TK2MSFTNGXA03.phx.gbl 10.40.2.250

|路径:TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl

|外翻:TK2MSFTNGXA01.phx.gbl

microsoft.public.dotnet.framework.aspnet:129593

| X-Tomcat-NG:microsoft.public.dotnet.framework.aspnet

|

|开发人员真正需要的是一种指定DataItem

|的方法应该填充DetailView的属性(使用数据对象)



|用户按下普通按钮,使数据对象的值为

|目前在屏幕上将在事件处理程序中提供

按钮

|单击。当我需要时,DataItem属性总是为null。

|

|除了保存开发人员免于构建数据对象

a

|收集新值,这将使开发人员能够存储

对象

|在会话中,这在

的选择和更新方法中无法使用

|数据对象。此外,它将允许更直观的UI,因为按钮



|除非有意义,否则不必在DetailView中。

|

|

| Steven Cheng [MSFT]"写道:

|

| >嗨吉姆,

| >

| >欢迎来到ASPNET新闻组。

| >至于ASP.NET 2.0的DetailsView控件,基于我的研究,

之后

| >我们在DetailsView上执行DataBinding,所有数据来自

DataSource

| >通过ViewState持久保存在DetailsView中,它们不是

| >直接暴露给我们。目前,如果我们需要检索OldValues



| >来自参数集合的新价值和关键价值,最好的手段



| >利用detailsView'的buildin更新命令。如果你不想要
想要

| >使用buildin编辑/更新/取消按钮,当然我们可以使用我们的

拥有

| >按钮,我们可以添加自定义字段并将我们自己的提交或链接按钮

in

| >它。但是我们需要为它们设置正确的commandName,例如Edit,

| > 更新,取消和取消 ......

| >

| >谢谢,

| >

| > Steven Cheng

| > Microsoft在线支持

| >

| >安全! www.microsoft.com/security

| > (此帖子按原样提供,不作任何保证,并且不授予

|>权利。)

| >

| >

| >

| > --------------------

| > | Thread-Topic:DetailsView和ObjectDataSource - 如何更新

object

| > | thread-index:AcXI + V3yM7Jnzt0DTLaRAvFSeSyfuQ ==

| > | X-WBNR-Posting-Host:209.137.235.2

| > | From:" =?Utf-8?B?SmltIEhhbW1vbmQ =?=" < Ji ************** @ nospam.nospam>

| > |主题:DetailsView和ObjectDataSource - 如何获取更新对象

| > |日期:2005年10月4日星期二08:36:19 -0700

| > |行数:13

| > |消息ID:< 65 ********************************** @ microsoft.co m>

| > | MIME版本:1.0

| > |内容类型:text / plain;

| > | charset =" Utf-8"

| > |内容传输编码:7位

| > | X-Newsreader:适用于Windows 2000的Microsoft CDO

| > | Content-Class:urn:content-classes:message

| > |重要性:正常

| > |优先级:正常

| > | X-MimeOLE:由Microsoft MimeOLE制作V6.00.3790.0

| > |新闻组:microsoft.public.dotnet.framework.aspnet

| > | NNTP-Posting-Host:TK2MSFTNGXA03.phx.gbl 10.40.2.250

| > |路径:TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl

| > |外部参照:TK2MSFTNGXA01.phx.gbl

| > microsoft.public.dotnet.framework.aspnet:128896

| > | X-Tomcat-NG:microsoft.public.dotnet.framework.aspnet

| > |

| > |我将整个对象或参数传递给我的选择和

| >更新

| > |方法。

| > |

| > |如果设置UpdateMethod,我可以获取更新的对象,让ASP.NET

| >自动生成

| > |一个更新按钮,然后在更改后按更新,但我

不要

| > |想要更新按钮。

| > |

| > |当用户按下我的其中一个时,我如何获得更新的对象?
其他

| > |动作按钮?

| > |

| > |谢谢,

| > |

| > |吉姆

| > |

| >

| >

|

Thanks for your response Jim,

Yes ,the DateItem is used during the DataBinding period, after that , in
the sequential page reuqest, it''s null. So we can not retrieve the
DataObject back through it in sequential postback events. If you do need to
retrieve the record values in postback event, we have the following means:

1. Use BoundFields, and use the DetailsView.Rows collection and
DetailsViewRow.Cells collection to access the TableCell.Text which stored
the current record''s certain fields values. For example, suppose we have
the following fields in detailsView:

<Fields>
<asp:BoundField DataField="CategoryID"
HeaderText="CategoryID" InsertVisible="False"
ReadOnly="True" SortExpression="CategoryID" />
<asp:BoundField DataField="CategoryName"
HeaderText="CategoryName" SortExpression="CategoryName" />
<asp:BoundField DataField="Description"
HeaderText="Description" SortExpression="Description" />

</Fields>

,we can use the following code to display all the values displayed in UI:

protected void Button1_Click(object sender, EventArgs e)
{

foreach (DetailsViewRow dvr in DetailsView1.Rows)
{
Response.Write("<br> " + dvr.Cells[1].Text);
}
}

we will get three rows ,each row represent a field. (CategoryID,
CategoryName and Description)

2. Also, since you''re not using the buildin edit/update funciton, we can
replace the boundfields with our custom template fields instead. for
exmple, we define the following template fields in DetailsView

<asp:TemplateField >
<ItemTemplate>
<asp:TextBox ID="txtCategoryID" runat="server"
Text=''<%# Eval("CategoryID") %>'' />
</ItemTemplate>
</asp:TemplateField>

Then in postback code , we can use Findcontrol to retrieve the TextBox
Reference:

TextBox txt = DetailsView1.FindControl("txtCategoryID") as TextBox;
Response.Write("<br>txtCategoryID: " + txt.Text);
Both the #1 and #2 only apply to the current displayed record.

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security

--------------------
| Thread-Topic: DetailsView and ObjectDataSource - how to get updated object
| thread-index: AcXKsvD0F+uHjQARQnK7GtRm1KeQJA==
| X-WBNR-Posting-Host: 209.137.235.2
| From: "=?Utf-8?B?SmltIEhhbW1vbmQ=?=" <Ji**************@nospam.nospam>
| References: <65**********************************@microsoft.co m>
<V5**************@TK2MSFTNGXA01.phx.gbl>
| Subject: RE: DetailsView and ObjectDataSource - how to get updated object
| Date: Thu, 6 Oct 2005 13:17:14 -0700
| Lines: 83
| Message-ID: <CB**********************************@microsoft.co m>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
| Xref: TK2MSFTNGXA01.phx.gbl
microsoft.public.dotnet.framework.aspnet:129593
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| What the developer really needs is a way to specify that the DataItem
| property of the DetailView should be populated (with the data object)
when
| the user presses an ordinary button so that a dataobject with the values
| currently on screen will be available in the event handler for that
button
| click. The DataItem property is always always null, when I need it.
|
| In addition to saving the developer from constructing a data object from
a
| collection of new values, this would enable the developer to store the
object
| in the session, which is not availble in the select and update methods of
the
| data object. Also, it would permit a more intuitive UI because buttons
would
| not have to be in the DetailView except when that makes sense.
|
|
| "Steven Cheng[MSFT]" wrote:
|
| > Hi Jim,
| >
| > Welcome to ASPNET newsgroup.
| > As for the ASP.NET 2.0''s DetailsView control , based on my research,
after
| > we perform DataBinding on the DetailsView, all the datas from
DataSource
| > are persisted in the DetailsView through ViewState, and they''re not
| > directly exposed to us. Currently if we need to retrieve the OldValues
and
| > NewValues and key values from the paramters collection ,the best means
is
| > utilize the detailsView''s buildin Updating command. And if you don''t
want
| > to use the buildin edit/update/cancel button, of course we can use our
own
| > buttons, we can add a custom field and put our own submit or linkbutton
in
| > it. But we need to set the proper commandName for them such as "Edit",
| > "Update", "Cancel" ...
| >
| > Thanks,
| >
| > Steven Cheng
| > Microsoft Online Support
| >
| > Get Secure! www.microsoft.com/security
| > (This posting is provided "AS IS", with no warranties, and confers no
| > rights.)
| >
| >
| >
| > --------------------
| > | Thread-Topic: DetailsView and ObjectDataSource - how to get updated
object
| > | thread-index: AcXI+V3yM7Jnzt0DTLaRAvFSeSyfuQ==
| > | X-WBNR-Posting-Host: 209.137.235.2
| > | From: "=?Utf-8?B?SmltIEhhbW1vbmQ=?=" <Ji**************@nospam.nospam>
| > | Subject: DetailsView and ObjectDataSource - how to get updated object
| > | Date: Tue, 4 Oct 2005 08:36:19 -0700
| > | Lines: 13
| > | Message-ID: <65**********************************@microsoft.co m>
| > | MIME-Version: 1.0
| > | Content-Type: text/plain;
| > | charset="Utf-8"
| > | Content-Transfer-Encoding: 7bit
| > | X-Newsreader: Microsoft CDO for Windows 2000
| > | Content-Class: urn:content-classes:message
| > | Importance: normal
| > | Priority: normal
| > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| > | Newsgroups: microsoft.public.dotnet.framework.aspnet
| > | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| > | Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
| > | Xref: TK2MSFTNGXA01.phx.gbl
| > microsoft.public.dotnet.framework.aspnet:128896
| > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
| > |
| > | I am passing the whole object instead or parameters in my select and
| > update
| > | methods.
| > |
| > | I can get the updated object if I set UpdateMethod, let ASP.NET
| > autogenerate
| > | an update button, and then press update after making changes, but I
don''t
| > | want that update button.
| > |
| > | How can I get the updated object when the user presses one of my
other
| > | action buttons?
| > |
| > | Thanks,
| > |
| > | Jim
| > |
| >
| >
|


这篇关于DetailsView和ObjectDataSource - 如何获取更新的对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆