473,386 Members | 1,752 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

how can i access to the WebControlls in a FormView's template?

i have several textBox and a popCalendar in a FormView ,i want to let users
select date through the popCalendar and then the textbox get the selected
datetime,my codes like this:
Protected Sub PopCalendar1_SelectionChanged(ByVal sender As Object,
ByVal e As System.EventArgs)
textBox1.text = popCalendar1.date
End Sub

but i got the msg as: Name 'textBox1' is not declared. Name 'popCalendar1'
is not declared.

how can i do ???
regards!
Nov 19 '05 #1
2 1076
You can call FindControl("textBox1") on your FormView control.

-Brock
DevelopMentor
http://staff.develop.com/ballen
i have several textBox and a popCalendar in a FormView ,i want to let
users
select date through the popCalendar and then the textbox get the
selected
datetime,my codes like this:
Protected Sub PopCalendar1_SelectionChanged(ByVal sender As
Object,
ByVal e As System.EventArgs)
textBox1.text = popCalendar1.date
End Sub
but i got the msg as: Name 'textBox1' is not declared. Name
'popCalendar1' is not declared.

how can i do ???
regards!


Nov 19 '05 #2
thanks for your reply.
i used the codes like below:
Dim tb1 As TextBox = FormView1.FindControl("textBox1")
Dim pc1 As RJS.Web.WebControl.PopCalendar =
FormView1.FindControl("popCalendar1")
tb1.Text =pc1.DateValue.ToString
it works! Is there any better way ?
"Brock Allen" wrote:
You can call FindControl("textBox1") on your FormView control.

-Brock
DevelopMentor
http://staff.develop.com/ballen
i have several textBox and a popCalendar in a FormView ,i want to let
users
select date through the popCalendar and then the textbox get the
selected
datetime,my codes like this:
Protected Sub PopCalendar1_SelectionChanged(ByVal sender As
Object,
ByVal e As System.EventArgs)
textBox1.text = popCalendar1.date
End Sub
but i got the msg as: Name 'textBox1' is not declared. Name
'popCalendar1' is not declared.

how can i do ???
regards!


Nov 19 '05 #3

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

Similar topics

2
by: sck10 | last post by:
Hello, I just started learning about the formview control in asp.net 2.0. I am using the following. The problem I am having is that the data is not showing on the web. <form id="form1"...
2
by: P. Yanzick | last post by:
Hello, I am creating an edit template for a FormView control, changing one of the textboxes to a dropdown box. The dropdown will be populated from a simple table with the primary key, and a...
1
by: scartin | last post by:
I'm fairly new to working with ASP web controls, and am running into what seems to be a ridiculous problem that I'm hoping will be a breeze for an experienced ASP developer. I have a GridView...
2
by: Ned Balzer | last post by:
I'm trying to create a formview bound to a sqldatasource, and use a stored procedure to insert data from the formview into several tables. I have some simplified code below, the real code is much...
2
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
by: nicomp | last post by:
Hello, I have a FormView control that has a CheckBoxList in the Item template... I wrote this code to access a CheckBoxList in a FormView template... dim foo as checkboxlist foo = ...
0
by: namewitheldbyrequest | last post by:
Hello, I have a FormView control that has a CheckBoxList in the Item template... I wrote this code to access a CheckBoxList in a FormView template... dim foo as checkboxlist foo = ...
1
by: SteveT | last post by:
Before I pull out what little hair I have left, I'm swallowing my pride and asking the Oracles of .Net: I'm trying to set a property in a dropdown list control in a FormView, based on a session...
1
by: mans | last post by:
Hello, I want to enable the edit template in a FormView from program. How can I do this? The FormView bound to a table and I don't want that it do the edit/add/delete but I control when it...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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...

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.