473,769 Members | 6,034 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Use FindControl to find DetailsView BoundField control (vb)

Hello,

I am using the code below to set the values of a DetailsView template field
using FindControl. My question is how would you find a control if its a
Boundfield control?

For example, how would I reference the following BoundField ("NTAccount" ) in
the Sub dvDetail_PreRen der sub? Any help would be appreciated...

<asp:BoundFie ld DataField="NTAc count" HeaderText="NT Account" />

Protected Sub dvDetail_PreRen der(ByVal sender As Object, ByVal e As
EventArgs) Handles dvDetail.PreRen der
If Me.dvDetail.Cur rentMode = DetailsViewMode .Edit Then
CType(Me.dvDeta il.FindControl( "txtChangeActiv ityDate"), TextBox).Text =
Now.ToShortDate String
End If
End Sub

--
Thanks in advance,

sck10
Nov 19 '05 #1
5 23301
You should be able to access the BoundColumns using:

e.Item.Cells[n].Text; //Each cell represents a bound column.

"sck10" wrote:
Hello,

I am using the code below to set the values of a DetailsView template field
using FindControl. My question is how would you find a control if its a
Boundfield control?

For example, how would I reference the following BoundField ("NTAccount" ) in
the Sub dvDetail_PreRen der sub? Any help would be appreciated...

<asp:BoundFie ld DataField="NTAc count" HeaderText="NT Account" />

Protected Sub dvDetail_PreRen der(ByVal sender As Object, ByVal e As
EventArgs) Handles dvDetail.PreRen der
If Me.dvDetail.Cur rentMode = DetailsViewMode .Edit Then
CType(Me.dvDeta il.FindControl( "txtChangeActiv ityDate"), TextBox).Text =
Now.ToShortDate String
End If
End Sub

--
Thanks in advance,

sck10

Nov 19 '05 #2
Hi Sck10,

welcome to ASP.NET newsgroup.
Regarding on the accesing BoundField nested controls in DetailsView
control, since it is autogenerated by runtime and will assign a random id
according to the item index, we can not use FindControl method to locate
the nested control instance. And yes, you'r right, we need to use the
PreRender event since at that time , we can ensure that the Control has
been created and assigned the proper value. For example, when we need to
access the TextBox in BoundField for Edit mode, we can use the following
code in DetailsView's PreRender event:

=============== =======
Protected Sub DetailsView1_Pr eRender(ByVal sender As Object, ByVal e As
System.EventArg s) Handles DetailsView1.Pr eRender
For Each dvr As DetailsViewRow In DetailsView1.Ro ws
If dvr.Cells.Count = 2 Then
If dvr.Cells(1).Co ntrols.Count > 0 Then
Dim txt As TextBox
txt = dvr.Cells(1).Co ntrols(0)
Response.Write( "<br>ID: " & txt.ID)
Response.Write( "<br>Text: " & txt.Text)
End If
End If
Next
End Sub
=============== =========

Also, for such scenario that we need to extract Text value or reference the
nested controls, I'd prefer using TemplateFields since that'll provide us
more control on control's properties definition such as ID.....

In addition, when the binded datasource has large column set, the control's
controls structure may get very complex, I suggest you try turning on the
Page's Page level Trace which will display the Page's Control Tree, then we
can get a clear view of the Page and its sub controls control structure.
This can help us easily locate the nested controls throug index...

Hope helps. 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.)

--------------------
| From: "sck10" <sc***@online.n ospam>
| Subject: Use FindControl to find DetailsView BoundField control (vb)
| Date: Thu, 3 Nov 2005 13:35:30 -0600
| Lines: 25
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1506
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1506
| Message-ID: <eS************ *@TK2MSFTNGP09. phx.gbl>
| Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet
| NNTP-Posting-Host: 189.202.185.135 .in-addr.arpa 135.185.202.189
| Path: TK2MSFTNGXA01.p hx.gbl!TK2MSFTN GP08.phx.gbl!TK 2MSFTNGP09.phx. gbl
| Xref: TK2MSFTNGXA01.p hx.gbl
microsoft.publi c.dotnet.framew ork.aspnet:1358 91
| X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet
|
| Hello,
|
| I am using the code below to set the values of a DetailsView template
field
| using FindControl. My question is how would you find a control if its a
| Boundfield control?
|
| For example, how would I reference the following BoundField ("NTAccount" )
in
| the Sub dvDetail_PreRen der sub? Any help would be appreciated...
|
| <asp:BoundFie ld DataField="NTAc count" HeaderText="NT Account" />
|
| Protected Sub dvDetail_PreRen der(ByVal sender As Object, ByVal e As
| EventArgs) Handles dvDetail.PreRen der
| If Me.dvDetail.Cur rentMode = DetailsViewMode .Edit Then
| CType(Me.dvDeta il.FindControl( "txtChangeActiv ityDate"), TextBox).Text
=
| Now.ToShortDate String
| End If
| End Sub
|
| --
| Thanks in advance,
|
| sck10
|
|
|

Nov 19 '05 #3
Hi Sck10,

How are you doing on this issue? Does the suggestion in my last reply helps
a little? If there're anything else we can help, please feel free to post
here. 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.)
--------------------
| X-Tomcat-ID: 135026330
| References: <eS************ *@TK2MSFTNGP09. phx.gbl>
| MIME-Version: 1.0
| Content-Type: text/plain
| Content-Transfer-Encoding: 7bit
| From: st*****@online. microsoft.com (Steven Cheng[MSFT])
| Organization: Microsoft
| Date: Fri, 04 Nov 2005 07:50:30 GMT
| Subject: RE: Use FindControl to find DetailsView BoundField control (vb)
| X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet
| Message-ID: <PL************ **@TK2MSFTNGXA0 1.phx.gbl>
| Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet
| Lines: 88
| Path: TK2MSFTNGXA01.p hx.gbl
| Xref: TK2MSFTNGXA01.p hx.gbl
microsoft.publi c.dotnet.framew ork.aspnet:1360 52
| NNTP-Posting-Host: TOMCATIMPORT1 10.201.218.122
|
| Hi Sck10,
|
| welcome to ASP.NET newsgroup.
| Regarding on the accesing BoundField nested controls in DetailsView
| control, since it is autogenerated by runtime and will assign a random id
| according to the item index, we can not use FindControl method to locate
| the nested control instance. And yes, you'r right, we need to use the
| PreRender event since at that time , we can ensure that the Control has
| been created and assigned the proper value. For example, when we need to
| access the TextBox in BoundField for Edit mode, we can use the following
| code in DetailsView's PreRender event:
|
| =============== =======
| Protected Sub DetailsView1_Pr eRender(ByVal sender As Object, ByVal e As
| System.EventArg s) Handles DetailsView1.Pr eRender
| For Each dvr As DetailsViewRow In DetailsView1.Ro ws
| If dvr.Cells.Count = 2 Then
| If dvr.Cells(1).Co ntrols.Count > 0 Then
| Dim txt As TextBox
| txt = dvr.Cells(1).Co ntrols(0)
| Response.Write( "<br>ID: " & txt.ID)
| Response.Write( "<br>Text: " & txt.Text)
| End If
| End If
| Next
| End Sub
| =============== =========
|
| Also, for such scenario that we need to extract Text value or reference
the
| nested controls, I'd prefer using TemplateFields since that'll provide us
| more control on control's properties definition such as ID.....
|
| In addition, when the binded datasource has large column set, the
control's
| controls structure may get very complex, I suggest you try turning on the
| Page's Page level Trace which will display the Page's Control Tree, then
we
| can get a clear view of the Page and its sub controls control structure.
| This can help us easily locate the nested controls throug index...
|
| Hope helps. 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.)
|
|
|
| --------------------
| | From: "sck10" <sc***@online.n ospam>
| | Subject: Use FindControl to find DetailsView BoundField control (vb)
| | Date: Thu, 3 Nov 2005 13:35:30 -0600
| | Lines: 25
| | X-Priority: 3
| | X-MSMail-Priority: Normal
| | X-Newsreader: Microsoft Outlook Express 6.00.2800.1506
| | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1506
| | Message-ID: <eS************ *@TK2MSFTNGP09. phx.gbl>
| | Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet
| | NNTP-Posting-Host: 189.202.185.135 .in-addr.arpa 135.185.202.189
| | Path: TK2MSFTNGXA01.p hx.gbl!TK2MSFTN GP08.phx.gbl!TK 2MSFTNGP09.phx. gbl
| | Xref: TK2MSFTNGXA01.p hx.gbl
| microsoft.publi c.dotnet.framew ork.aspnet:1358 91
| | X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet
| |
| | Hello,
| |
| | I am using the code below to set the values of a DetailsView template
| field
| | using FindControl. My question is how would you find a control if its a
| | Boundfield control?
| |
| | For example, how would I reference the following BoundField
("NTAccount" )
| in
| | the Sub dvDetail_PreRen der sub? Any help would be appreciated...
| |
| | <asp:BoundFie ld DataField="NTAc count" HeaderText="NT Account" />
| |
| | Protected Sub dvDetail_PreRen der(ByVal sender As Object, ByVal e As
| | EventArgs) Handles dvDetail.PreRen der
| | If Me.dvDetail.Cur rentMode = DetailsViewMode .Edit Then
| | CType(Me.dvDeta il.FindControl( "txtChangeActiv ityDate"),
TextBox).Text
| =
| | Now.ToShortDate String
| | End If
| | End Sub
| |
| | --
| | Thanks in advance,
| |
| | sck10
| |
| |
| |
|
|

Nov 19 '05 #4
Thanks Steven,

My issue is resolved.

sck10
"Steven Cheng[MSFT]" <st*****@online .microsoft.com> wrote in message
news:Sc******** ******@TK2MSFTN GXA02.phx.gbl.. .
Hi Sck10,

How are you doing on this issue? Does the suggestion in my last reply helps a little? If there're anything else we can help, please feel free to post
here. 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.)
--------------------
| X-Tomcat-ID: 135026330
| References: <eS************ *@TK2MSFTNGP09. phx.gbl>
| MIME-Version: 1.0
| Content-Type: text/plain
| Content-Transfer-Encoding: 7bit
| From: st*****@online. microsoft.com (Steven Cheng[MSFT])
| Organization: Microsoft
| Date: Fri, 04 Nov 2005 07:50:30 GMT
| Subject: RE: Use FindControl to find DetailsView BoundField control (vb)
| X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet
| Message-ID: <PL************ **@TK2MSFTNGXA0 1.phx.gbl>
| Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet
| Lines: 88
| Path: TK2MSFTNGXA01.p hx.gbl
| Xref: TK2MSFTNGXA01.p hx.gbl
microsoft.publi c.dotnet.framew ork.aspnet:1360 52
| NNTP-Posting-Host: TOMCATIMPORT1 10.201.218.122
|
| Hi Sck10,
|
| welcome to ASP.NET newsgroup.
| Regarding on the accesing BoundField nested controls in DetailsView
| control, since it is autogenerated by runtime and will assign a random id | according to the item index, we can not use FindControl method to locate
| the nested control instance. And yes, you'r right, we need to use the
| PreRender event since at that time , we can ensure that the Control has
| been created and assigned the proper value. For example, when we need to
| access the TextBox in BoundField for Edit mode, we can use the following
| code in DetailsView's PreRender event:
|
| =============== =======
| Protected Sub DetailsView1_Pr eRender(ByVal sender As Object, ByVal e As
| System.EventArg s) Handles DetailsView1.Pr eRender
| For Each dvr As DetailsViewRow In DetailsView1.Ro ws
| If dvr.Cells.Count = 2 Then
| If dvr.Cells(1).Co ntrols.Count > 0 Then
| Dim txt As TextBox
| txt = dvr.Cells(1).Co ntrols(0)
| Response.Write( "<br>ID: " & txt.ID)
| Response.Write( "<br>Text: " & txt.Text)
| End If
| End If
| Next
| End Sub
| =============== =========
|
| Also, for such scenario that we need to extract Text value or reference
the
| nested controls, I'd prefer using TemplateFields since that'll provide us | more control on control's properties definition such as ID.....
|
| In addition, when the binded datasource has large column set, the
control's
| controls structure may get very complex, I suggest you try turning on the | Page's Page level Trace which will display the Page's Control Tree, then
we
| can get a clear view of the Page and its sub controls control structure.
| This can help us easily locate the nested controls throug index...
|
| Hope helps. 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.)
|
|
|
| --------------------
| | From: "sck10" <sc***@online.n ospam>
| | Subject: Use FindControl to find DetailsView BoundField control (vb)
| | Date: Thu, 3 Nov 2005 13:35:30 -0600
| | Lines: 25
| | X-Priority: 3
| | X-MSMail-Priority: Normal
| | X-Newsreader: Microsoft Outlook Express 6.00.2800.1506
| | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1506
| | Message-ID: <eS************ *@TK2MSFTNGP09. phx.gbl>
| | Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet
| | NNTP-Posting-Host: 189.202.185.135 .in-addr.arpa 135.185.202.189
| | Path: TK2MSFTNGXA01.p hx.gbl!TK2MSFTN GP08.phx.gbl!TK 2MSFTNGP09.phx. gbl
| | Xref: TK2MSFTNGXA01.p hx.gbl
| microsoft.publi c.dotnet.framew ork.aspnet:1358 91
| | X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet
| |
| | Hello,
| |
| | I am using the code below to set the values of a DetailsView template
| field
| | using FindControl. My question is how would you find a control if its a | | Boundfield control?
| |
| | For example, how would I reference the following BoundField
("NTAccount" )
| in
| | the Sub dvDetail_PreRen der sub? Any help would be appreciated...
| |
| | <asp:BoundFie ld DataField="NTAc count" HeaderText="NT Account" />
| |
| | Protected Sub dvDetail_PreRen der(ByVal sender As Object, ByVal e As
| | EventArgs) Handles dvDetail.PreRen der
| | If Me.dvDetail.Cur rentMode = DetailsViewMode .Edit Then
| | CType(Me.dvDeta il.FindControl( "txtChangeActiv ityDate"),
TextBox).Text
| =
| | Now.ToShortDate String
| | End If
| | End Sub
| |
| | --
| | Thanks in advance,
| |
| | sck10
| |
| |
| |
|
|

Nov 19 '05 #5
Thanks for your followup Sck10,

Please feel free to post here when you need our assistance.
Good luck!

Steven Cheng
Microsoft Online Support

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

--------------------
| From: "sck10" <sc***@online.n ospam>
| References: <eS************ *@TK2MSFTNGP09. phx.gbl>
<PL************ **@TK2MSFTNGXA0 1.phx.gbl>
<Sc************ **@TK2MSFTNGXA0 2.phx.gbl>
| Subject: Re: Use FindControl to find DetailsView BoundField control (vb)
| Date: Wed, 9 Nov 2005 14:34:11 -0600
| Lines: 150
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1506
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1506
| Message-ID: <#e************ *@TK2MSFTNGP11. phx.gbl>
| Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet
| NNTP-Posting-Host: 189.202.185.135 .in-addr.arpa 135.185.202.189
| Path: TK2MSFTNGXA02.p hx.gbl!TK2MSFTN GP08.phx.gbl!TK 2MSFTNGP11.phx. gbl
| Xref: TK2MSFTNGXA02.p hx.gbl
microsoft.publi c.dotnet.framew ork.aspnet:3567 90
| X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet
|
| Thanks Steven,
|
| My issue is resolved.
|
| sck10
|
|
| "Steven Cheng[MSFT]" <st*****@online .microsoft.com> wrote in message
| news:Sc******** ******@TK2MSFTN GXA02.phx.gbl.. .
| > Hi Sck10,
| >
| > How are you doing on this issue? Does the suggestion in my last reply
| helps
| > a little? If there're anything else we can help, please feel free to
post
| > here. 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.)
| > --------------------
| > | X-Tomcat-ID: 135026330
| > | References: <eS************ *@TK2MSFTNGP09. phx.gbl>
| > | MIME-Version: 1.0
| > | Content-Type: text/plain
| > | Content-Transfer-Encoding: 7bit
| > | From: st*****@online. microsoft.com (Steven Cheng[MSFT])
| > | Organization: Microsoft
| > | Date: Fri, 04 Nov 2005 07:50:30 GMT
| > | Subject: RE: Use FindControl to find DetailsView BoundField control
(vb)
| > | X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet
| > | Message-ID: <PL************ **@TK2MSFTNGXA0 1.phx.gbl>
| > | Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet
| > | Lines: 88
| > | Path: TK2MSFTNGXA01.p hx.gbl
| > | Xref: TK2MSFTNGXA01.p hx.gbl
| > microsoft.publi c.dotnet.framew ork.aspnet:1360 52
| > | NNTP-Posting-Host: TOMCATIMPORT1 10.201.218.122
| > |
| > | Hi Sck10,
| > |
| > | welcome to ASP.NET newsgroup.
| > | Regarding on the accesing BoundField nested controls in DetailsView
| > | control, since it is autogenerated by runtime and will assign a random
| id
| > | according to the item index, we can not use FindControl method to
locate
| > | the nested control instance. And yes, you'r right, we need to use the
| > | PreRender event since at that time , we can ensure that the Control
has
| > | been created and assigned the proper value. For example, when we need
to
| > | access the TextBox in BoundField for Edit mode, we can use the
following
| > | code in DetailsView's PreRender event:
| > |
| > | =============== =======
| > | Protected Sub DetailsView1_Pr eRender(ByVal sender As Object, ByVal e
As
| > | System.EventArg s) Handles DetailsView1.Pr eRender
| > | For Each dvr As DetailsViewRow In DetailsView1.Ro ws
| > | If dvr.Cells.Count = 2 Then
| > | If dvr.Cells(1).Co ntrols.Count > 0 Then
| > | Dim txt As TextBox
| > | txt = dvr.Cells(1).Co ntrols(0)
| > | Response.Write( "<br>ID: " & txt.ID)
| > | Response.Write( "<br>Text: " & txt.Text)
| > | End If
| > | End If
| > | Next
| > | End Sub
| > | =============== =========
| > |
| > | Also, for such scenario that we need to extract Text value or
reference
| > the
| > | nested controls, I'd prefer using TemplateFields since that'll provide
| us
| > | more control on control's properties definition such as ID.....
| > |
| > | In addition, when the binded datasource has large column set, the
| > control's
| > | controls structure may get very complex, I suggest you try turning on
| the
| > | Page's Page level Trace which will display the Page's Control Tree,
then
| > we
| > | can get a clear view of the Page and its sub controls control
structure.
| > | This can help us easily locate the nested controls throug index...
| > |
| > | Hope helps. 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.)
| > |
| > |
| > |
| > | --------------------
| > | | From: "sck10" <sc***@online.n ospam>
| > | | Subject: Use FindControl to find DetailsView BoundField control (vb)
| > | | Date: Thu, 3 Nov 2005 13:35:30 -0600
| > | | Lines: 25
| > | | X-Priority: 3
| > | | X-MSMail-Priority: Normal
| > | | X-Newsreader: Microsoft Outlook Express 6.00.2800.1506
| > | | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1506
| > | | Message-ID: <eS************ *@TK2MSFTNGP09. phx.gbl>
| > | | Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet
| > | | NNTP-Posting-Host: 189.202.185.135 .in-addr.arpa 135.185.202.189
| > | | Path:
TK2MSFTNGXA01.p hx.gbl!TK2MSFTN GP08.phx.gbl!TK 2MSFTNGP09.phx. gbl
| > | | Xref: TK2MSFTNGXA01.p hx.gbl
| > | microsoft.publi c.dotnet.framew ork.aspnet:1358 91
| > | | X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet
| > | |
| > | | Hello,
| > | |
| > | | I am using the code below to set the values of a DetailsView
template
| > | field
| > | | using FindControl. My question is how would you find a control if
its
| a
| > | | Boundfield control?
| > | |
| > | | For example, how would I reference the following BoundField
| > ("NTAccount" )
| > | in
| > | | the Sub dvDetail_PreRen der sub? Any help would be appreciated...
| > | |
| > | | <asp:BoundFie ld DataField="NTAc count" HeaderText="NT Account" />
| > | |
| > | | Protected Sub dvDetail_PreRen der(ByVal sender As Object, ByVal e As
| > | | EventArgs) Handles dvDetail.PreRen der
| > | | If Me.dvDetail.Cur rentMode = DetailsViewMode .Edit Then
| > | | CType(Me.dvDeta il.FindControl( "txtChangeActiv ityDate"),
| > TextBox).Text
| > | =
| > | | Now.ToShortDate String
| > | | End If
| > | | End Sub
| > | |
| > | | --
| > | | Thanks in advance,
| > | |
| > | | sck10
| > | |
| > | |
| > | |
| > |
| > |
| >
|
|
|

Nov 19 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
4439
by: sck10 | last post by:
Hello, I am trying to change a value when a user goes into edit mode on a DetailsView control. I am trying to use the following, but can not figure out how to get to the bound field ("MyBoundField") to set its new value. Any help with this would be appreciated. Sub EmployeeDetailView_ModeChanged(ByVal sender As Object, ByVal e As EventArgs) Select Case CustomerDetailView.CurrentMode
3
19344
by: Martin | last post by:
Hi, I have a very frustrating problem that I have researched for countless hours to no avail. There are many posts asking very similar things, however none usefull in my situation. I am using VS 2005 (ASP 2.0) and VB .NET. I have a page with a datalist, a gridview and then other data controls, nested in that order. This all works great, and produces a nice looking page, but I cannot for the life of me figure out how to reference
3
14588
by: Jason | last post by:
Anyone know how to make the text wrap in a text box of a DetailsView?
7
5425
by: studio60podcast | last post by:
I have a gridview and a details view in a page. The two are hooked up, so that when a row is selected in the GridView, the DetailsView displays the details. But, what I'm trying to accomplish is this: I have two tables - user and item. user table: user_id int user_name varchar(50) item table:
2
2200
by: Ben | last post by:
Hi, In the code-behind, i can refer to the dropdownlist defined in the aspx file with this (e.g.) dropdownlist1.sekectedvalue = ... but why can i not refer to the label defined in the TemplateField in the same aspx file like below? This gives the error: "can't find control 'mylabel' ": mylabel.text="ok"
0
1687
by: le0 | last post by:
Guys, I create a simple insertion in a database using DetailsView control, when i run this page and try to insert some data, the browser returns an error like this --------------------------------------------------------------------------------------------------------------- Server Error in '/Document' Application.
0
1172
by: ButlerDJIAM | last post by:
I have pasted code I have in an ASPx page and I want to know how to make it not display a field that is empty. There does not seem to be anything online (MSDN) that explains it. Usually the alt phone number would be empty and I do not want it displayed Any suggestions would be appreciated. <asp:DetailsView ID="DetailsView1" runat="server" AllowPaging="True" AutoGenerateRows="False"
2
5039
by: David Lozzi | last post by:
Howdy, I have a DetailsView that when I fire the UpdateItem event, it doesn't update the data. The page reloads and the data is set back to the original. I'm using a Button to fire the UpdateItem event and then leaves the user a status stating that the event is updated, which does occur so i know the button is firing properly. I haven't tried InsertItem yet, going to set that up now. Any ideas why this is happening? My code is below. ...
1
1784
by: pekbob1 | last post by:
Hi Everybody I have the error (ObjectDataSource 'ObjectDataSource1' could not find a non-generic method 'UpdatePre' that has parameters: Comp, Job_Number, Request_Date, Customer, Contact_Name, Tel, Email, Media, Job_Size, Colors, Number_of_Lots, Proof, Job_Detail, PrepressID) when I tried to update the values in my dataset. (before I had the problem to Insert and Delete and I changed OldValuesParameterFormatString="original_{0}" to...
0
9589
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10049
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9997
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7413
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6675
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5309
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3965
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3565
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.