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

Value Betweeen ascx and aspx!!

P: n/a
Ann
i have a usercontrol with a textbox "YearOfRefTextBox" ..now after
registering the usercontrol in aspx,i need to get the value of textbox in
aspx thru javascript..

i did like this..but getting null value...

<%@ Register TagPrefix="Usr" TagName="ISANCommonCtrls" Src="~/User
Controls/ISANCommonCtrls.ascx"%>

<Usr:ISANCommonCtrls ID="UsrCtrlForISANID" runat="server" />
and
alert(document.forms[0]['UsrCtrlForISANID:YearOfRefTextBox'].item)
pls tell me,what i am doing wrong..

Thnks
Ann

Sep 27 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
I would add a property on the user ctl to what you're trying to access,
i.e. TextBox.text, then in js call the instance->property
<%= UserCtlInstance.Property %>
Ann wrote:
i have a usercontrol with a textbox "YearOfRefTextBox" ..now after
registering the usercontrol in aspx,i need to get the value of textbox in
aspx thru javascript..

i did like this..but getting null value...

<%@ Register TagPrefix="Usr" TagName="ISANCommonCtrls" Src="~/User
Controls/ISANCommonCtrls.ascx"%>

<Usr:ISANCommonCtrls ID="UsrCtrlForISANID" runat="server" />
and
alert(document.forms[0]['UsrCtrlForISANID:YearOfRefTextBox'].item)
pls tell me,what i am doing wrong..

Thnks
Ann
Oct 2 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.