<%
@ Control Language="C#" AutoEventWireup="true" CodeFile="test.ascx.cs" Inherits="test" %>
<%
@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<
telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
<
script type="text/javascript">
function clientShow(sender, eventArgs)
{
var textbox2 = (document.getElementById("<%=TextBox2.ClientID %>"));
textbox2.focus();
var textbox1 = (document.getElementById('<%=FormView1.FindControl("TextBox1").ClientID %>')).value;
(document.getElementById(
"<%=TextBox2.ClientID %>")).value = textbox1;
}
function clientShow1(sender, eventArgs)
{
var textbox20 = (document.getElementById("<%=TextBox4.ClientID %>"));
textbox20.focus();
var textbox10 = (document.getElementById('<%=FormView1.FindControl("TextBox3").ClientID %>')).value;
(document.getElementById(
"<%=TextBox4.ClientID %>")).value = textbox10;
}
function PopTB()
{
var textbox2 = (document.getElementById("<%=TextBox2.ClientID %>")).value;
(document.getElementById(
'<%=FormView1.FindControl("TextBox1").ClientID %>')).value = textbox2;
// var tooltip1 = $find("RadToolTip1");
var tooltip1 = $find("<%=RadToolTip1.ClientID%>");
tooltip1.hide();
}
function PopTB1()
{
var textbox3 = (document.getElementById("<%=TextBox4.ClientID %>")).value;
(document.getElementById(
'<%=FormView1.FindControl("TextBox3").ClientID %>')).value = textbox3;
var tooltip2 = $find("<%=RadToolTip2.ClientID%>");
tooltip2.hide();
}
</
script>
</
telerik:RadCodeBlock>
<asp:ScriptManager ID="ScriptManager1" runat="server" />
<div>
<telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" Height="200px"
Width="300px">
<asp:FormView ID="FormView1" runat="server" DefaultMode="Edit" DataSourceID="SqlDataSource1" OnPageIndexChanging="FormView1_PageIndexChanging">
<InsertItemTemplate>
<asp:TextBox ID="TextBox1" Text="This is my text" runat="server" Height="75px" TextMode="MultiLine" Width="372px" ></asp:TextBox>
<br />
<br />
<asp:TextBox ID="TextBox3" runat="server" Height="75px" Text="This is my second text"
TextMode="MultiLine" Width="372px"></asp:TextBox><br />
<asp:Button ID="Button3" runat="server" CommandName="Insert" Text="insert" />
<asp:Button ID="Button4" runat="server" CommandName="Cancel" Text="Cancel" /><br />
</InsertItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="TextBox1" runat="server" Height="75px" Text='<%# Bind("CODE") %>'
TextMode="MultiLine" Width="372px"></asp:TextBox><br />
<asp:TextBox ID="TextBox3" runat="server"
Height="75px" Text='<%# Bind("MESSAGE") %>' TextMode="MultiLine" Width="372px"></asp:TextBox><asp:Button
ID="Button3" runat="server" CommandName="Update" Text="Save" /><asp:Button ID="Button4"
runat="server" CommandName="Cancel" Text="Cancel" />
</EditItemTemplate>
</asp:FormView>
</telerik:RadAjaxPanel>
<br />
<br />
<br />
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ATR2_DELETEConnectionString %>"
DeleteCommand="DELETE FROM [ErrorCumulative] WHERE [Record_Id] = @Record_Id"
InsertCommand="INSERT INTO [ErrorCumulative] ([CODE], [MESSAGE]) VALUES (@CODE, @MESSAGE)"
SelectCommand="SELECT [Record_Id], [CODE], [MESSAGE] FROM [ErrorCumulative]"
UpdateCommand="UPDATE [ErrorCumulative] SET [CODE] = @CODE, [MESSAGE] = @MESSAGE WHERE [Record_Id] = @Record_Id">
<DeleteParameters>
<asp:Parameter Name="Record_Id" Type="Int32" />
</DeleteParameters>
<UpdateParameters>
<asp:Parameter Name="CODE" Type="String" />
<asp:Parameter Name="MESSAGE" Type="String" />
<asp:Parameter DefaultValue="1" Name="Record_Id" Type="Int32" />
</UpdateParameters>
<InsertParameters>
<asp:Parameter Name="CODE" Type="String" />
<asp:Parameter Name="MESSAGE" Type="String" />
</InsertParameters>
</asp:SqlDataSource>
<telerik:RadToolTip ID="RadToolTip1" runat="server" Animation="Resize" Height="300px"
ManualClose="True" OnClientShow="clientShow" RelativeTo="Element" ShowEvent="OnClick"
Skin="Web20" TargetControlID="TextBox1" Width="557px">
<asp:TextBox ID="TextBox2" runat="server" Height="265px" TextMode="MultiLine" Width="550px"></asp:TextBox>
<asp:Button ID="Button1" runat="server" OnClientClick="PopTB(); return false;" Text="Insert" /></telerik:RadToolTip>
<br />
<br />
<telerik:RadToolTip ID="RadToolTip2" runat="server" Animation="Resize" Height="300px"
ManualClose="True" OnClientShow="clientShow1" RelativeTo="Element" ShowEvent="OnClick"
Skin="Web20" TargetControlID="TextBox3" Width="557px">
<asp:TextBox ID="TextBox4" runat="server" Height="265px" TextMode="MultiLine" Width="550px"></asp:TextBox>
<asp:Button ID="Button2" runat="server" OnClientClick="PopTB1(); return false;" Text="Insert" /></telerik:RadToolTip>
<br />
<br />
<br />
<br />
</div>
This is my code:
// Page.ClientScript.RegisterClientScriptBlock(Page.GetType(), "",
//"<script type=\"text/javascript\">function OnClientCommandExecute(editor, args){var name = args.get_name();var val = args.get_value();if (name == \"Emoticons\"){editor.pasteHtml(\"<img src='\" + val + \"'>\");args.set_cancel(true);}");
//Page.ClientScript.RegisterClientScriptBlock(Page.GetType(), "smile",
// " <script type=\"text/javascript\">" +
// " //<![CDATA[" +
// " Telerik.Web.UI.Editor.CommandList[\"InsertEmoticon\"] = function(commandName, editor, args)" +
// " {" +
// " var myCallbackFunction = function(sender, args)" +
// " {" +
// " editor.pasteHtml(String.format(\"<img src='{0}' border='0' align='middle' alt='emoticon' /> \", args.image));" +
// " }" +
// " editor.showDialog(\"InsertEmoticon\", {}, myCallbackFunction);" +
// " };" +
// " //]]>" +
// "</script>");
//main.Tools.Add(new EditorTool("InsertEmoticon"));
EditorDropDown x = new EditorDropDown("InsertEmoticon");
x.Items.Add(
new EditorDropDownItem("<IMG SRC='pages/emoticons/21.gif' />", "pages//emoticons/icon_wink.gif"));
main.Tools.Add(x);
DialogDefinition insertEmoticonDialogDefinition = new DialogDefinition("~/pages/InsertEmoticon.ascx", new DialogParameters());
insertEmoticonDialogDefinition.Modal =
true;
insertEmoticonDialogDefinition.VisibleTitlebar =
true;
insertEmoticonDialogDefinition.VisibleStatusbar =
true;
insertEmoticonDialogDefinition.Width =
Unit.Pixel(400);
insertEmoticonDialogDefinition.Height =
Unit.Pixel(245);
insertEmoticonDialogDefinition.VisibleStatusbar =
false;
insertEmoticonDialogDefinition.Title =
"Insert Smiley";
editor.AddDialogDefinition(
"InsertEmoticon", insertEmoticonDialogDefinition);
in this way i can see 1 image i now that there a better way in addition i don’t know how to catch the event of the click on the image
what i can do ?
| $find("<%= RadAjaxManager.GetCurrent(Page).ClientID %>").ajaxRequest("arg"); |
| protected void JS_Load(object source, EventArgs e) |
| { |
| Control container = ((Control)source).Parent; |
| string javascript = "<script language=\"javascript\" > " + |
| "\nfunction checkValues(source, clientside_arguments)" + |
| "\n { " + |
| "\n var returnval = false;" + |
| "\n var box1 = " + container.FindControl("dispRadNumericTextBox1").ClientID + ";" + |
| "\n var box2 = " + container.FindControl("dispRadNumericTextBox2").ClientID + ";" + |
| "\n var box3 = " + container.FindControl("dispRadNumericTextBox3").ClientID + ";" + |
| "\n var box4 = " + container.FindControl("dispRadNumericTextBox4").ClientID + ";" + |
| "\n var cert = " + container.FindControl("certAmt").ClientID + ";" + |
| "\n var total = 0; " + |
| "\n if (IsNumeric(box1) && " + container.FindControl("dispDatePicker1").ClientID + ".DateInput.InitialValue != '' )" + |
| "\n total += box1.InitialValue;" + |
| "\n if (IsNumeric(box2) && " + container.FindControl("dispDatePicker2").ClientID + ".DateInput.InitialValue != '' )" + |
| "\n total += box2.InitialValue; " + |
| "\n if (IsNumeric(box3) && " + container.FindControl("dispDatePicker3").ClientID + ".DateInput.InitialValue != '' )" + |
| "\n total += box3.InitialValue;" + |
| "\n if (IsNumeric(box4) && " + container.FindControl("dispDatePicker4").ClientID + ".DateInput.InitialValue != '' )" + |
| "\n total += box4.InitialValue; " + |
| "\n if (total == 0)" + |
| "\n returnval = true;" + |
| "\n else" + |
| "\n {" + |
| "\n if (total == cert.InitialValue)" + |
| "\n returnval = true;" + |
| "\n }" + |
| "\n clientside_arguments.IsValid = returnval;" + |
| "\n }" + |
| "\n function IsNumeric(strString)" + |
| "\n {" + |
| "\n var strValidChars = \"0123456789.-\";" + |
| "\n var strChar;" + |
| "\n var blnResult = true;" + |
| "\n if (strString.length == 0) return false;" + |
| "\n for (i = 0; i < strString.length && blnResult == true; i++) {" + |
| "\n strChar = strString.charAt(i);" + |
| "\n if (strValidChars.indexOf(strChar) == -1) {" + |
| "\n blnResult = false;" + |
| "\n }" + |
| "\n }" + |
| "\n return blnResult;" + |
| "\n }" + |
| "\n </script>"; |
| this.javascriptLiteral.Text = javascript; |
| } |
| <asp:CustomValidator ID="CustomValidator1" CssClass="errorMessage" runat="server" |
| ErrorMessage="Disbursement amounts do not equal Cert Amount" |
| ValidationGroup="cert" OnLoad="JS_Load" |
| Display="Dynamic" ClientValidationFunction="checkValues">nbsp;</asp:CustomValidator> |
| <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server"> |
| <asp:Literal ID="javascriptLiteral" runat="server"></asp:Literal> |
| </telerik:RadAjaxPanel> |
| <telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="server"> |
| <AjaxSettings> |
| <telerik:AjaxSetting AjaxControlID="RadGrid1"> |
| <UpdatedControls> |
| <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1" /> |
| <telerik:AjaxUpdatedControl ControlID="RadAjaxPanel1" /> |
| </UpdatedControls> |
| </telerik:AjaxSetting> |
| </AjaxSettings> |
| </telerik:RadAjaxManagerProxy> |