473,403 Members | 2,359 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,403 software developers and data experts.

Accessing values of a control which is in a user control

<tr>
<td nowrap=nowrap >Start Date/Time</td>
<td =nowrap><zw:Calendar ID="calStart" runat=server DisplayTime=true
Mandatory=true ReadOnly=true />
</td>
<td nowrap=nowrap>Appointment Type</td>
<td><asp:DropDownList ID="ddlApptType" runat=server>
<asp:ListItem>Meeting</asp:ListItem>
<asp:ListItem>Conference</asp:ListItem>
<asp:ListItem>Personal</asp:ListItem>
<asp:ListItem>General</asp:ListItem>
</asp:DropDownList><asp:Label ID="Label1" runat=server Text="*"
ForeColor=red ></asp:Label>
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" Display="None"
runat="server" ControlToValidate="ddlApptType"
ErrorMessage="Please Select Appointment
Type"></asp:RequiredFieldValidator>

</td>

</tr>
<tr>
<td colspan=4 align=center><asp:button id="btnSave" runat="server"
text="Save" OnClick="btnSave_Click" /></td>
</tr>

In the calendar User control I have a property

private string dateTimeValue;
public string DateTimeValue
{
get
{
return txtCalendar.Text;
}
set
{
txtCalendar.Text = value;
}

}
Onclick of the Save button when I try to write like below

Response.Write(calStart.DateTimeValue);

Its showing as null. Could you please help me with what the problem may be.

Thanks in advance
Nov 2 '06 #1
1 1060
Your code looks okay, you might want to make the code for the usercontrol
available as well your problem may be coming from there
"Srini" <Sr***@discussions.microsoft.comwrote in message
news:39**********************************@microsof t.com...
<tr>
<td nowrap=nowrap >Start Date/Time</td>
<td =nowrap><zw:Calendar ID="calStart" runat=server DisplayTime=true
Mandatory=true ReadOnly=true />
</td>
<td nowrap=nowrap>Appointment Type</td>
<td><asp:DropDownList ID="ddlApptType" runat=server>
<asp:ListItem>Meeting</asp:ListItem>
<asp:ListItem>Conference</asp:ListItem>
<asp:ListItem>Personal</asp:ListItem>
<asp:ListItem>General</asp:ListItem>
</asp:DropDownList><asp:Label ID="Label1" runat=server Text="*"
ForeColor=red ></asp:Label>
<asp:RequiredFieldValidator ID="RequiredFieldValidator2"
Display="None"
runat="server" ControlToValidate="ddlApptType"
ErrorMessage="Please Select Appointment
Type"></asp:RequiredFieldValidator>

</td>

</tr>
<tr>
<td colspan=4 align=center><asp:button id="btnSave" runat="server"
text="Save" OnClick="btnSave_Click" /></td>
</tr>

In the calendar User control I have a property

private string dateTimeValue;
public string DateTimeValue
{
get
{
return txtCalendar.Text;
}
set
{
txtCalendar.Text = value;
}

}
Onclick of the Save button when I try to write like below

Response.Write(calStart.DateTimeValue);

Its showing as null. Could you please help me with what the problem may
be.

Thanks in advance


Nov 2 '06 #2

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

Similar topics

3
by: Tom Meuzelaar | last post by:
Hello: I'm using VB6 in VS enterprise. I'd like to place an HTML form inside a VB container, have a user fill out the form information, click a submit button, and then have the program capture...
3
by: Vivek Sharma | last post by:
Hi, I have created a dropdownlist as a web user control. I am using its multiple instances on the webpage. How do I access the selectedValue of each instance? All the instances have different...
1
by: Brian | last post by:
Thanks for your time. I've created a web user control that has some properties available. I'm able to add the control dynamically (at run time) with no problem(.controls.add(). Is it possible...
2
by: Brenden Bixler | last post by:
I have a user control, dropdown.ascx Inside dropdown.ascx, I have a dropdownlist control. From my page.aspx, I need to be able to access the dropdown's value. By setting it to auto-post...
0
by: aakash | last post by:
Hello Guys I am upsizing ms access project to give it a ms sql connectivity I am having problem in accessing form control values in ms sql function CREATE FUNCTION "ReportList DateRange"() ...
1
by: AndiSmith | last post by:
Hi guys, I wondered if anyone could help me with this problem, or even shed some light on the direction I need to take to resolve it? I'm using .NET 2.0 (C# flavor) to build a large user-based...
9
by: J055 | last post by:
Hi I have a standard asp page which uses a MasterPage. The MasterPage contains a User control. How can I access a public method in the User control from my WebForm page? I can't move the method...
4
by: =?Utf-8?B?R3JlZyBTdGV2ZW5z?= | last post by:
I have an ASP.NET page with a form that contains two user controls: <%@ Register TagPrefix="x" TagName="c1" Src="ctl1.ascx" %> <%@ Register TagPrefix="x" TagName="c2" Src="ctl2.ascx" %> <body>...
8
by: GaryDean | last post by:
I have a Wizard page and need to affect the next and previous buttons from my code-behind. I've googled around and found two solutions, and neither appear to work. I can access the SideBarList...
2
by: San24 | last post by:
Guys, Let me explain the application I have - Form > Main Tab Control > Main Tab Page > User Control > Sub Tab Control > Sub Tab Page > User Control > Contols/Text Box. Form - The main...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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
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...
0
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...

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.