Search Results

Search found 1381 results on 56 pages for 'bold'.

Page 7/56 | < Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >

  • Ajax Control Toolkit July 2011 Release and the New HTML Editor Extender

    - by Stephen Walther
    I’m happy to announce the July 2011 release of the Ajax Control Toolkit which includes important bug fixes and a completely new HTML Editor Extender control. You can download the July 2011 Release by visiting the Ajax Control Toolkit CodePlex site at: http://AjaxControlToolkit.CodePlex.com Using the New HTML Editor Extender Control You can use the new HTML Editor Extender to extend any standard ASP.NET TextBox control so that it supports rich formatting such as bold, italics, bulleted lists, numbered lists, typefaces and different foreground and background colors. The following code illustrates how you can extend a standard ASP.NET TextBox control with the HtmlEditorExtender: <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Simple.aspx.cs" Inherits="WebApplication1.Simple" %> <%@ Register TagPrefix="asp" Namespace="AjaxControlToolkit" Assembly="AjaxControlToolkit" %> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title>Simple</title> </head> <body> <form id="form1" runat="server"> <asp:ToolkitScriptManager runat="Server" /> <asp:TextBox ID="txtComments" TextMode="MultiLine" Columns="60" Rows="8" runat="server" /> <asp:HtmlEditorExtender TargetControlID="txtComments" runat="server" /> </form> </body> </html> This page has the following three controls: ToolkitScriptManager – The ToolkitScriptManager renders all of the scripts required by the Ajax Control Toolkit. TextBox – The TextBox control is a standard ASP.NET TextBox which is set to display multiple lines (a TextArea instead of an Input element). HtmlEditorExtender – The HtmlEditorExtender is set to extend the TextBox control. You can use the standard TextBox Text property to read the rich text entered into the TextBox control on the server. Lightweight and HTML5 The HTML Editor Extender works on all modern browsers including the most recent versions of Mozilla Firefox (Firefox 5), Google Chrome (Chrome 12), and Apple Safari (Safari 5). Furthermore, the HTML Editor Extender is compatible with Microsoft Internet Explorer 6 and newer. The HTML Editor Extender is very lightweight. It takes advantage of the HTML5 ContentEditable attribute so it does not require an iframe or complex browser workarounds. If you select View Source in your browser while using the HTML Editor Extender, we hope that you will be pleasantly surprised by how little markup and script is generated by the HTML Editor Extender. Customizable Toolbar Buttons Depending on the web application that you are building, you will want to display different toolbar buttons with the HTML Editor Extender. One of the design goals of the HTML Editor Extender was to make it very easy for you to customize the toolbar buttons. Imagine, for example, that you want to use the HTML Editor Extender when accepting comments on blog posts. In that case, you might want to restrict the type of formatting that a user can display. You might want to enable a user to format text as bold or italic but you do not want the user to make any other formatting changes. The following page illustrates how you can customize the HTML Editor Extender toolbar: <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="CustomToolbar.aspx.cs" Inherits="WebApplication1.CustomToolbar" %> <%@ Register TagPrefix="asp" Namespace="AjaxControlToolkit" Assembly="AjaxControlToolkit" %> <html> <head runat="server"> <title>Custom Toolbar</title> </head> <body> <form id="form1" runat="server"> <asp:ToolkitScriptManager Runat="server" /> <asp:TextBox ID="txtComments" TextMode="MultiLine" Columns="50" Rows="10" Text="Hello <b>world!</b>" Runat="server" /> <asp:HtmlEditorExtender TargetControlID="txtComments" runat="server"> <Toolbar> <asp:Bold /> <asp:Italic /> </Toolbar> </asp:HtmlEditorExtender> </form> </body> </html> Notice that the HTML Editor Extender in the page above has a Toolbar subtag. You can list the toolbar buttons which you want to appear within the subtag. In the case above, only Bold and Italic buttons are displayed. Here is a complete list of the Toolbar buttons currently supported by the HTML Editor Extender: Undo Redo Bold Italic Underline StrikeThrough Subscript Superscript JustifyLeft JustifyCenter JustifyRight JustifyFull InsertOrderedList InsertUnorderedList CreateLink UnLink RemoveFormat SelectAll UnSelect Delete Cut Copy Paste BackgroundColorSelector ForeColorSelector FontNameSelector FontSizeSelector Indent Outdent InsertHorizontalRule HorizontalSeparator Of course the HTML Editor Extender was designed to be extensible. You can create your own buttons and add them to the control. Compatible with the AntiXSS Library When using the HTML Editor Extender on a public facing website, we strongly recommend that you use the HTML Editor Extender with the AntiXSS Library. If you allow users to submit arbitrary HTML, and you don’t take any action to strip out malicious markup, then you are opening your website to Cross-Site Scripting Attacks (XSS attacks). The HTML Editor Extender uses the Provider Model to support different Sanitizer Providers. The July 2011 release of the Ajax Control Toolkit ships with a single Sanitizer Provider which uses the AntiXSS library (see http://AntiXss.CodePlex.com ). A Sanitizer Provider is responsible for sanitizing HTML markup by removing any malicious elements, attributes, and attribute values. For example, the AntiXss Sanitizer Provider will take the following block of HTML: <b><a href=""javascript:doEvil()"">Visit Grandma</a></b> <script>doEvil()</script> And return the following sanitized block of HTML: <b><a href="">Visit Grandma</a></b> Notice that the JavaScript href and <SCRIPT> tag are both stripped out. Be aware that there are a depressingly large number of ways to sneak evil markup into your HTML. You definitely want a Sanitizer as a safety net. Before you can use the AntiXSS Sanitizer Provider, you must add three assemblies to your web application: AntiXSSLibrary.dll, HtmlSanitizationLibrary.dll, and SanitizerProviders.dll. All three assemblies are included with the CodePlex download of the Ajax Control Toolkit in the SanitizerProviders folder. Here’s how you modify your web.config file to use the AntiXSS Sanitizer Provider: <configuration> <configSections> <sectionGroup name="system.web"> <section name="sanitizer" requirePermission="false" type="AjaxControlToolkit.Sanitizer.ProviderSanitizerSection, AjaxControlToolkit"/> </sectionGroup> </configSections> <system.web> <compilation targetFramework="4.0" debug="true"/> <sanitizer defaultProvider="AntiXssSanitizerProvider"> <providers> <add name="AntiXssSanitizerProvider" type="AjaxControlToolkit.Sanitizer.AntiXssSanitizerProvider"></add> </providers> </sanitizer> </system.web> </configuration> You can detect whether the HTML Editor Extender is using the AntiXSS Sanitizer Provider by checking the HtmlEditorExtender SanitizerProvider property like this: if (MyHtmlEditorExtender.SanitizerProvider == null) { throw new Exception("Please enable the AntiXss Sanitizer!"); } When the SanitizerProvider property has the value null, you know that a Sanitizer Provider has not been configured in the web.config file. Because the AntiXSS library requires Full Trust, you cannot use the AntiXSS Sanitizer Provider with most shared website hosting providers. Because most shared hosting providers only support Medium Trust and not Full Trust, we do not recommend using the HTML Editor Extender with a public website hosted with a shared hosting provider. Why a New HTML Editor Control? The Ajax Control Toolkit now includes two HTML Editor controls. Why did we introduce a new HTML Editor control when there was already an existing HTML Editor? We think you will like the new HTML Editor much more than the previous one. We had several goals with the new HTML Editor Extender: Lightweight – We wanted to leverage HTML5 to create a lightweight HTML Editor. The new HTML Editor generates much less markup and script than the previous HTML Editor. Secure – We wanted to make it easy to integrate the AntiXSS library with the HTML Editor. If you are creating a public facing website, we strongly recommend that you use the AntiXSS Provider. Customizable – We wanted to make it easy for users to customize the toolbar buttons displayed by the HTML Editor. Compatibility – We wanted to ensure that the HTML Editor will work with the latest versions of the most popular browsers (including Internet Explorer 6 and higher). The old HTML Editor control is still included in the Ajax Control Toolkit and continues to live in the AjaxControlToolkit.HTMLEditor namespace. We have not modified the control and you can continue to use the control in the same way as you have used it in the past. However, we hope that you will consider migrating to the new HTML Editor Extender for the reasons listed above. Summary We’ve introduced a new Ajax Control Toolkit control with this release. I want to thank the developers and testers on the Superexpert team for the huge amount of work which they put into this control. It was a non-trivial task to build an entirely new control which has the complexity of the HTML Editor in less than 6 weeks. Please let us know what you think! We want to hear your feedback. If you discover issues with the new HTML Editor Extender control, or you have questions about the control, or you have ideas for how it can be improved, then please post them to this blog. Tomorrow starts a new sprint

    Read the article

  • How do I make urxvt render xft fonts?

    - by wishi
    I wonder whether there's a way to make urxvt render xft fonts: URxvt.font: xft:Droid Sans Mono Slashed:pixelsize=9:Regular URxvt.boldFont: xft:Droid Sans Mono Slashed:pixelsize=9:Bold URxvt.talicFont: xft:Droid Sans Mono Slashed:pixelsize=9:Italic URxvt.bolditalicFont: xft:Droid Sans Mono Slashed:pixelsize=9:Bold:Italic If I try this, I get something like: So it scales pretty bad: ! Fonts Xft.dpi: 132 Xft.antialias: true Xft.rgba: rgb Xft.hinting: true Xft.autohint: true Xft.hintstyle: hintfull I'm not sure whether this is one of the reaons. However I want antialias and that Droid. Is there any trick here?

    Read the article

  • .net- open excel file, format the file and save

    - by Lock
    I have an ASP web service that uses the Crystal Reports API to download an Excel report. Now, there is a few things I do not like about the Excel report that Crystal generates: - The column widths are static (as in they are not adjusted for the content). - I can't format the header row to be bold - If I suppress a data column in the report, it comes out in the Excel spreadsheet as a blank column. I currently use PHP to open the excel file, autosize the columns, bold the heading and remove blank columns, although using the PHPExcel class for this doesn't work well when the spreadsheet is only a few 100kb in size. I am thinking if I move this activity into the .NET web service, the performance will be much better. Does anyone know an efficient way of opening a Excel file and performing the operations listed above?

    Read the article

  • Telerik RadGrid doesn't seem to export Grouped data

    - by SlackGadget
    Hi I've got a DNN application using Telerik RadGrid. We're exporting some data from the Grid but when we drill down on the grid control and export the data we only see the initial top level data, never the updated Grid. Here's my table tag and supporting code. I'm not an expert in ASPX/C#so please forgive my newbie-ness. <mastertableview autogeneratecolumns="False" datakeynames="AccountId" datasourceid="SqlDataSource1" groupsdefaultexpanded="False"> <DetailTables> <telerik:GridTableView runat="server" DataKeyNames="StatementId" DataSourceID="SqlDataSource2" Font-Bold="False" Font-Italic="False" Font-Overline="False" Font-Strikeout="False" Font-Underline="False" > <DetailTables> <telerik:GridTableView runat="server" DataSourceID="SqlDataSource3" Font-Bold="False" Font-Italic="False" Font-Overline="False" Font-Strikeout="False" Font-Underline="False" GroupsDefaultExpanded="False" ShowFooter="True" ShowGroupFooter="True" AllowMultiColumnSorting="True" GridLines="None"> <ParentTableRelation> <telerik:GridRelationFields DetailKeyField="StatementId" MasterKeyField="StatementId" /> </ParentTableRelation> <AlternatingItemStyle BackColor="White" Font-Bold="False" Font-Italic="False" Font-Overline="False" Font-Strikeout="False" Font-Underline="False" Wrap="True" /> <HeaderStyle Font-Bold="False" Font-Italic="False" Font-Overline="False" Font-Strikeout="False" Font-Underline="False" Wrap="True" /> <FooterStyle BackColor="Yellow" Font-Bold="False" Font-Italic="False" Font-Overline="False" Font-Strikeout="False" Font-Underline="False" Wrap="True" /> </telerik:GridTableView> </DetailTables> <ParentTableRelation> <telerik:GridRelationFields DetailKeyField="AccountId" MasterKeyField="AccountId" /> </ParentTableRelation> <CommandItemSettings ExportToPdfText="Export to Pdf" /> <ExpandCollapseColumn Visible="True"> </ExpandCollapseColumn> </telerik:GridTableView> </DetailTables> <ParentTableRelation> <telerik:GridRelationFields DetailKeyField="AccountId" MasterKeyField="AccountId" /> </ParentTableRelation> <ExpandCollapseColumn Visible="True"> </ExpandCollapseColumn> <Columns> <telerik:GridBoundColumn DataField="ACCOUNTID" DataType="System.Int32" HeaderText="ACCOUNTID" SortExpression="ACCOUNTID" UniqueName="ACCOUNTID"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="ACCOUNTREF" HeaderText="ACCOUNTREF" SortExpression="ACCOUNTREF" UniqueName="ACCOUNTREF"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="CUSTOMERID" DataType="System.Int32" HeaderText="CUSTOMERID" SortExpression="CUSTOMERID" UniqueName="CUSTOMERID"> </telerik:GridBoundColumn> </Columns> </mastertableview> The exports are registered with the script manager on load : protected void Page_Load(object sender, EventArgs e) { Button2.Enabled = Session[UserSelection.SelectedValue] != null ? true : false; ScriptManager.GetCurrent(Page).RegisterPostBackControl(Button3); ScriptManager.GetCurrent(Page).RegisterPostBackControl(Button4); } and I' calling the Export with the following : protected void Button3_Click(object sender, System.EventArgs e) { //ConfigureExport(); RadGrid1.Rebind(); RadGrid1.ExportSettings.FileName = "RadGridExportToExcel"; RadGrid1.ExportSettings.ExportOnlyData = true; RadGrid1.ExportSettings.OpenInNewWindow = true; RadGrid1.MasterTableView.ExportToExcel(); } Can anyone see what I'm missing, apart from DNN/ASPX experience and the will to live :)

    Read the article

  • newsubtitles line not working in FFmpeg

    - by godMode
    i'm trying to run the following line on FFmpeg that will basically "re-format" an MKV file to MP4 without doing any re-encoding and also embed SRT subtitles onto the MP4 output: ffmpeg -i test.mkv -i test.srt -newsubtitle -acodec copy -vcodec copy test.mp4 Without the "-i test.srt -nwesubtitle" bit, it seems to work just fine; however, with it I get the following output: Seems stream 0 codec frame rate differs from container frame rate: 47.95 (5000000/104271) - 23.98 (24000/1001) Stream #0.0(eng): Video: h264, yuv420p, 1280x720 [PAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 1k tbn, 47.95 tbc Stream #0.1(eng): Subtitle: 0x0000 Metadata: title : English Stream #0.2(jpn): Audio: aac, 48000 Hz, stereo, s16 Metadata: title : Japanese 2.0 Stream #0.3(eng): Audio: aac, 48000 Hz, stereo, s16 Metadata: title : English 2.0 Stream #0.4(eng): Subtitle: 0x0000 Metadata: title : English Songs & Signs Stream #0.5: Attachment: 0x0000 Metadata: filename : MyriadPro-Bold.ttf Stream #0.6: Attachment: 0x0000 Metadata: filename : MyriadPro-RegularHaruhi.ttf Stream #0.7: Attachment: 0x0000 Metadata: filename : ChaparralPro-BoldIt.ttf Stream #0.8: Attachment: 0x0000 Metadata: filename : ChaparralPro-SemiboldIt.ttf Stream #0.9: Attachment: 0x0000 Metadata: filename : epmgobld_ending.ttf Stream #0.10: Attachment: 0x0000 Metadata: filename : epminbld_opening.ttf Stream #0.11: Attachment: 0x0000 Metadata: filename : Folks-Bold.ttf Stream #0.12: Attachment: 0x0000 Metadata: filename : GosmickSansBold.ttf Stream #0.13: Attachment: 0x0000 Metadata: filename : WarnockPro-LightDisp.ttf Stream #0.14: Attachment: 0x0000 Metadata: filename : epmgobld_ending.ttf Stream #0.15: Attachment: 0x0000 Metadata: filename : GosmickSansBold.ttf Stream #0.16: Attachment: 0x0000 Metadata: filename : Marker SD 1.2.ttf Stream #0.17: Attachment: 0x0000 Metadata: filename : MyriadPro-Bold.ttf Stream #0.18: Attachment: 0x0000 Metadata: filename : MyriadPro-RegularHaruhi.ttf Stream #0.19: Attachment: 0x0000 Metadata: filename : MyriadPro-SemiCn.ttf test.srt: Invalid data found when processing input I tried adding "-r pal", "-r ntsc" or "-r 23.98" thinking it was framerate issue with no change.

    Read the article

  • JsTree v1.0 - How to manipulate effectively the data from the backend to render the trees and operate correctly?

    - by Jean Paul
    Backend info: PHP 5 / MySQL URL: http://github.com/downloads/vakata/jstree/jstree_pre1.0_fix_1.zip Table structure for table discussions_tree -- CREATE TABLE IF NOT EXISTS `discussions_tree` ( `id` int(11) NOT NULL AUTO_INCREMENT, `parent_id` int(11) NOT NULL DEFAULT '0', `user_id` int(11) NOT NULL DEFAULT '0', `label` varchar(16) DEFAULT NULL, `position` bigint(20) unsigned NOT NULL DEFAULT '0', `left` bigint(20) unsigned NOT NULL DEFAULT '0', `right` bigint(20) unsigned NOT NULL DEFAULT '0', `level` bigint(20) unsigned NOT NULL DEFAULT '0', `type` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL, `h_label` varchar(16) NOT NULL DEFAULT '', `fulllabel` varchar(255) DEFAULT NULL, UNIQUE KEY `uidx_3` (`id`), KEY `idx_1` (`user_id`), KEY `idx_2` (`parent_id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=8 ; /*The first element should in my understanding not even be shown*/ INSERT INTO `discussions_tree` (`id`, `parent_id`, `user_id`, `label`, `position`, `left`, `right`, `level`, `type`, `h_label`, `fulllabel`) VALUES (0, 0, 0, 'Contacts', 0, 1, 1, 0, NULL, '', NULL); INSERT INTO `discussions_tree` (`id`, `parent_id`, `user_id`, `label`, `position`, `left`, `right`, `level`, `type`, `h_label`, `fulllabel`) VALUES (1, 0, 0, 'How to Tag', 1, 2, 2, 0, 'drive', '', NULL); Front End : I've simplified the logic, it has 6 trees actually inside of a panel and that works fine $array = array("Discussions"); $id_arr = array("d"); $nid = 0; foreach ($array as $k=> $value) { $nid++; ?> <li id="<?=$value?>" class="label"> <a href='#<?=$value?>'><span> <?=$value?> </span></a> <div class="sub-menu" style="height:auto; min-height:120px; background-color:#E5E5E5" > <div class="menu" id="menu_<?=$id_arr[$k]?>" style="position:relative; margin-left:56%"> <img src="./js/jsTree/create.png" alt="" id="create" title="Create" > <img src="./js/jsTree/rename.png" alt="" id="rename" title="Rename" > <img src="./js/jsTree/remove.png" alt="" id="remove" title="Delete"> <img src="./js/jsTree/cut.png" alt="" id="cut" title="Cut" > <img src="./js/jsTree/copy.png" alt="" id="copy" title="Copy"> <img src="./js/jsTree/paste.png" alt="" id="paste" title="Paste"> </div> <div id="<?=$id_arr[$k]?>" class="jstree_container"></div> </div> </li> <!-- JavaScript neccessary for this tree : <?=$value?> --> <script type="text/javascript" > jQuery(function ($) { $("#<?=$id_arr[$k]?>").jstree({ // List of active plugins used "plugins" : [ "themes", "json_data", "ui", "crrm" , "hotkeys" , "types" , "dnd", "contextmenu"], // "ui" :{ "initially_select" : ["#node_"+ $nid ] } , "crrm": { "move": { "always_copy": "multitree" }, "input_width_limit":128 }, "core":{ "strings":{ "new_node" : "New Tag" }}, "themes": {"theme": "classic"}, "json_data" : { "ajax" : { "url" : "./js/jsTree/server-<?=$id_arr[$k]?>.php", "data" : function (n) { // the result is fed to the AJAX request `data` option return { "operation" : "get_children", "id" : n.attr ? n.attr("id").replace("node_","") : 1, "state" : "", "user_id": <?=$uid?> }; } } } , "types" : { "max_depth" : -1, "max_children" : -1, "types" : { // The default type "default" : { "hover_node":true, "valid_children" : [ "default" ], }, // The `drive` nodes "drive" : { // can have files and folders inside, but NOT other `drive` nodes "valid_children" : [ "default", "folder" ], "hover_node":true, "icon" : { "image" : "./js/jsTree/root.png" }, // those prevent the functions with the same name to be used on `drive` nodes.. internally the `before` event is used "start_drag" : false, "move_node" : false, "remove_node" : false } } }, "contextmenu" : { "items" : customMenu , "select_node": true} }) //Hover function binded to jstree .bind("hover_node.jstree", function (e, data) { $('ul li[rel="drive"], ul li[rel="default"], ul li[rel=""]').each(function(i) { $(this).find("a").attr('href', $(this).attr("id")+".php" ); }) }) //Create function binded to jstree .bind("create.jstree", function (e, data) { $.post( "./js/jsTree/server-<?=$id_arr[$k]?>.php", { "operation" : "create_node", "id" : data.rslt.parent.attr("id").replace("node_",""), "position" : data.rslt.position, "label" : data.rslt.name, "href" : data.rslt.obj.attr("href"), "type" : data.rslt.obj.attr("rel"), "user_id": <?=$uid?> }, function (r) { if(r.status) { $(data.rslt.obj).attr("id", "node_" + r.id); } else { $.jstree.rollback(data.rlbk); } } ); }) //Remove operation .bind("remove.jstree", function (e, data) { data.rslt.obj.each(function () { $.ajax({ async : false, type: 'POST', url: "./js/jsTree/server-<?=$id_arr[$k]?>.php", data : { "operation" : "remove_node", "id" : this.id.replace("node_",""), "user_id": <?=$uid?> }, success : function (r) { if(!r.status) { data.inst.refresh(); } } }); }); }) //Rename operation .bind("rename.jstree", function (e, data) { data.rslt.obj.each(function () { $.ajax({ async : true, type: 'POST', url: "./js/jsTree/server-<?=$id_arr[$k]?>.php", data : { "operation" : "rename_node", "id" : this.id.replace("node_",""), "label" : data.rslt.new_name, "user_id": <?=$uid?> }, success : function (r) { if(!r.status) { data.inst.refresh(); } } }); }); }) //Move operation .bind("move_node.jstree", function (e, data) { data.rslt.o.each(function (i) { $.ajax({ async : false, type: 'POST', url: "./js/jsTree/server-<?=$id_arr[$k]?>.php", data : { "operation" : "move_node", "id" : $(this).attr("id").replace("node_",""), "ref" : data.rslt.cr === -1 ? 1 : data.rslt.np.attr("id").replace("node_",""), "position" : data.rslt.cp + i, "label" : data.rslt.name, "copy" : data.rslt.cy ? 1 : 0, "user_id": <?=$uid?> }, success : function (r) { if(!r.status) { $.jstree.rollback(data.rlbk); } else { $(data.rslt.oc).attr("id", "node_" + r.id); if(data.rslt.cy && $(data.rslt.oc).children("UL").length) { data.inst.refresh(data.inst._get_parent(data.rslt.oc)); } } } }); }); }); // This is for the context menu to bind with operations on the right clicked node function customMenu(node) { // The default set of all items var control; var items = { createItem: { label: "Create", action: function (node) { return {createItem: this.create(node) }; } }, renameItem: { label: "Rename", action: function (node) { return {renameItem: this.rename(node) }; } }, deleteItem: { label: "Delete", action: function (node) { return {deleteItem: this.remove(node) }; }, "separator_after": true }, copyItem: { label: "Copy", action: function (node) { $(node).addClass("copy"); return {copyItem: this.copy(node) }; } }, cutItem: { label: "Cut", action: function (node) { $(node).addClass("cut"); return {cutItem: this.cut(node) }; } }, pasteItem: { label: "Paste", action: function (node) { $(node).addClass("paste"); return {pasteItem: this.paste(node) }; } } }; // We go over all the selected items as the context menu only takes action on the one that is right clicked $.jstree._reference("#<?=$id_arr[$k]?>").get_selected(false, true).each(function(index,element) { if ( $(element).attr("id") != $(node).attr("id") ) { // Let's deselect all nodes that are unrelated to the context menu -- selected but are not the one right clicked $("#<?=$id_arr[$k]?>").jstree("deselect_node", '#'+$(element).attr("id") ); } }); //if any previous click has the class for copy or cut $("#<?=$id_arr[$k]?>").find("li").each(function(index,element) { if ($(element) != $(node) ) { if( $(element).hasClass("copy") || $(element).hasClass("cut") ) control=1; } else if( $(node).hasClass("cut") || $(node).hasClass("copy")) { control=0; } }); //only remove the class for cut or copy if the current operation is to paste if($(node).hasClass("paste") ) { control=0; // Let's loop through all elements and try to find if the paste operation was done already $("#<?=$id_arr[$k]?>").find("li").each(function(index,element) { if( $(element).hasClass("copy") ) $(this).removeClass("copy"); if ( $(element).hasClass("cut") ) $(this).removeClass("cut"); if ( $(element).hasClass("paste") ) $(this).removeClass("paste"); }); } switch (control) { //Remove the paste item from the context menu case 0: switch ($(node).attr("rel")) { case "drive": delete items.renameItem; delete items.deleteItem; delete items.cutItem; delete items.copyItem; delete items.pasteItem; break; case "default": delete items.pasteItem; break; } break; //Remove the paste item from the context menu only on the node that has either copy or cut added class case 1: if( $(node).hasClass("cut") || $(node).hasClass("copy") ) { switch ($(node).attr("rel")) { case "drive": delete items.renameItem; delete items.deleteItem; delete items.cutItem; delete items.copyItem; delete items.pasteItem; break; case "default": delete items.pasteItem; break; } } else //Re-enable it on the clicked node that does not have the cut or copy class { switch ($(node).attr("rel")) { case "drive": delete items.renameItem; delete items.deleteItem; delete items.cutItem; delete items.copyItem; break; } } break; //initial state don't show the paste option on any node default: switch ($(node).attr("rel")) { case "drive": delete items.renameItem; delete items.deleteItem; delete items.cutItem; delete items.copyItem; delete items.pasteItem; break; case "default": delete items.pasteItem; break; } break; } return items; } $("#menu_<?=$id_arr[$k]?> img").hover( function () { $(this).css({'cursor':'pointer','outline':'1px double teal'}) }, function () { $(this).css({'cursor':'none','outline':'1px groove transparent'}) } ); $("#menu_<?=$id_arr[$k]?> img").click(function () { switch(this.id) { //Create only the first element case "create": if ( $.jstree._reference("#<?=$id_arr[$k]?>").get_selected(false, true).length ) { $.jstree._reference("#<?=$id_arr[$k]?>").get_selected(false, true).each(function(index,element){ switch(index) { case 0: $("#<?=$id_arr[$k]?>").jstree("create", '#'+$(element).attr("id"), null, /*{attr : {href: '#' }}*/null ,null, false); break; default: $("#<?=$id_arr[$k]?>").jstree("deselect_node", '#'+$(element).attr("id") ); break; } }); } else { $.facebox('<p class=\'p_inner error bold\'>A selection needs to be made to work with this operation'); setTimeout(function(){ $.facebox.close(); }, 2000); } break; //REMOVE case "remove": if ( $.jstree._reference("#<?=$id_arr[$k]?>").get_selected(false, true).length ) { $.jstree._reference("#<?=$id_arr[$k]?>").get_selected(false, true).each(function(index,element){ //only execute if the current node is not the first one (drive) if( $(element).attr("id") != $("div.jstree > ul > li").first().attr("id") ) { $("#<?=$id_arr[$k]?>").jstree("remove",'#'+$(element).attr("id")); } else $("#<?=$id_arr[$k]?>").jstree("deselect_node", '#'+$(element).attr("id") ); }); } else { $.facebox('<p class=\'p_inner error bold\'>A selection needs to be made to work with this operation'); setTimeout(function(){ $.facebox.close(); }, 2000); } break; //RENAME NODE only one selection case "rename": if ( $.jstree._reference("#<?=$id_arr[$k]?>").get_selected(false, true).length ) { $.jstree._reference("#<?=$id_arr[$k]?>").get_selected(false, true).each(function(index,element){ if( $(element).attr("id") != $("div.jstree > ul > li").first().attr("id") ) { switch(index) { case 0: $("#<?=$id_arr[$k]?>").jstree("rename", '#'+$(element).attr("id") ); break; default: $("#<?=$id_arr[$k]?>").jstree("deselect_node", '#'+$(element).attr("id") ); break; } } else $("#<?=$id_arr[$k]?>").jstree("deselect_node", '#'+$(element).attr("id") ); }); } else { $.facebox('<p class=\'p_inner error bold\'>A selection needs to be made to work with this operation'); setTimeout(function(){ $.facebox.close(); }, 2000); } break; //Cut case "cut": if ( $.jstree._reference("#<?=$id_arr[$k]?>").get_selected(false, true).length ) { $.jstree._reference("#<?=$id_arr[$k]?>").get_selected(false, true).each(function(index,element){ switch(index) { case 0: $("#<?=$id_arr[$k]?>").jstree("cut", '#'+$(element).attr("id")); $.facebox('<p class=\'p_inner teal\'>Operation "Cut" successfully done.<p class=\'p_inner teal bold\'>Where to place it?'); setTimeout(function(){ $.facebox.close(); $("#<?=$id_arr[$k]?>").jstree("deselect_node", '#'+$(element).attr("id")); }, 2000); break; default: $("#<?=$id_arr[$k]?>").jstree("deselect_node", '#'+$(element).attr("id") ); break; } }); } else { $.facebox('<p class=\'p_inner error bold\'>A selection needs to be made to work with this operation'); setTimeout(function(){ $.facebox.close(); }, 2000); } break; //Copy case "copy": if ( $.jstree._reference("#<?=$id_arr[$k]?>").get_selected(false, true).length ) { $.jstree._reference("#<?=$id_arr[$k]?>").get_selected(false, true).each(function(index,element){ switch(index) { case 0: $("#<?=$id_arr[$k]?>").jstree("copy", '#'+$(element).attr("id")); $.facebox('<p class=\'p_inner teal\'>Operation "Copy": Successfully done.<p class=\'p_inner teal bold\'>Where to place it?'); setTimeout(function(){ $.facebox.close(); $("#<?=$id_arr[$k]?>").jstree("deselect_node", '#'+$(element).attr("id") ); }, 2000); break; default: $("#<?=$id_arr[$k]?>").jstree("deselect_node", '#'+$(element).attr("id") ); break; } }); } else { $.facebox('<p class=\'p_inner error bold\'>A selection needs to be made to work with this operation'); setTimeout(function(){ $.facebox.close(); }, 2000); } break; case "paste": if ( $.jstree._reference("#<?=$id_arr[$k]?>").get_selected(false, true).length ) { $.jstree._reference("#<?=$id_arr[$k]?>").get_selected(false, true).each(function(index,element){ switch(index) { case 0: $("#<?=$id_arr[$k]?>").jstree("paste", '#'+$(element).attr("id")); break; default: $("#<?=$id_arr[$k]?>").jstree("deselect_node", '#'+$(element).attr("id") ); break; } }); } else { $.facebox('<p class=\'p_inner error bold\'>A selection needs to be made to work with this operation'); setTimeout(function(){ $.facebox.close(); }, 2000); } break; } }); <? } ?> server.php $path='../../../..'; require_once "$path/phpfoo/dbif.class"; require_once "$path/global.inc"; // Database config & class $db_config = array( "servername"=> $dbHost, "username" => $dbUser, "password" => $dbPW, "database" => $dbName ); if(extension_loaded("mysqli")) require_once("_inc/class._database_i.php"); else require_once("_inc/class._database.php"); //Tree class require_once("_inc/class.ctree.php"); $dbLink = new dbif(); $dbErr = $dbLink->connect($dbName,$dbUser,$dbPW,$dbHost); $jstree = new json_tree(); if(isset($_GET["reconstruct"])) { $jstree->_reconstruct(); die(); } if(isset($_GET["analyze"])) { echo $jstree->_analyze(); die(); } $table = '`discussions_tree`'; if($_REQUEST["operation"] && strpos($_REQUEST["operation"], "_") !== 0 && method_exists($jstree, $_REQUEST["operation"])) { foreach($_REQUEST as $k => $v) { switch($k) { case 'user_id': //We are passing the user_id from the $_SESSION on each request and trying to pick up the min and max value from the table that matches the 'user_id' $sql = "SELECT max(`right`) , min(`left`) FROM $table WHERE `user_id`=$v"; //If the select does not return any value then just let it be :P if (!list($right, $left)=$dbLink->getRow($sql)) { $sql = $dbLink->dbSubmit("UPDATE $table SET `user_id`=$v WHERE `id` = 1 AND `parent_id` = 0"); $sql = $dbLink->dbSubmit("UPDATE $table SET `user_id`=$v WHERE `parent_id` = 1 AND `label`='How to Tag' "); } else { $sql = $dbLink->dbSubmit("UPDATE $table SET `user_id`=$v, `right`=$right+2 WHERE `id` = 1 AND `parent_id` = 0"); $sql = $dbLink->dbSubmit("UPDATE $table SET `user_id`=$v, `left`=$left+1, `right`=$right+1 WHERE `parent_id` = 1 AND `label`='How to Tag' "); } break; } } header("HTTP/1.0 200 OK"); header('Content-type: application/json; charset=utf-8'); header("Cache-Control: no-cache, must-revalidate"); header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); header("Pragma: no-cache"); echo $jstree->{$_REQUEST["operation"]}($_REQUEST); die(); } header("HTTP/1.0 404 Not Found"); ?> The problem: DND *(Drag and Drop) works, Delete works, Create works, Rename works, but Copy, Cut and Paste don't work

    Read the article

  • Apply Font Formatting to PowerPoint Text Programatically

    - by OneNerd
    I am trying to use VBA to insert some text into a PowerPoint TextRange, I use something like this: ActiveWindow.Selection.SlideRange.Shapes("rec1").TextFrame.TextRange.Text = "Hi" However, I can't figure out how to apply bold, italic and underline programatically (I don't see a .RichText property or something similar). What I have is some simple HTML text with bold, italic and underlined text I would like to convert over. Does anyone know how to do this?

    Read the article

  • datalist edit mode.

    - by Ranjana
    i have a datalist control <ItemTemplate> <tr> <td height="31px"> <asp:Label ID="lblStudentName" runat="server" Text="StudentName :" Font-Bold="true"></asp:Label> <%# DataBinder.Eval(Container.DataItem, "StudentName") %> </td> <td height="31px"> <asp:LinkButton ID="lnkEdit" runat="server" CommandName="edit">Edit</asp:LinkButton> </td> </tr> <tr> <td> <asp:Label ID="lblAdmissionNo" runat="server" Text="AdmissionNo :" Font-Bold="true"></asp:Label> <%# DataBinder.Eval(Container.DataItem, "AdmissionNo")%> </td> </tr> <tr> <td height="31px"> <asp:Label ID="lblStudentRollNo" runat="server" Text="StdentRollNo :" Font-Bold="true"></asp:Label> <%# DataBinder.Eval(Container.DataItem, "StdentRollNo") %> </td> <td height="31px"> <asp:LinkButton ID="lnkEditroll" runat="server" CommandName="edit">Edit</asp:LinkButton> </td> </tr> </ItemTemplate> <EditItemTemplate> <tr> <td height="31px"> <asp:Label ID="lblStudentName" runat="server" Text="StudentName :" Font-Bold="true"></asp:Label> <asp:TextBox ID="txtProductName" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "StudentName") %>'></asp:TextBox> </td> <td> <asp:LinkButton ID="lnkUpdate" runat="server" CommandName="update">Update</asp:LinkButton> <asp:LinkButton ID="lnkCancel" runat="server" CommandName="cancel">Cancel</asp:LinkButton> </td> </tr> <tr> <td height="31px"> <asp:Label ID="lblAdmissionNo" runat="server" Text="AdmissionNo :" Font-Bold="true"></asp:Label> <%# DataBinder.Eval(Container.DataItem, "AdmissionNo")%> </td> </tr> <tr> <td height="31px"> <asp:Label ID="lblStudentRollNo" runat="server" Text="StudentRollNo :" Font-Bold="true"></asp:Label> <asp:TextBox ID="txtStudentRollNo" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "StdentRollNo") %>'></asp:TextBox> </td> <td> <asp:LinkButton ID="LinkButton1" runat="server" CommandName="update">Update</asp:LinkButton> <asp:LinkButton ID="LinkButton2" runat="server" CommandName="cancel">Cancel</asp:LinkButton> </td> </tr> </EditItemTemplate> <FooterTemplate> </table> </FooterTemplate> </asp:DataList> code behind: protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { DataTable dt = new DataTable(); dt = obj.GetSamples(); DataList1.DataSource = dt; DataList1.DataBind(); } } public void DataBind() { DataTable dt = new DataTable(); dt = obj.GetSamples(); DataList1.DataSource = dt; DataList1.DataBind(); } protected void DataList1_EditCommand1(object source, DataListCommandEventArgs e) { DataList1.EditItemIndex = e.Item.ItemIndex; DataBind(); } protected void DataList1_CancelCommand1(object source, DataListCommandEventArgs e) { DataList1.EditItemIndex = -1; DataBind(); } protected void DataList1_UpdateCommand1(object source, DataListCommandEventArgs e) { // Get the DataKey value associated with current Item Index. // int AdmissionNo = Convert.ToInt32(DataList1.DataKeys[e.Item.ItemIndex]); string AdmissionNo = DataList1.DataKeys[e.Item.ItemIndex].ToString(); // Get updated value entered by user in textbox control for // ProductName field. TextBox txtProductName; txtProductName = (TextBox)e.Item.FindControl("txtProductName"); TextBox txtStudentRollNo; txtStudentRollNo = (TextBox)e.Item.FindControl("txtStudentRollNo"); // string variable to store the connection string // retrieved from the connectionStrings section of web.config string connectionString = ConfigurationManager.ConnectionStrings["MyConnectionString"].ConnectionString; // sql connection object SqlConnection mySqlConnection = new SqlConnection(connectionString); // sql command object initialized with update command text SqlCommand mySqlCommand = new SqlCommand("update SchoolAdmissionForm set StudentName=@studentname ,StdentRollNo=@studentroll where AdmissionNo=@admissionno", mySqlConnection); mySqlCommand.Parameters.Add("@studentname", SqlDbType.VarChar).Value = txtProductName.Text; mySqlCommand.Parameters.Add("@admissionno", SqlDbType.VarChar).Value = AdmissionNo; mySqlCommand.Parameters.Add("@studentroll", SqlDbType.VarChar).Value = txtStudentRollNo.Text; // check the connection state and open it accordingly. if (mySqlConnection.State == ConnectionState.Closed) mySqlConnection.Open(); // execute sql update query mySqlCommand.ExecuteNonQuery(); // check the connection state and close it accordingly. if (mySqlConnection.State == ConnectionState.Open) mySqlConnection.Close(); // reset the DataList mode back to its initial state DataList1.EditItemIndex = -1; DataBind(); // BindDataList(); } But it works fine.... but when i click edit command both the Fields 1.StudentName 2.StudentRollNo im getting textboxes to all the fields where i placed textbox when i click 'edit' command and not the particular field alone . but i should get oly the textbox visible to the field to which i clik as 'edit' , and the rest remain same without showing textboxes even though it is in editmode

    Read the article

  • php recursive list help

    - by Jason
    Hi all, I am trying to display a recursive list in PHP for a site I am working on. I am really having trouble trying to get the second level to display. I have a function that displays the contents to the page as follows. function get_menu_entries($content,$which=0) { global $tbl_prefix, $sys_explorer_vars, $sys_config_vars; // INIT LIBRARIES $db = new DB_Tpl(); $curr_time = time(); $db->query("SELECT * FROM ".$tbl_prefix."sys_explorer WHERE preid = '".$which."' && config_id = '".$sys_explorer_vars['config_id']."' && blocked = '0' && startdate < '".$curr_time."' && (enddate > '".$curr_time."' || enddate = '') ORDER BY preid,sorting"); while($db->next_record()){ $indent = $db->f("level") * 10 - 10; $sitemap_vars['break'] = ""; $sitemap_vars['bold'] = ""; if($db->f("level") == 2) { $sitemap_vars['ul_start'] = ""; $sitemap_vars['bold'] = "class='bold'"; $sitemap_vars['ul_end'] = ""; } switch($db->f("link_type")) { case '1': // External Url $sitemap_vars['hyperlink'] = $db->f("link_url"); $sitemap_vars['target'] = ""; if($db->f("link_target") != "") { $sitemap_vars['target'] = "target=\"".$db->f("link_target")."\""; } break; case '2': // Shortcut $sitemap_vars['hyperlink'] = create_url($db->f("link_eid"),$db->f("name"),$sys_config_vars['mod_rewrite']); $sitemap_vars['target'] = ""; break; default: $sitemap_vars['hyperlink'] = create_url($db->f("eid"),$db->f("name"),$sys_config_vars['mod_rewrite']); $sitemap_vars['target'] = ""; break; } if($db->f("level") > 1) { $content .= "<div style=\"text-indent: ".$indent."px;\" ".$sitemap_vars['bold']."><a href=\"".$sitemap_vars['hyperlink']."\" ".$sitemap_vars['target'].">".$db->f("name")."</a></div>\n"; } $content = get_menu_entries($content,$db->f("eid")); } return(''.$content.''); } At the moment the content displays properly, however I want to turn this function into a DHTML dropdown menu. At present what happens with the level 2 elements is that using CSS the contents are indented using CSS. What I need to happen is to place the UL tag at the beginning and /UL tag at the end of the level 2 elements. I hope this makes sense. Any help would be greatly appreciated.

    Read the article

  • Choose variable based on users choice from picklist.

    - by Kelbizzle
    I have this form. Basically what I want is to send a auto-response with a different URL based on what the user picks in the "attn" picklist. I've been thinking I could have a different variable for each drop down value. It will then pass this variable on to the mail script that will choose which URL to insert inside the auto response that is sent. It gives me a headache thinking about it sometimes. What's the easiest way to accomplish this? Am I making more work for myself? I really don't know because I'm no programmer. Thanks in advance! Here is the form: <form name="contact_form" method="post" action="sendemail_reports.php" onsubmit="return validate_form ( );"> <div id='zohoWebToLead' align=center> <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" class="txt_body"> <table border=0 cellspacing=0 cellpadding=5 width=480 style='border-bottom-color: #999999; border-top-color: #999999; border-bottom-style: none; border-top-style: none; border-bottom-width: 1px; border-top-width: 2px; background-color:transparent;'> <tr> <td width='75%'><table width=480 border=0 cellpadding=5 cellspacing=0 style='border-bottom-color: #999999; border-top-color: #999999; border-bottom-style: none; border-top-style: none; border-bottom-width: 1px; border-top-width: 2px; background-color:transparent;'> <input type="hidden" name="ip" value="'.$ipi.'" /> <input type="hidden" name="httpref" value="'.$httprefi.'" /> <input type="hidden" name="httpagent" value="'.$httpagenti.'" /> <tr></tr> <tr> <td colspan='2' align='left' style='border-bottom-color: #dadada; border-bottom-style: none; border-bottom-width: 2px; color:#000000; font-family:sans-serif; font-size:14px;'><strong>Send us an Email</strong></td> </tr> <tr> <td nowrap style='font-family:sans-serif;font-size:12px;font-weight:bold' align='right' width='25%'> First Name   : </td> <td width='75%'><input name='visitorf' type='text' size="48" maxlength='40' /></td> </tr> <tr> <td nowrap style='font-family:sans-serif;font-size:12px;font-weight:bold' align='right' width='25%'>Last Name   :</td> <td width='75%'><input name='visitorfl' type='text' size="48" maxlength='80' /></td> </tr> <tr> <td nowrap style= 'font-family:sans-serif;font-size:12px;font-weight:bold' align='right' width='25%'> Email Adress  : </td> <td width='75%'><input name='visitormail' type='text' size="48" maxlength='100' /></td> </tr> <tr> <td nowrap style='font-family:sans-serif;font-size:12px;font-weight:bold' align='right' width='25%'> Phone   : </td> <td width='75%'><input name='visitorphone' type='text' size="48" maxlength='30' /></td> </tr> <td nowrap style='font-family:sans-serif;font-size:12px;font-weight:bold' align='right' width='25%'> Subject   : </td> <td width='75%'><select name="attn" size="1"> <option value=" Investment Opportunities ">Investment Opportunities </option> <option value=" Vacation Rentals ">Vacation Rentals </option> <option value=" Real Estate Offerings ">Real Estate Offerings </option> <option value=" Gatherings ">Gatherings </option> <option value=" General ">General </option> </select></td> <tr> <td nowrap style= 'font-family:sans-serif;font-size:12px;font-weight:bold' align='right' width='25%'> Message   :<br /> <em>(max 5000 char)</em></td> <td width='75%'><textarea name='notes' maxlength='5000' cols="48" rows="3"></textarea></td> </tr> <tr> <td colspan=2 align=center style=''><input name='save' type='submit' class="boton" value=Send mail /> &nbsp; &nbsp; <input type='reset' name='reset' value=Reset class="boton" /></td> </tr> </table></td> </tr> </table> </div> </form> Here is the mail script: <?php //the 3 variables below were changed to use the SERVER variable $ip = $_SERVER['REMOTE_ADDR']; $httpref = $_SERVER['HTTP_REFERER']; $httpagent = $_SERVER['HTTP_USER_AGENT']; $visitorf = $_POST['visitorf']; $visitorl = $_POST['visitorl']; $visitormail = $_POST['visitormail']; $visitorphone = $_POST['visitorphone']; $notes = $_POST['notes']; $attn = $_POST['attn']; //additional headers $headers = 'From: Me <[email protected]>' . "\n" ; $headers = 'Bcc: [email protected]' . "\n"; if (eregi('http:', $notes)) { die ("Do NOT try that! ! "); } if(!$visitormail == "" && (!strstr($visitormail,"@") || !strstr($visitormail,"."))) { echo "<h2>Use Back - Enter valid e-mail</h2>\n"; $badinput = "<h2>Feedback was NOT submitted</h2>\n"; echo $badinput; die ("Go back! ! "); } if(empty($visitorf) || empty($visitormail) || empty($notes )) { echo "<h2>Use Back - fill in all fields</h2>\n"; die ("Use back! ! "); } $todayis = date("l, F j, Y, g:i a") ; $subject = "I want to download the report about $attn"; $notes = stripcslashes($notes); $message = "$todayis [EST] \nAttention: $attn \nMessage: $notes \nFrom: $visitorf $visitorl ($visitormail) \nTelephone Number: $visitorphone \nAdditional Info : IP = $ip \nBrowser Info: $httpagent \nReferral : $httpref\n"; //check if the function even exists if(function_exists("mail")) { //send the email mail($_SESSION['email'], $subject, $message, $headers) or die("could not send email"); } else { die("mail function not enabled"); } header( "Location: http://www.domain.com/thanks.php" ); ?>

    Read the article

  • Use fileupload as template field in a details view

    - by MyHeadHurts
    I have an admin page where a user will select a document path and add that path to a certain column of a database. I am using a fileupload on the page where they can find the document and copy the path and then paste it into the details view. However, I want to skip this step and I want them to select a document and automatically make the path show up in the details view. <asp:FileUpload ID="FileUpload1" runat="server" Visible="False" Width="384px" /><br /> <br /> <div> <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional"> <ContentTemplate> <center> <asp:DetailsView ID="DetailsView1" runat="server" AllowPaging="True" AutoGenerateRows="False" DataKeyNames="ID" DataSourceID="SqlDataSource1" Height="128px" Width="544px" Visible="False" OnModeChanged="Button2_Click" CellPadding="4" ForeColor="#333333" GridLines="None" > <Fields> <asp:BoundField DataField="Order" HeaderText="Order" SortExpression="Order" /> <asp:BoundField DataField="Department" HeaderText="Department" SortExpression="Department"/> <asp:BoundField DataField="DOC_Type" HeaderText="DOC_Type" SortExpression="DOC_Type" /> <asp:BoundField DataField="Title" HeaderText="Title" SortExpression="Title" /> <asp:BoundField DataField="Revision" HeaderText="Revision" SortExpression="Revision" /> <asp:BoundField DataField="DOC" HeaderText="DOC" SortExpression="DOC" /> <asp:BoundField DataField="Active" HeaderText="Active" SortExpression="Active" /> <asp:BoundField DataField="Rev_Date" HeaderText="Rev_Date" SortExpression="Rev_Date" /> <asp:BoundField DataField="ID" HeaderText="ID" InsertVisible="False" ReadOnly="True" SortExpression="ID" Visible="False" /> <asp:CommandField ShowInsertButton="True" /> </Fields> <FooterStyle BackColor="#5D7B9D" BorderStyle="None" Font-Bold="True" ForeColor="White" /> <CommandRowStyle BackColor="#E2DED6" BorderStyle="None" Font-Bold="True" /> <RowStyle BackColor="#F7F6F3" BorderStyle="None" ForeColor="#333333" /> <FieldHeaderStyle BackColor="#E9ECF1" BorderStyle="None" Font-Bold="True" /> <EmptyDataRowStyle BorderStyle="None" /> <PagerStyle BackColor="#284775" BorderStyle="None" ForeColor="White" HorizontalAlign="Center" /> <HeaderStyle BackColor="#5D7B9D" BorderStyle="None" Font-Bold="True" ForeColor="White" /> <InsertRowStyle BorderStyle="None" /> <EditRowStyle BackColor="#999999" BorderStyle="None" /> <AlternatingRowStyle BackColor="White" BorderStyle="None" ForeColor="#284775" /> </asp:DetailsView> &nbsp; <br /> I need to get the fileupload1 into the DOC contenttemplate area so instead of showing an empty textbox it will show just a textbox it will show the fileupload

    Read the article

  • How to keep a local value from being set when a binding fails (so inherited values will propagate)

    - by redoced
    Consider the following scenario: I want to bind the TextElement.FontWeight property to an xml attribute. The xml looks somewhat like this and has arbitrary depth. <text font-weight="bold"> bold text here <inlinetext>more bold text</inlinetext> even more bold text </text> I use hierarchical templating to display the text, no problem there, but having a Setter in the template style like: <Setter Property="TextElement.FontWeight" Value="{Binding XPath=@font-weight}"/> sets the fontweight correctly on the first level, but overwrites the second level with null (as the binding can't find the xpath) which reverts to Fontweight normal. I tried all sorts of things here but nothing quite seems to work. e.g. i used a converter to return UnsetValue, which didn't work. I'm currently trying with: <Setter Property="custom:AttributeInserter.Wrapper" Value="{custom:AttributeInserter Property=TextElement.FontWeight, Binding={Binding XPath=@font-weight}}"/> Codebehind: public static class AttributeInserter { public static AttributeInserterExtension GetWrapper(DependencyObject obj) { return (AttributeInserterExtension)obj.GetValue(WrapperProperty); } public static void SetWrapper(DependencyObject obj, AttributeInserterExtension value) { obj.SetValue(WrapperProperty, value); } // Using a DependencyProperty as the backing store for Wrapper. This enables animation, styling, binding, etc... public static readonly DependencyProperty WrapperProperty = DependencyProperty.RegisterAttached("Wrapper", typeof(AttributeInserterExtension), typeof(AttributeInserter), new UIPropertyMetadata(pcc)); static void pcc(DependencyObject o,DependencyPropertyChangedEventArgs e) { var n=e.NewValue as AttributeInserterExtension; var c = o as FrameworkElement; if (n == null || c==null || n.Property==null || n.Binding==null) return; var bex = c.SetBinding(n.Property, n.Binding); bex.UpdateTarget(); if (bex.Status == BindingStatus.UpdateTargetError) c.ClearValue(n.Property); } } public class AttributeInserterExtension : MarkupExtension { public override object ProvideValue(IServiceProvider serviceProvider) { return this; } public DependencyProperty Property { get; set; } public Binding Binding { get; set; } } which kinda works, but can't track changes of the property Any ideas? Any links? thx for the help

    Read the article

  • Storing HTML formatted text in database

    - by user279521
    I am building a web site similar to Craigslist. I would like to know how to store the html formatted text (bold / italics / font size etc) in a sql 2008 database? In order words, the user would enter their text, format it with font size, bold etc and save the information. Whats the most efficient way to store that in a database?

    Read the article

  • RichTextBox specific colors per few charicters / lines C#

    - by Xavier
    i have say, richTextBox1, and here is the contents: line one from my textbox is this, and i want this to be normal, arial, 8 point non-bold font line two, i want everything after the | to be bolded... | this is bold line three: everything in brackets i (want) to be the color (Red) line 4 is "this line is going to be /slanted/ or with italics and so on, basically if i know how to do what i mentioned above, ill know everything i need to know to complete my project. code examples would be very very much appricaited! :)

    Read the article

  • highlite text parts with jquery, best practice

    - by helle
    Hey guys, i have a list of items containig names. then i have a eventlistener, which ckecks for keypress event. if the user types i.g. an A all names starting with an A should be viewed with the A bold. so all starting As should be bold. what is the best way using jquery to highlite only a part of a string? thanks for your help

    Read the article

  • Why border of <tr> not showing in IE?

    - by metal-gear-solid
    Why border of tfoot tr:first-child not showing in IE. I'm checking in IE7. font-weight:bold; background:yellow is showing in IE but border not table { border-collapse: collapse; border-spacing: 0; } table tfoot tr:first-child {font-weight:bold; background:yellow; border-top:2px solid red; border-bottom:2px solid red;}

    Read the article

  • Displaying text in C# from XML via LINQ

    - by xscape
    Is there a way to display "Test" value as bold just like the implementation of newline? <testElement>Test &#xD; Test</testElement> The output of the above line when you display it is: TEST TEST I want to know what/how to make the second line as bold just line by using expressions. Thank you

    Read the article

  • RichTextBox specific colors per few characters / lines C#

    - by Xavier
    I have richTextBox1, and here is the contents: line one from my textbox is this, and i want this to be normal, arial, 8 point non-bold font line two, i want everything after the | to be bolded... | this is bold line three: everything in brackets i (want) to be the color (Red) line 4 is "this line is going to be /slanted/ or with italics and so on, basically if I know how to do what I mentioned above, I'll know everything I need to know to complete my project. Code examples would be very very much appreciated! :)

    Read the article

  • how to get the content of iframe in a php variable? [closed]

    - by Sahil
    My code is somewhat like this: <?php if($_REQUEST['post']) { $title=$_REQUEST['title']; $body=$_REQUEST['body']; echo $title.$body; } ?> <script type="text/javascript" src="texteditor.js"> </script> <form action="" method="post"> Title: <input type="text" name="title"/><br> <a id="bold" class="font-bold"> B </a> <a id="italic" class="italic"> I </a> Post: <iframe id="textEditor" name="body"></iframe> <input type="submit" name="post" value="Post" /> </form> the texteditor.js file code is: $(document).ready(function(){ document.getElementById('textEditor').contentWindow.document.designMode="on"; document.getElementById('textEditor').contentWindow.document.close(); $("#bold").click(function(){ if($(this).hasClass("selected")) { $(this).removeClass("selected"); }else { $(this).addClass("selected"); } boldIt(); }); $("#italic").click(function(){ if($(this).hasClass("selected")) { $(this).removeClass("selected"); }else { $(this).addClass("selected"); } ItalicIt(); }); }); function boldIt(){ var edit = document.getElementById("textEditor").contentWindow; edit.focus(); edit.document.execCommand("bold", false, ""); edit.focus(); } function ItalicIt(){ var edit = document.getElementById("textEditor").contentWindow; edit.focus(); edit.document.execCommand("italic", false, ""); edit.focus(); } function post(){ var iframe = document.getElementById("body").contentWindow; } actualy i want to fetch data from this texteditor (which is created using iframe and javascript) and store it in some other place. i'm not able to fetch the content that is entered in the editor (i.e. iframe here). please help me out of this....

    Read the article

  • PHP split content when a HTML element is found

    - by sea_1987
    Hello, I have a PHP variable that holds some HTML I wanting to be able to split the variable into two pieces, and I want the spilt to take place when a second bold <strong> or <b> is found, essentially if I have content that looks like this, My content This is my content. Some more bold content, that would spilt into another variable. is this at all possible?

    Read the article

< Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >