or
Hi,
I can't seem to reference my textbox from my javascript.
on the aspx:
| <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="True" EnablePageMethods="True"> |
| <Scripts> |
| <asp:ScriptReference Path="scripts.js" /> |
| </Scripts> |
| </asp:ScriptManager> |
| <table cellpadding="0" cellspacing="0"> |
| <tr> |
| <td width="80%"> |
| <%-- <asp:textbox runat="server" TextMode="MultiLine" id="txt" style="WIDTH: 690px; HEIGHT: 260px" rows="16" Columns="79" ></asp:textbox> |
| --%> <telerik:RadTextBox ID="txt" Width="690" Height="260" Rows = "16" Columns = "79" runat="server" TextMode="MultiLine" SelectionOnFocus="CaretToEnd"></telerik:RadTextBox><br /> |
| <asp:TextBox id="txtMsg" Width="400" Runat="server"></asp:TextBox> <input id="btn" onclick="button_clicked()" type="button" value="SEND" class="btn"/> |
| </td> |
| function button_clicked() |
| { |
| var RadTextBox = $find("<%= txt.ClientID %>"); |
| if (RadTextBox == null) { |
| var b = bla; |
| } |
| PageMethods.SendMessage($get("txtMsg").value,$get("hdnRoomID").value,UpdateMessages, errorCallback); |
| $get("txtMsg").value=""; |
| $get("txt").scrollIntoView("true"); |
| } |
| <script type="text/javascript"> |
| function test() { |
| alert("hello"); |
| } |
| </script> |
| <telerik:RadEditor ID="RadEditor1" runat="server" OnClientPasteHtml="test"> |
| <Content> |
| </Content> |
| </telerik:RadEditor> |
| myStringScript = "<script type=""text/javascript"">" & vbCrLf & _ | |
| "<!--" & vbCrLf & _ | |
| String.Concat("var CheckBoxIDs = new Array(", String.Join(",", ArrayValuesAttend.ToArray()), ");") & vbCrLf & _ | |
| "// -->" & vbCrLf & _ | |
| "</script>" |
CheckBoxIDsArrayAttend.Text = myStringScript
(CheckBoxIDsArrayAttend is a literal control, and is also being updated by the ajax manager.)
-------------------------
TryCast(RadCodeBlock1.Controls(0), LiteralControl).Text = myStringScript
--------------------------
Page.ClientScript.RegisterStartupScript(Page.GetType(), "scr", myStringScript)
-------------------------------
None of these work. The Javascript just does not show up on the page after update (I can look for it when I view source on the page)
Any Ideas?
Thanks for your help.
| <MasterTableView> |
| ... |
| <ExpandCollapseColumn Visible="false" Display="false" /> |
| ... |
| </MasterTableView> |
| protected void Roles_PreRender( object sender, EventArgs e ) |
| { |
| (RoleGrid.MasterTableView.GetColumn( "ExpandColumn" ) as GridExpandColumn).Visible = false; |
| RoleGrid.MasterTableView.Columns[0].Visible = false; |
| } |
| protected void RoleGrid_ItemCreated( object sender, GridItemEventArgs e ) |
| { |
| if( e.Item is GridDataItem ) |
| { |
| (e.Item as GridDataItem)["ExpandColumn"].Visible = false; |
| } |
| } |