<asp:UpdatePanel runat="server"><ContentTemplate> <telerik:RadGrid ID="RadGrid1" runat="server" ShowStatusBar="true" Skin="Outlook" AutoGenerateColumns="False" PageSize="12" AllowSorting="True" AllowMultiRowSelection="False" AllowPaging="True" OnNeedDataSource="RadGrid1_NeedDataSource" OnItemCommand="RadGrid1_ItemCommand" AllowFilteringByColumn="True"> <PagerStyle Mode="NextPrevAndNumeric"></PagerStyle> <ExportSettings IgnorePaging="true" OpenInNewWindow="true" ExportOnlyData="true"/> <ClientSettings> <Scrolling AllowScroll="true" UseStaticHeaders="false"/> </ClientSettings> <MasterTableView Width="100%" DataKeyNames="intID" AllowMultiColumnSorting="True" CommandItemDisplay="Top" CommandItemSettings-ShowExportToExcelButton="true" CommandItemSettings-ShowAddNewRecordButton="false" UseAllDataFields="true"> <Columns> <telerik:GridEditCommandColumn></telerik:GridEditCommandColumn> <telerik:GridButtonColumn CommandName="Delete" Text="Delete" UniqueName="column" /> <telerik:GridBoundColumn SortExpression="strSiteID" HeaderText="Location" HeaderButtonType="LinkButton" DataField="strSiteID"> </telerik:GridBoundColumn> <telerik:GridDateTimeColumn SortExpression="dtInvoiceDate" HeaderText="Invoice Date" HeaderButtonType="LinkButton" DataField="dtInvoiceDate" DataFormatString="{0:d}" PickerType="DatePicker" FilterControlWidth="100px" > </telerik:GridDateTimeColumn> <telerik:GridBoundColumn SortExpression="strInvoiceNo" HeaderText="Invoice" HeaderButtonType="LinkButton" DataField="strInvoiceNo"> </telerik:GridBoundColumn> <telerik:GridBoundColumn SortExpression="strItemNo" HeaderText="Part #" HeaderButtonType="LinkButton" DataField="strItemNo"> </telerik:GridBoundColumn> <telerik:GridBoundColumn SortExpression="intItemCount" HeaderText="QTY" HeaderButtonType="LinkButton" DataField="intItemCount"> </telerik:GridBoundColumn> <telerik:GridBoundColumn SortExpression="strCondition" HeaderText="Condition" HeaderButtonType="LinkButton" DataField="strCondition"> </telerik:GridBoundColumn> <telerik:GridBoundColumn SortExpression="strStatus" HeaderText="Status" HeaderButtonType="LinkButton" DataField="strStatus"> </telerik:GridBoundColumn> <telerik:GridBoundColumn SortExpression="strETA" HeaderText="ETA" HeaderButtonType="LinkButton" DataField="strETA"> </telerik:GridBoundColumn> <telerik:GridBoundColumn SortExpression="strBoxID" HeaderText="Box ID" HeaderButtonType="LinkButton" DataField="strBoxID"> </telerik:GridBoundColumn> </Columns> </MasterTableView> </telerik:RadGrid> </ContentTemplate></asp:UpdatePanel> <td> <div style="text-align: center"> <telerik:RadTextBox ID="RadTextBox1" runat="server" Style="border-style: solid; border-width: 8px; border-color: #e9e5d9; font-size: medium; border-radius: 3px 0px 0px 3px; font: bold 15px/10px 'lucida sans', 'trebuchet MS', 'Tahoma';" Height="48px" Width="470px" EmptyMessage="search here......"> </telerik:RadTextBox><asp:Button ID="btnSearch" runat="server" Style="overflow: visible; position: absolute; border: 0px none #d83c3c; padding: 0; cursor: pointer; height: 48px; width: 110px; font: bold 15px/0px 'lucida sans', 'trebuchet MS', 'Tahoma'; color: #fff; text-transform: uppercase; border-radius: 0px 3px 3px 0px; background-color: #d83c3c;" Text="SEARCH" /> </div> </td>I need to create some controls dynamically from code behind, and then, I need to add a JavaScript code to this control.. something like this:
Dim radTextbox As Telerik.Web.UI.RadTextBox
radTextbox = New Telerik.Web.UI.RadTextBox
radTextbox.TextMode = Telerik.Web.UI.InputMode.SingleLine
radTextbox.ID = drRow.item("CampoAlias") 'Name added dynamically
radTextbox.EnableViewState = False
radTextbox.Width = "200"
radTextbox.ClientEvents.OnValueChanged = "Titulo___onChange()" 'Function name added dynamically
Dim strString as string 'code will be added dynamically too
strString = "<script type='text/javascript'>"
strString +=" function Titulo___onChange() { alert(' Hello!!!'); }"
strString +="</script>"
//here I have to add the javascript code to the page… how???? I don’t now!!!
// how can I be sure the postback will work very well too.
Other option I tested and It didn’t work out:
------------------------------------------------------------------
I need to create some controls dynamically from code behind, and then, I need to add a JavaScript code to this control.. something like this:
Dim radTextbox As Telerik.Web.UI.RadTextBox
radTextbox = New Telerik.Web.UI.RadTextBox
radTextbox.TextMode = Telerik.Web.UI.InputMode.SingleLine
radTextbox.ID = drRow.item("CampoAlias") 'Name added dynamically
radTextbox.EnableViewState = False
radTextbox.Width = "200"
radTextbox.ClientEvents.OnValueChanged = "Titulo___onChange()" 'Function name added dynamically
Dim scriptText As String = ""
scriptText = "function Titulo___onChange(){"
scriptText += " alert(' Hello '); "
scriptText += " }"
ClientScript.RegisterClientScriptBlock(Me.GetType(), "CounterScript", scriptText, True)
‘The first execution work out well, but in the postback send a error: “Microsoft JScript runtime error: Object expected”

SO THAT unhandeled (system) exceptions get automatically logged to ELMAH table and System Error page is displayed when an such exception occurs.
Can anybody give solution for this?