473,479 Members | 2,117 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Formview FindControl conversion to c#

Hello,

I am trying to get the value of a control in a FormView. In vb, I would use
the following:

e.NewValues("ServiceIdeaQ01") =
CType(this.fvServiceIdea.FindControl("lblServiceId eaQ01Edit"), Label).Text

For c#, what I have found on the web is the following:

Label ServiceIdeaQ01Label =
(Label)this.fvServiceIdea.Row.FindControl("lblServ iceIdeaQ02Item");
e.NewValues("ServiceIdeaQ01") = ServiceIdeaQ01Label.Text;

Is there a way in c# to do the same thing with one line? For some reason, I
can't get the "Text" argument:

(Label)this.fvServiceIdea.Row.FindControl("lblServ iceIdeaQ02Item").Text;

Thanks, sck10

Aug 28 '06 #1
2 1943
"sck10" <sc***@online.nospamwrote in message
news:es**************@TK2MSFTNGP04.phx.gbl...
Is there a way in c# to do the same thing with one line? For some reason,
I can't get the "Text" argument:

(Label)this.fvServiceIdea.Row.FindControl("lblServ iceIdeaQ02Item").Text;
((Label)this.fvServiceIdea.Row.FindControl("lblSer viceIdeaQ02Item")).Text;
Aug 28 '06 #2
Thanks Mark Rae...

"Mark Rae" <ma**@markNOSPAMrae.comwrote in message
news:%2****************@TK2MSFTNGP04.phx.gbl...
"sck10" <sc***@online.nospamwrote in message
news:es**************@TK2MSFTNGP04.phx.gbl...
>Is there a way in c# to do the same thing with one line? For some
reason, I can't get the "Text" argument:

(Label)this.fvServiceIdea.Row.FindControl("lblSer viceIdeaQ02Item").Text;

((Label)this.fvServiceIdea.Row.FindControl("lblSer viceIdeaQ02Item")).Text;


Aug 28 '06 #3

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

Similar topics

8
6150
by: Ottar | last post by:
I have a few numeric fields, and when I update i get the error: "Input string was not in a correct format". Next line:" System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer&...
2
8627
by: wikkiwikkiwaa | last post by:
hello, i am trying to access controls inside my formview1 nested inside loginview1. you cannot access the formview1 unless you are properly logged in. for loginview1, that seems to be fairly...
3
3732
by: Phillip Vong | last post by:
Using VS2005 w/ simple aspx in VB.net I have a simple databound textbox "LastMtgText" in a formview in the Insert template. All I want to do is make the default date of today when someone goes...
1
3200
by: Paul | last post by:
Hello: I have an aspx page with a Formview and a Gridview on it. I have a dropdownlist control which I want to bind to both the Formview and the Gridview. I put the dropdownlist in the...
3
4492
by: YMPN | last post by:
Hi Everyone, I'm deen from Riyadh. Please do help me with some problem i have. I have this formview control setup to recieved inputs from user (textbox, dropdownlist, others). After...
3
3615
by: J055 | last post by:
Hi I have a PlaceHolder control inside a FormView EditItemTemplate: <asp:PlaceHolder ID="phResponseText" runat="server"> <tr> <td> <asp:Label ID="lblResponseText"...
1
4325
by: Trev | last post by:
Hi, I'm hoping that someone in this group can shed some light on an issue I'm having with a Formview. I have a Web User Control (.ascx) with a Formview. The Formview contains 2 Multiviews,...
3
5384
by: J055 | last post by:
Hi I can't figure out what the difference is here. Sometimes I have a simple FormView control in a page and I can use the FormView.FindControl method to get a Label or TextBox with in it during...
4
8530
by: pankajsingh5k | last post by:
Hi guys, These question is for all the experts... Please help me before my brain explodes The problem is again with the formview control.. I have a formview and i have to use it that...
0
7033
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,...
1
6726
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...
0
6861
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
4763
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...
0
4468
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...
0
2987
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...
0
1291
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 ...
1
557
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
170
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...

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.