Hi,
It does not recognize the get_value method in my custom button object.
.aspx calling the user control
user control JPopup.cs
error :
SCRIPT5007: Unable to get value of the property 'get_value()': object is null or undefined.
How Can I use RadTextBox get_value method?
Thank you.
It does not recognize the get_value method in my custom button object.
.aspx calling the user control
...
<
telerik:RadTextBox
ID
=
"textBoxSearchItemCode"
ClientInstanceName
=
"textBoxSearchItemCode"
runat
=
"server"
Width
=
"90px"
CssClass
=
"inline"
>
</
telerik:RadTextBox
>
<
telerik:RadTextBox
ID
=
"textBoxSearchItemName"
ClientInstanceName
=
"textBoxSearchItemName"
runat
=
"server"
Width
=
"190px"
CssClass
=
"inline"
>
</
telerik:RadTextBox
>
<
cc1:JPopup ID
=
"popupItem"
runat
=
"server"
PopupType
=
"Item"
CodeControl
=
"textBoxSearchItemCode"
NameControl
=
"textBoxSearchItemName
"
OKScript
=
"Search();"
/>
...
user control JPopup.cs
namespace
My.Web.JControl.JPopup
{
[DefaultProperty(
"Text"
)]
[DefaultEvent(
"OK"
)]
[ToolboxData(
"<{0}:Popup runat=server></{0}:Popup>"
)]
public
class
JPopup : WebControl, IPostBackEventHandler
{
public
JPopup()
:
base
()
{
UseOKServerEvent =
false
;
OKScript =
""
;
CodeControl =
""
;
NameControl =
""
;
PopupControl =
""
;
PopupType = ePopupType.None;
Hidden =
false
;
}
#region Properties
/// <summary>
/// Use OKEvent
/// </summary>
[Bindable(
true
),
Category(
"Event"
)]
public
bool
UseOKServerEvent
{
get
{
return
(
bool
)ViewState[
"PopupUseOKServerEvent"
];
}
set
{
ViewState[
"PopupUseOKServerEvent"
] = value;
}
}
/// <summary>
/// OKEvent Handler for Javascript
/// </summary>
[Bindable(
true
)]
[Category(
"Event"
)]
[Editor(
typeof
(OKEventEditor),
typeof
(UITypeEditor))]
public
string
OKScript
{
get
{
return
(
string
)ViewState[
"PopupOKScript"
];
}
set
{
ViewState[
"PopupOKScript"
] = value;
}
}
#endregion
#region Binding Property
// column to editbox mapping
[Bindable(
true
),
DefaultValue(
""
),
Category(
"Binding"
)]
public
string
CodeControl
{
get
{
return
(
string
)ViewState[
"PopupCodeControl"
];
}
set
{
ViewState[
"PopupCodeControl"
] = value;
}
}
[Bindable(
true
),
DefaultValue(
""
),
Category(
"Binding"
)]
public
string
NameControl
{
get
{
return
(
string
)ViewState[
"PopupNameControl"
];
}
set
{
ViewState[
"PopupNameControl"
] = value;
}
}
// column to editbox mapping
[Bindable(
true
),
DefaultValue(
""
),
Category(
"Binding"
)]
public
string
PopupControl
{
get
{
return
(
string
)ViewState[
"PopupPopupControl"
];
}
set
{
ViewState[
"PopupPopupControl"
] = value;
}
}
[Bindable(
true
),
DefaultValue(
""
),
Category(
"Binding"
)]
public
string
Parameter
{
get
{
return
(
string
)ViewState[
"PopupParameter"
];
}
set
{
ViewState[
"PopupParameter"
] = value;
}
}
#endregion
#region PopupType Property
[Bindable(
true
)]
[Category(
"PopupType"
)]
[DefaultValue(ePopupType.None)]
public
ePopupType PopupType
{
get
{
return
(ePopupType)ViewState[
"PopupType"
];
}
set
{
ViewState[
"PopupType"
] = value;
}
}
[Bindable(
true
)]
[Category(
"PopupType"
)]
[DefaultValue(
false
)]
public
bool
Hidden
{
get
{
return
(
bool
)ViewState[
"PopupHidden"
];
}
set
{
ViewState[
"PopupHidden"
] = value;
}
}
public
enum
ePopupType { None, User, Customer, PoCustomer, Item, MoldItem, PowerChart };
#endregion
#region Render
/// <summary>
/// Render this control to the output parameter specified.
/// </summary>
/// <param name="output"> The HTML writer to write out to </param>
///
protected
override
void
RenderContents(HtmlTextWriter output)
{
StringBuilder sbRender =
new
StringBuilder();
// Design Mode
if
(
this
.DesignMode)
{
sbRender.Append(
"<div style=\"VERTICAL-ALIGN: bottom; DISPLAY:inline;POSITION:relative; \" onMouseOver = \"this.style.cursor = 'hand'\">"
);
sbRender.Append(
"<img id = \""
+ ID +
"\" name = \""
+ ID +
"\""
);
sbRender.Append(
string
.Format(
" src=\"/{0}/Images/Main/popup.gif\"/>"
, ConfigurationManager.AppSettings[
"WebSiteName"
]));
sbRender.Append(
"</div>"
);
output.Write(sbRender);
return
;
}
sbRender.Append(
"<script type='text/javascript'>"
);
sbRender.Append(
string
.Format(@"
function Popup_{0}()
{{
var popSearchCode = $find(
'<%= {1}.ClientID %>'
).get_value(); <<---- here!!!!
var popSearchName = $find(
'<%= {2}.ClientID %>'
).get_value();", ID, CodeControl, NameControl));
.......
error :
SCRIPT5007: Unable to get value of the property 'get_value()': object is null or undefined.
How Can I use RadTextBox get_value method?
Thank you.