By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,426 Members | 1,689 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,426 IT Pros & Developers. It's quick & easy.

ASP.NET control using Javascript

P: n/a
I have created a asp.net date picker control using Javascript. I wanted
to do this to avoid doing post back when the calendar window is
launched. It works like charm.

But the challenge is - the control does not use any asp.net controls
like button or textfield. It uses html "input" for the text field and
the button. So after the user has choosen the date and the date is
populated in the textfield, I am not able to get the value from the
textfield into my aspx page.

Can someone throw some light here? I cannot be using AJAX and
microsoft's ATLAS (similair to ajax) is not available until the end of
the year.

Help please. Thanks in advance.

Jun 1 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
If you want to send the text field to the server code behind without
ajax, you will have to do a postback to the server. in the designer u
need to right click the text field and go run as server control. to
grab the control I belive u can reference it directly...

if not then you can go

dim myInputBox as HtmlInputText

myInputBox = page.findcontrol("idOfInputBox")

then acces the value with myInputBox.value

hope that helps
kplkumar wrote:
I have created a asp.net date picker control using Javascript. I wanted
to do this to avoid doing post back when the calendar window is
launched. It works like charm.

But the challenge is - the control does not use any asp.net controls
like button or textfield. It uses html "input" for the text field and
the button. So after the user has choosen the date and the date is
populated in the textfield, I am not able to get the value from the
textfield into my aspx page.

Can someone throw some light here? I cannot be using AJAX and
microsoft's ATLAS (similair to ajax) is not available until the end of
the year.

Help please. Thanks in advance.


Jun 1 '06 #2

P: n/a
I thought I will put the code as well. This is my code inside the
asp.net control. I have left out the javascript.

<div class="body">
<input type="text" id="DateBox" name="dateText" size="15" />
<input type="image" src="Images/SmallCalendar.gif" name="imageBtn"
onclick="return showCalendar('DateBox', '%Y-%m-%d', '', false);" />
</div>

I need to get the value from "DateBox" into my ascx's property. Is that
possible? If not, any work around?? Thanks.

Jun 1 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.