Search Results

Search found 246 results on 10 pages for 'addhandler'.

Page 1/10 | 1 2 3 4 5 6 7 8 9 10  | Next Page >

  • Conditional AddHandler Directive

    - by Itai
    Is it possible to conditionally call AddHandler in the .htaccess under Apache (2.x)? My present situation requires that a certain AddHandler is needed by one production server but that one breaks the development server. This requires to have 2 versions of .htaccess which is pain. So, instead I would like to wrap one AddHandler within a conditional. Something of this sort: IF IP=='1.2.3.4' THEN AddHandler type/foo .ext ENDIF The problem is new but out of my control for now. I know this is far from ideal and the servers used to match 100% as they should but temporarily they cannot.

    Read the article

  • AddHandler not working?

    - by EdenMachine
    I can't figure out why my addhandler is not firing? In the Sub "CreateTagStyle" thd AddHandler is to firing when the LinkButton is clicked Is there some reason that addhandlers can't be adding at certain points of the page lifecycle? <%@ Page Title="" Language="VB" MasterPageFile="~/_Common/Admin.master" %> <script runat="server"> Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) End Sub Protected Sub RadGrid1_NeedDataSource(ByVal source As Object, ByVal e As Telerik.Web.UI.GridNeedDataSourceEventArgs) If Not e.IsFromDetailTable Then Dim forms As New MB.RequestFormPacket() RadGrid1.DataSource = forms.GetPackets() End If End Sub Protected Sub RadGrid1_DetailTableDataBind(ByVal source As Object, ByVal e As Telerik.Web.UI.GridDetailTableDataBindEventArgs) Select Case e.DetailTableView.Name Case "gtvForms" Dim PacketID As Guid = e.DetailTableView.ParentItem.GetDataKeyValue("ID") e.DetailTableView.DataSource = MB.RequestForm.GetRequestForms(PacketID) End Select End Sub Protected Sub RadGrid1_InsertCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) If IsValid Then Select Case TryCast(e.Item.NamingContainer.NamingContainer, GridTableView).Name Case "gtvPackets" Dim rtbName As RadTextBox = TryCast(e.Item.FindControl("rtbName"), RadTextBox) Dim IsActive As Boolean = TryCast(e.Item.FindControl("cbxIsActive"), CheckBox).Checked Dim packet As New MB.RequestFormPacket() packet.Name = rtbName.Text packet.IsActive = IsActive packet.Insert() e.Canceled = True e.Item.OwnerTableView.IsItemInserted = False RadGrid1.Rebind() System.Web.UI.ScriptManager.RegisterStartupScript(Me.Page, Me.GetType(), "ClientMessage", "SuccessMessage('Request Form Packet has been added successfully.');", True) Case "gtvForms" Dim parentItem As GridDataItem = e.Item.OwnerTableView.ParentItem Dim rcbForms As RadComboBox = TryCast(e.Item.FindControl("rcbForms"), RadComboBox) Dim rf As New MB.RequestForm() rf.RequestFormPacketID = CType(parentItem.OwnerTableView.DataKeyValues(parentItem.ItemIndex)("ID"), Guid) rf.FormID = rcbForms.SelectedValue If MB.RequestFormPacket.HasItems(rf.RequestFormPacketID) Then rf.SortOrder = rf.MaxSortOrder + 1 Else rf.SortOrder = 0 End If rf.Insert() e.Canceled = True e.Item.OwnerTableView.IsItemInserted = False TryCast(e.Item.NamingContainer.NamingContainer, GridTableView).Rebind() End Select End If End Sub Protected Sub RadGrid1_UpdateCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) If IsValid Then Select Case TryCast(e.Item.NamingContainer, GridTableView).Name Case "gtvPackets" Dim PacketID As Guid = CType(CType(e.CommandSource, Button).NamingContainer, GridEditFormItem).GetDataKeyValue("ID") Dim Name As String = TryCast(e.Item.FindControl("rtbName"), RadTextBox).Text Dim Tags As String = TryCast(e.Item.FindControl("hdnTags"), HiddenField).Value Dim IsActive As Boolean = TryCast(e.Item.FindControl("cbxIsActive"), CheckBox).Checked Dim rfp As New MB.RequestFormPacket() rfp.Update(PacketID, Name, IsActive) Call MB.RequestFormPacketTag.Insert(PacketID, Tags) e.Item.Edit = False TryCast(e.Item.NamingContainer, GridTableView).Rebind() System.Web.UI.ScriptManager.RegisterStartupScript(Me.Page, Me.GetType(), "ClientMessage", "SuccessMessage('Request Form Packet has been updated successfully.');", True) Case "gtvForms" Dim RequestFormID As Guid = CType(CType(e.CommandSource, Button).NamingContainer, GridEditFormItem).GetDataKeyValue("ID") Dim rcbForms As RadComboBox = TryCast(e.Item.FindControl("rcbForms"), RadComboBox) Dim rf As New MB.RequestForm() rf.Update(RequestFormID, rcbForms.SelectedValue) e.Item.Edit = False TryCast(e.Item.NamingContainer, GridTableView).Rebind() End Select End If End Sub Protected Sub RadGrid1_DeleteCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Dim editedItem As GridEditableItem = TryCast(e.Item, GridEditableItem) Select Case CType(editedItem.Parent.Parent, GridTableView).Name Case "gtvPackets" Dim ID As Guid = CType(CType(e.CommandSource, ImageButton).NamingContainer, GridDataItem).GetDataKeyValue("ID") MB.RequestFormPacket.Delete(ID) System.Web.UI.ScriptManager.RegisterStartupScript(Me.Page, Me.GetType(), "ClientMessage", "NotifyMessage('Request Form Packet has been deleted.');", True) Case "gtvForms" Dim ID As Guid = CType(CType(e.CommandSource, ImageButton).NamingContainer, GridDataItem).GetDataKeyValue("ID") MB.RequestForm.Delete(ID) System.Web.UI.ScriptManager.RegisterStartupScript(Me.Page, Me.GetType(), "ClientMessage", "NotifyMessage('Request Form has been removed.');", True) End Select End Sub Protected Sub ibnItemUpArrow_Command(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.CommandEventArgs) Dim gtv As GridTableView = CType(CType(sender, ImageButton).NamingContainer.NamingContainer, GridTableView) Dim ID As Guid = New Guid(e.CommandArgument.ToString()) Call MB.RequestForm.MoveUp(ID) gtv.Rebind() End Sub Protected Sub ibnItemDownArrow_Command(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.CommandEventArgs) Dim gtv As GridTableView = CType(CType(sender, ImageButton).NamingContainer.NamingContainer, GridTableView) Dim ID As Guid = New Guid(e.CommandArgument.ToString()) Call MB.RequestForm.MoveDown(ID) gtv.Rebind() End Sub Protected Sub RadGrid1_RowDrop(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridDragDropEventArgs) If String.IsNullOrEmpty(e.HtmlElement) Then If e.DraggedItems(0).OwnerGridID = RadGrid1.ClientID Then If e.DestDataItem IsNot Nothing Then Dim gtv As GridTableView = CType(e.DestDataItem.NamingContainer, GridTableView) For Each gdi As GridDataItem In e.DraggedItems Select Case gtv.Name Case "gtvForms" MB.RequestForm.DragAndDropReorder(gdi.GetDataKeyValue("ID"), e.DestDataItem.GetDataKeyValue("ID"), IIf(e.DropPosition = GridItemDropPosition.Above, True, False)) gtv.Rebind() End Select Next End If End If End If End Sub Protected Sub cbxAllowDragAndDrop_CheckedChanged(ByVal sender As Object, ByVal e As System.EventArgs) Dim cbx As CheckBox = CType(sender, CheckBox) If cbx.Checked Then RadGrid1.ClientSettings.AllowRowsDragDrop = True RadGrid1.ClientSettings.Selecting.AllowRowSelect = True RadGrid1.ClientSettings.Selecting.EnableDragToSelectRows = True Else RadGrid1.ClientSettings.AllowRowsDragDrop = False RadGrid1.ClientSettings.Selecting.AllowRowSelect = False RadGrid1.ClientSettings.Selecting.EnableDragToSelectRows = False End If End Sub Protected Sub ibnDisableToggleProcess_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Dim ibn As ImageButton = CType(sender, ImageButton) Dim hdn As HiddenField = CType(ibn.NamingContainer.FindControl("hdnDisableProcessID"), HiddenField) Dim status As Boolean = MB.RequestFormPacket.ActivateToggle(New Guid(hdn.Value)) Dim gtv As GridTableView = CType(ibn.NamingContainer.NamingContainer, GridTableView) gtv.Rebind() System.Web.UI.ScriptManager.RegisterStartupScript(Me.Page, Me.GetType(), "ClientMessage", "SuccessMessage('Process has been " & IIf(status, "Activated", "Deactivated") & ".');", True) End Sub Protected Function DisplayTagList(ByVal tags As IEnumerable(Of MB.RequestFormPacketTag)) As String Dim list As String = "" For Each t As MB.RequestFormPacketTag In tags list += "<span class=""tags"">" & t.Tag.Name & "</span>" Next Return list End Function Protected Sub RadGrid1_ItemDataBound(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Select Case e.Item.GetType.Name Case "GridEditFormInsertItem" 'do nothing Case "GridEditFormItem" Dim plh As PlaceHolder = CType(e.Item.FindControl("plhTags"), PlaceHolder) Dim hdn As HiddenField = CType(e.Item.FindControl("hdnTags"), HiddenField) If hdn IsNot Nothing Then Dim gefi As GridEditFormItem = e.Item Dim packet As MB.RequestFormPacket = gefi.DataItem For Each pt As MB.RequestFormPacketTag In packet.RequestFormPacketTags Call CreateTagStyle(plh, hdn, pt.Tag.Name) If hdn.Value = "" Then hdn.Value = "|" End If hdn.Value += pt.Tag.Name & "|" Next End If End Select End Sub Protected Sub btnAddTag_Click(ByVal sender As Object, ByVal e As System.EventArgs) Dim btnAddTag As Button = sender Dim rtbTags As RadTextBox = btnAddTag.NamingContainer.FindControl("rtbTags") Dim plhTags As PlaceHolder = btnAddTag.NamingContainer.FindControl("plhTags") Dim hdnTags As HiddenField = btnAddTag.NamingContainer.FindControl("hdnTags") Dim TagExists As Boolean = False rtbTags.Text = rtbTags.Text.ToUpper().Trim() Dim currentTags() As String = Split(hdnTags.Value, "|") For i As Integer = 1 To currentTags.Count - 2 Call CreateTagStyle(plhTags, hdnTags, currentTags(i)) Next If TagExists = False And String.IsNullOrEmpty(rtbTags.Text) = False Then Call CreateTagStyle(plhTags, hdnTags, rtbTags.Text) If String.IsNullOrEmpty(hdnTags.Value) Then hdnTags.Value = "|" End If hdnTags.Value += rtbTags.Text & "|" 'System.Web.UI.ScriptManager.RegisterStartupScript(Me.Page, Me.GetType(), "ClientMessage", "highlightTag('" & lbn.ClientID & "');", True) End If rtbTags.Text = "" rtbTags.Focus() End Sub Public Sub RemoveTag(ByVal sender As Object, ByVal e As EventArgs) Response.End() Dim lbnSender As LinkButton = sender Dim plhTags As PlaceHolder = lbnSender.NamingContainer.FindControl("plhTags") Dim hdnTags As HiddenField = lbnSender.NamingContainer.FindControl("hdnTags") Response.Write(hdnTags.Value) Response.End() Dim TagExists As Boolean = False Dim currentTags() As String = Split(hdnTags.Value, "|") For i As Integer = 1 To currentTags.Count - 2 Call CreateTagStyle(plhTags, hdnTags, currentTags(i)) Next End Sub Protected Sub CreateTagStyle(ByVal plh As PlaceHolder, ByVal hdn As HiddenField, ByVal tagName As String) Dim lbn As New LinkButton() lbn.ID = "lbn_" & hdn.ClientID & "_" & tagName lbn.CssClass = "deleteCreateTag" lbn.Text = "X" AddHandler lbn.Click, AddressOf RemoveTag plh.Controls.Add(New LiteralControl("<div><span class=showTag>" & tagName & "</span>")) plh.Controls.Add(lbn) plh.Controls.Add(New LiteralControl("</div>")) End Sub </script> <asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server"> <style type="text/css"> .tags { border:solid 1px #93AFE5; background-color:#F3F7F8; margin: 0px 2px 0px 2px; padding: 0px 4px 0px 4px; font-family:Verdana; font-size:10px; text-transform:uppercase; } </style> <script type="text/javascript"> function highlightTag(id) { $("#" + id).highlightFade({ color: '#FFFF99', speed: 2000, iterator: 'sinusoidal' }); } </script> </asp:Content> <asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"> <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" DefaultLoadingPanelID="RadAjaxLoadingPanel1" EnableAJAX="false"> <AjaxSettings> <telerik:AjaxSetting AjaxControlID="RadGrid1"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="RadGrid1" /> </UpdatedControls> </telerik:AjaxSetting> </AjaxSettings> </telerik:RadAjaxManager> <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" /> <telerik:RadTabStrip ID="RadTabStrip1" runat="server" Skin="WebBlue" style="position:relative;top:1px;" ValidationGroup="vgTabs"> <Tabs> <telerik:RadTab Text="Request Form Packets" Selected="true" ImageUrl="~/Admin/Images/Packet2.png" /> <telerik:RadTab Text="Request Forms" NavigateUrl="Forms.aspx" ImageUrl="~/Admin/Images/Forms.png" /> </Tabs> </telerik:RadTabStrip> <asp:ObjectDataSource ID="odsForms" runat="server" TypeName="MB.Form" SelectMethod="GetForms" /> <asp:Panel ID="pnlContent" runat="server" CssClass="ContentPanel"> <telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="True" AllowSorting="True" GridLines="None" OnNeedDataSource="RadGrid1_NeedDataSource" AllowAutomaticUpdates="true" AllowAutomaticDeletes="true" AllowAutomaticInserts="true" OnInsertCommand="RadGrid1_InsertCommand" OnUpdateCommand="RadGrid1_UpdateCommand" OnDeleteCommand="RadGrid1_DeleteCommand" OnRowDrop="RadGrid1_RowDrop" OnDetailTableDataBind="RadGrid1_DetailTableDataBind" OnItemDataBound="RadGrid1_ItemDataBound"> <%-----------------------------------------------------------%> <%------------------------- PACKETS -------------------------%> <%-----------------------------------------------------------%> <MasterTableView AutoGenerateColumns="False" DataKeyNames="ID" ClientDataKeyNames="ID" ShowHeadersWhenNoRecords="true" Name="gtvPackets" NoMasterRecordsText="There are currently no Request Form Packets" GroupLoadMode="Client" RetrieveNullAsDBNull="true" CommandItemDisplay="Top" AllowAutomaticUpdates="true" AllowAutomaticDeletes="true" AllowAutomaticInserts="true"> <RowIndicatorColumn> <HeaderStyle Width="20px"></HeaderStyle> </RowIndicatorColumn> <ExpandCollapseColumn> <HeaderStyle Width="20px"></HeaderStyle> </ExpandCollapseColumn> <CommandItemTemplate> <table width="100%"> <tr> <td class="AdminGridHeader">&nbsp;<img src="../Admin/Images/Packet2.png" align="absmiddle" width="16" height="16" />&nbsp;&nbsp;Request Form Packets</td> <td width="1%"><asp:CheckBox ID="cbxAllowDragAndDrop" runat="server" AutoPostBack="true" OnCheckedChanged="cbxAllowDragAndDrop_CheckedChanged" /></td> <td width="1%" nowrap="nowrap"><asp:Label AssociatedControlID="cbxAllowDragAndDrop" ID="Label1" runat="server" Text="Enable Drag and Drop Reordering" ToolTip="Drag and Drop Reordering applies only to Forms." /></td> <td align="right" width="1%"><asp:Button ID="btnAddPacket" Text="Create New Packet" runat="server" CommandName="InitInsert" /></td> </tr> </table> </CommandItemTemplate> <EditFormSettings> <EditColumn ButtonType="PushButton" HeaderStyle-Font-Bold="true" UniqueName="EditCommandColumn" /> </EditFormSettings> <EditItemStyle Font-Bold="true" BackColor="#FFFFCC" /> <Columns> <telerik:GridTemplateColumn HeaderText="Packet Name" UniqueName="PacketName" SortExpression="Name"> <ItemTemplate> <img src="../Admin/Images/Packet2.png" align="absmiddle" width="16" height="16" />&nbsp;&nbsp;<%#Eval("Name")%> </ItemTemplate> <EditItemTemplate> <telerik:RadTextBox runat="server" ID="rtbName" Width="300" Text='<%# Bind("Name") %>' /> <asp:RequiredFieldValidator ID="rfvName" runat="server" ErrorMessage="Required" ControlToValidate="rtbName" /> </EditItemTemplate> </telerik:GridTemplateColumn> <telerik:GridTemplateColumn HeaderText="Tags" UniqueName="Tags"> <ItemTemplate> <%#DisplayTagList(Eval("RequestFormPacketTags"))%> </ItemTemplate> <EditItemTemplate> <asp:Panel ID="pnlAddTags" runat="server" DefaultButton="btnAddTag"> <table cellpadding="0" cellspacing="0"> <tr> <td> <telerik:RadTextBox ID="rtbTags" runat="server" Width="200" style="text-transform:uppercase;" /> <asp:RegularExpressionValidator ID="revTags" runat="server" ErrorMessage="Invalid Entry" ControlToValidate="rtbTags" Display="Dynamic" ValidationExpression="^[^<>`~!/@\#}$%:;)(_^{&*=|+]+$" ValidationGroup="vgTags" /> </td> <td> <asp:Button ID="btnAddTag" runat="server" ValidationGroup="vgTags" Text="Add" OnClick="btnAddTag_Click" /> </td> </tr> </table> </asp:Panel> <div id="divTags"> <asp:PlaceHolder id="plhTags" runat="server" /> <asp:HiddenField ID="hdnTags" runat="server" /> </div> </EditItemTemplate> </telerik:GridTemplateColumn> <telerik:GridTemplateColumn HeaderTooltip="Disable" ItemStyle-Width="1%" ItemStyle-HorizontalAlign="Center" SortExpression="IsActive" UniqueName="IsActive" ReadOnly="true"> <ItemTemplate> <asp:ImageButton ID="ibnDisabledProcess" runat="server" ImageUrl="../Images/Icons/Stop.png" Width="16" OnClientClick="return window.confirm('Activate this Process?');" ToolTip="Click to activate this Request for Account use." Visible='<%#IIF(Eval("IsActive"),false,true) %>' OnClick="ibnDisableToggleProcess_Click" /> <asp:ImageButton ID="ibnEnabledProcess" runat="server" ImageUrl="../Images/Icons/Stop_disabled.png" Width="16" OnClientClick="return window.confirm('Deactivate this Process?');" ToolTip="Click to deactivate this Request for Account use." Visible='<%#IIF(Eval("IsActive"),true,false) %>' OnClick="ibnDisableToggleProcess_Click" /> <asp:HiddenField ID="hdnDisableProcessID" runat="server" Value='<%#Eval("ID") %>' /> </ItemTemplate> </telerik:GridTemplateColumn> <telerik:GridTemplateColumn HeaderText="Is Active" UniqueName="IsActiveCheckbox" Display="false"> <EditItemTemplate> <asp:CheckBox ID="cbxIsActive" runat="server" Checked='<%# IIF(Eval("IsActive") Is DbNull.Value OrElse Eval("IsActive") = False,False,True) %>' /> </EditItemTemplate> </telerik:GridTemplateColumn> <telerik:GridEditCommandColumn ButtonType="ImageButton" EditText="Edit Admin" ItemStyle-Width="16" EditImageUrl="~/Images/edit-small.png" /> <telerik:GridButtonColumn ConfirmText="Do you really want to delete this Admin? WARNING: THIS CANNOT BE UNDONE!!" ConfirmDialogType="RadWindow" ConfirmTitle="Delete" ButtonType="ImageButton" CommandName="Delete" Text="Delete Admin" ImageUrl="~/Images/Delete.png" UniqueName="DeleteColumn"> <ItemStyle HorizontalAlign="Center" Width="16" /> </telerik:GridButtonColumn> </Columns> <DetailTables> <%-----------------------------------------------------------%> <%-------------------------- FORMS --------------------------%> <%-----------------------------------------------------------%> <telerik:GridTableView Name="gtvForms" AllowPaging="true" PagerStyle-Position="TopAndBottom" PageSize="20" AutoGenerateColumns="false" DataKeyNames="RequestFormPacketID,ID" runat="server" CommandItemDisplay="Top" Width="100%"> <ParentTableRelation> <telerik:GridRelationFields DetailKeyField="RequestFormPacketID" MasterKeyField="ID" /> </ParentTableRelation> <CommandItemTemplate> <table width="100%" class="AdminGridHeaders"> <tr> <td class="AdminGridHeaders"> &nbsp;<img src="../Admin/Images/Forms.png" align="absmiddle" width="16" height="16" />&nbsp;&nbsp;Forms </td> <td align="right"> <asp:Button ID="ibnAdd" runat="server" Text="Add Form" CommandName="InitInsert" /> </td> </tr> </table> </CommandItemTemplate> <EditFormSettings> <EditColumn ButtonType="PushButton" InsertText="Save" UpdateText="Update" CancelText="Cancel" /> </EditFormSettings> <EditItemStyle Font-Bold="true" BackColor="#FFFFCC" /> <Columns> <telerik:GridTemplateColumn HeaderText="Form Name" UniqueName="FormName"> <ItemTemplate> <img src="../Admin/Images/Forms.png" align="absmiddle" width="16" height="16" style="margin-right:4px;" /> <%#Eval("Form.Name")%> </ItemTemplate> <EditItemTemplate> <telerik:RadComboBox ID="rcbForms" runat="server" DataSourceID="odsForms" AppendDataBoundItems="true" DataTextField="Name" DataValueField="ID" SelectedValue='<%#Bind("FormID")%>'> <Items> <telerik:RadComboBoxItem Text="-- Select a Form --" Value="" /> </Items> </telerik:RadComboBox> <asp:RequiredFieldValidator ID="rfvForms" runat="server" ErrorMessage="Required" ControlToValidate="rcbForms" InitialValue="-- Select a Form --" Display="Dynamic" /> </EditItemTemplate> </telerik:GridTemplateColumn> <telerik:GridTemplateColumn HeaderText="Test" ReadOnly="true" UniqueName="TestForm" HeaderStyle-Width="1%" ItemStyle-HorizontalAlign="Center"> <ItemTemplate> <asp:HyperLink ID="hypTestForm" runat="server" NavigateUrl='<%# "FormsPreview.aspx?fid=" & Eval("FormID").ToString() & "&test=true" %>' Target="_blank"><asp:Image ID="imgTestProcess" runat="server" ImageUrl="~/Admin/Images/Test.png" ImageAlign="AbsMiddle" ToolTip="Test Form" /></asp:HyperLink> </ItemTemplate> </telerik:GridTemplateColumn> <telerik:GridTemplateColumn HeaderText="Header" SortExpression="Header" UniqueName="Header"> <ItemTemplate> <%#Eval("Form.Header")%>&nbsp; </ItemTemplate> </telerik:GridTemplateColumn> <telerik:GridTemplateColumn ReadOnly="true" ItemStyle-HorizontalAlign="Center" HeaderStyle-Width="1%" HeaderStyle-Wrap="false" ItemStyle-Wrap="false" UniqueName="SortOrder"> <ItemTemplate> <asp:ImageButton ID="ibnItemUpArrow" runat="server" Width="16" height="16" ImageUrl="~/Admin/Images/ArrowUp.png" ImageAlign="AbsMiddle" Visible='<%#IIF(Eval("SortOrder") = 0,false,true) %>' CommandArgument='<%#Eval("ID") %>' OnCommand=

    Read the article

  • Understanding AddHandler and pass delegates and events.

    - by Achilles
    I am using AddHandler to wire a function to a control's event that I dynamically create: Public Sub BuildControl(EventHandler as System.Delegate) dim objMyButton as new button AddHandler objMyButton.Click, EventHandler end Sub This code is generating a run-time exception stating: Unable to cast object of type 'MyEventHandlerDelegate' to type 'System.EventHandler' What am I not understanding about System.Delegate even though AddHandler takes as an argument of type "System.Delegate"? What Type does "EventHandler need to be to cast to a type that AddHandler can accept? Thanks for your help!

    Read the article

  • Create a dynamic control and AddHandle WITH Values/Brackets

    - by Jacob Kofoed
    Hi, it seems that adding for example a button Dim myButton as New Button and then addHandler to mySub("lol", 255) is not possible. Where mySub is Shared Sub MySub(byRef myString as string, myInteger as Integer) So: addHandler myButton.click, addressOf mySub("lol", 255) - returns an error saying it does not work with parentheses or whatever. I somehow see why this might not be possible, so I'm looking for a work-around on this problem. Please help _jakeCake

    Read the article

  • How can I enable PHP5 for a site? Having problems with every single method.

    - by user347662
    I'm working on a client site that is hosted on someone's DIY Debian Linux server [Apache/1.3.33 (Debian GNU/Linux)], and I'm trying to install a script that requires PHP5. By default, the server parses .php files with PHP 4.3.10-22, which is configured at /etc/php4/apache/php.ini, according to phpinfo(). On the server I can see a config directory for PHP5 adjacent to the PHP4 directory: /etc/php5.0/apache2/php.ini. I have tried multiple methods to enable PHP5 for the document root where the site's files are hosted, including all available methods mentioned here. By far, the most common suggestion I've found is to add one or both of the following lines to the site's .htaccess file: AddHandler application/x-httpd-php5 .php AddType application/x-httpd-php5 .php Trouble is, when either or both of those lines are present, the site forces my browser to download any .php files requested, without parsing the PHP at all. All of the other methods mentioned in the above article cause a 500 Internal Server Error. There is no hosting control panel I can access in a browser to enable PHP5 for the site, but I do have shell access. When I asked the server administrator about this issue, he encouraged me to search for the answer on Google. Where could I begin to troubleshoot this issue? Are there ways to test or verify the server's specific PHP5 installation and configuration, using the command line or some other method? Do you have other suggestions to enable PHP5?

    Read the article

  • Is it right that Strophe.addHandler reads only first node from response?

    - by markcial
    I'm starting to learn strophe library usage and when i use addHandler to parse response it seems to read only first node of xml response so when i receive a xml like that : <body xmlns='http://jabber.org/protocol/httpbind'> <presence xmlns='jabber:client' from='test2@localhost' to='test2@localhost' type='avaliable' id='5593:sendIQ'> <status/> </presence> <presence xmlns='jabber:client' from='test@localhost' to='test2@localhost' xml:lang='en'> <status /> </presence> <iq xmlns='jabber:client' from='test2@localhost' to='test2@localhost' type='result'> <query xmlns='jabber:iq:roster'> <item subscription='both' name='test' jid='test@localhost'> <group>test group</group> </item> </query> </iq> </body> With the handler testHandler used like that : connection.addHandler(testHandler,null,"presence"); function testHandler(stanza){ console.log(stanza); } It only logs : <presence xmlns='jabber:client' from='test2@localhost' to='test2@localhost' type='avaliable' id='5593:sendIQ'> <status/> </presence> What i am missing? is it a right behaviour? Should i add more handlers to get the other stanzas? Thanks for advance

    Read the article

  • Apache is not interpreting .PHP files

    - by Ala ABUDEEB
    I recently downloaded OpenSUSE OS version 11.4 from the site to use it as a server..In order to do that I downloaded the server edition that has Apache/2.2.17 and PHP5 downloaded by default.....Ok till now it is fine Now I started the Apache successfully and put a test.php file in the documentRoot directory. test.php contain only <?php phpinfo() ?> Then using my browser I typed http://localhost/test.php and here was the problem the browser didn't display what phpinfo() should display, instead it asked me whether I want to open or save test.php...which is driving me crazy.... I googled a lot but no solution THis is /etc/apache2/conf.d/php5.conf (IfModule mod_php5.c) AddHandler application/x-httpd-php .php4 AddHandler application/x-httpd-php .php5 AddHandler application/x-httpd-php .php AddHandler application/x-httpd-php-source .php4s AddHandler application/x-httpd-php-source .php5s AddHandler application/x-httpd-php-source .phps DirectoryIndex index.php4 DirectoryIndex index.php5 DirectoryIndex index.php (/IfModule)

    Read the article

  • 403 error on index file

    - by John L.
    When I try to access index.py in my server root through http://domain/, I get a 403 Forbidden error, but when I can access it through http://domain/index.py. In my server logs it says "Options ExecCGI is off in this directory: /var/www/index.py". However, my httpd.conf entry for that directory is the same as the ones for other directories, and getting to index.py works fine. My permissions are set to 755 for index.py. I also tried making a php file and naming it index.php, and it works from both domain/ and domain/index.php. Here is my httpd.conf entry: <Directory /var/www> Options Indexes Includes FollowSymLinks MultiViews AllowOverride All Order allow,deny Allow from all AddHandler cgi-script .cgi AddHandler cgi-script .pl AddHandler cgi-script .py Options +ExecCGI DirectoryIndex index.html index.php index.py </Directory> Thanks

    Read the article

  • make a custom apache handler (for multiple php versions)

    - by user10580
    ive succesfully installed php 5.2 and it runs as CGI. ultimatly i want to put something like AddHandler application/x-httpd-php52 in the htaccess file of the dir i want to run it on. however, this only really works in the virtual hosts because i cant wrap my head around how to deifne a custom handler. <FilesMatch "\.php"> SetHandler application/x-httpd-php5 </FilesMatch> ScriptAlias /php52-cgi /usr/lib/cgi-bin/php52-cgi Action application/x-httpd-php5 /php52-cgi AddHandler application/x-httpd-php5 .php How can i do somthing like AddHandler application/x-httpd-php52 in the htaccess?

    Read the article

  • How to create an exception folder in a django site?

    - by ninja123
    There are a few folders where I house my django site that I want to be rendered as it would on any other non-django site. Namely, forum (vbulletin) and cpanel. I currently run the site with fastcgi. My .htaccess looks like this: AddHandler application/x-httpd-php5 .htm AddHandler application/x-httpd-php5 .html AddHandler fastcgi-script .fcgi Options +FollowSymLinks RewriteEngine On RewriteBase / AddHandler application/x-httpd-php5 .htm RewriteCond %{REQUEST_URI} !(mysite.fcgi) RewriteRule ^(.*)$ mysite.fcgi/$1 [QSA,L] What are lines I can add so www.mysite.com/forum can not be picked up by django url and be rendered as it would do normally. Thanks.

    Read the article

  • Apache htaccess results in files being downloaded instead of displayed

    - by chrissik
    So I had this "beautiful" website that did exactly what I wanted it to do. Then I shut down my PC, reboot and...the pages just download now instead of being displayed. I re-installed XAMPP and launched Apache again and I was able to identify the .htaccess file as the cause of the problem. Options +FollowSymlinks RewriteEngine on RewriteCond %{QUERY_STRING} !^desktop RewriteCond %{HTTP_USER_AGENT} "android|blackberry|googlebot-mobile|iemobile|iphone|ipod|#opera mobile|palmos|webos" [NC] RewriteRule ^/?$ /mobile/index [L,R=302] RewriteRule ^/?$ /de/index [R] RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME}\.html -f RewriteRule ^(.*)$ $1.html Here is the problem I guess: RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME}\.html -f RewriteRule ^(.*)$ $1.html This should make it possible to use /de/index instead of /de/index.html - but somehow it causes the page to download if I open localhost/de/index (but with localhost/de/index.html it works fine...). I'm using HTML Sites with SSI Elements on a Apache web server. The only other file that is different to the out-of-the-box ones is the httpd.conf, where I enabled SSI: AddType text/html .shtml AddHandler server-parsed .shtml AddHandler server-parsed .html AddHandler server-parsed .htm Options Indexes FollowSymLinks Includes AddOutputFilter INCLUDES .shtml Options +Includes So I hope there is somebody among you that can help me with this annoying problem as I'm quite desperate... for some reason, even without the problematic lines Chrome keeps downloading the files (even if I delete the .htaccess file), while IE and Opera display the pages. Edit: Now Opera also wants to download files (whether index.html or index are called).

    Read the article

  • XAML | When used XamlReader.Parse, not able to refer the items using the LogicalTreeHelper/VisualTre

    - by Roopesh
    Hi, I am setting the dynamic xaml (I am reading the xaml from the DB) for the content of a tab using the below statement. Tab.Content = XamlReader.Parse(xaml, ctx) After setting the content, if I try getting the children using the VisualTreeHelper, but I am not able to get. How ever I dont have this issue when I construct the xaml statically. Here is the code to reading the xaml. Dim XmlDocument = New XmlDataDocument() Dim IID As String = Nothing Dim xaml As String = Nothing Dim Tab As New TabItem Dim TempPanel As XmlNode = Nothing 'Tab.Height = 0 Try XmlDocument.Load(Directory.GetCurrentDirectory & "\Xml\AppFile.xml") pXmlDoc = XmlDocument xaml = XmlDocument.SelectSingleNode("//Grid").OuterXml Dim AsmName As String = System.Reflection.Assembly.GetExecutingAssembly().GetName().Name Dim ctx As ParserContext = New ParserContext() ' New ParserContext() ctx.XamlTypeMapper = New XamlTypeMapper(New String() {AsmName}) ctx.XamlTypeMapper.AddMappingProcessingInstruction("src", "WpfToolkitDataGridTester", AsmName) ctx.XmlnsDictionary.Add("", "http://schemas.microsoft.com/winfx/2006/xaml/presentation") ctx.XmlnsDictionary.Add("x", "http://schemas.microsoft.com/winfx/2006/xaml") ctx.XmlnsDictionary.Add("src", "clr-namespace:WpfToolkitDataGridTester;assembly=" + AsmName) Tab.Name = "Tab" & Grid1Tab.Items.Count + 1 Tab.Header = "AppFile-1" Tab.BorderThickness = New Thickness(0) Tab.IsSelected = True Tab.Content = XamlReader.Parse(xaml, ctx) Grid1Tab.Items.Add(Tab) Return True Catch ex As Exception Throw End Try Here is the code to access the item after constructing the XAML. For i As Integer = 0 To VisualTreeHelper.GetChildrenCount(myVisual) - 1 Dim childVisual As Visual = CType(VisualTreeHelper.GetChild(myVisual, i), Visual) Select Case childVisual.DependencyObjectType.Name Case "ComboBox" AddHandler CType(childVisual, ComboBox).SelectionChanged, AddressOf ComboBox_SelectChanged Case "CheckBox" AddHandler CType(childVisual, CheckBox).Checked, AddressOf CheckBoxClicked AddHandler CType(childVisual, CheckBox).Unchecked, AddressOf CheckBoxClicked Case "RadioButton" AddHandler CType(childVisual, RadioButton).Checked, AddressOf CheckBoxClicked Case "TabControl" For Each item As System.Windows.Controls.TabItem In CType(childVisual, TabControl).Items EnumVisual(item.Content) Next End Select EnumVisual(childVisual) Next i any help is highly appreciated. Thanks,

    Read the article

  • Custom Event - invokation list implementation considerations

    - by M.A. Hanin
    I'm looking for some pointers on implementing Custom Events in VB.NET (Visual Studio 2008, .NET 3.5). I know that "regular" (non-custom) Events are actually Delegates, so I was thinking of using Delegates when implementing a Custom Event. On the other hand, Andrew Troelsen's "Pro VB 2008 and the .NET 3.5 Platform" book uses Collection types in all his Custom Events examples, and Microsoft's sample codes match that line of thought. So my question is: what considerations should I have when choosing one design over the other? What are the pros and cons for each design? Which of these resembles the inner-implementation of "regular" events? Below is a sample code demonstrating the two designs. Public Class SomeClass Private _SomeEventListeners As EventHandler Public Custom Event SomeEvent As EventHandler AddHandler(ByVal value As EventHandler) _SomeEventListeners = [Delegate].Combine(_SomeEventListeners, value) End AddHandler RemoveHandler(ByVal value As EventHandler) _SomeEventListeners = [Delegate].Remove(_SomeEventListeners, value) End RemoveHandler RaiseEvent(ByVal sender As Object, ByVal e As System.EventArgs) _SomeEventListeners.Invoke(sender, e) End RaiseEvent End Event Private _OtherEventListeners As New List(Of EventHandler) Public Custom Event OtherEvent As EventHandler AddHandler(ByVal value As EventHandler) _OtherEventListeners.Add(value) End AddHandler RemoveHandler(ByVal value As EventHandler) _OtherEventListeners.Remove(value) End RemoveHandler RaiseEvent(ByVal sender As Object, ByVal e As System.EventArgs) For Each handler In _OtherEventListeners handler(sender, e) Next End RaiseEvent End Event End Class

    Read the article

  • How do I get events to execute on the "main thread"

    - by William DiStefano
    I have 2 classes, one is frmMain a windows form and the other is a class in vb.NET 2003. frmMain contains a start button which executes the monitor function in the other class. My question is, I am manually adding the event handlers -- when the events are executed how do I get them to excute on the "main thread". Because when the tooltip balloon pops up at the tray icon it displays a second tray icon instead of popping up at the existing tray icon. I can confirm that this is because the events are firing on new threads because if I try to display a balloon tooltip from frmMain it will display on the existing tray icon. Here is a part of the second class (not the entire thing): Friend Class monitorFolders Private _watchFolder As System.IO.FileSystemWatcher = New System.IO.FileSystemWatcher Private _eType As evtType Private Enum evtType changed created deleted renamed End Enum Friend Sub monitor(ByVal path As String) _watchFolder.Path = path 'Add a list of Filter to specify _watchFolder.NotifyFilter = IO.NotifyFilters.DirectoryName _watchFolder.NotifyFilter = _watchFolder.NotifyFilter Or IO.NotifyFilters.FileName _watchFolder.NotifyFilter = _watchFolder.NotifyFilter Or IO.NotifyFilters.Attributes 'Add event handlers for each type of event that can occur AddHandler _watchFolder.Changed, AddressOf change AddHandler _watchFolder.Created, AddressOf change AddHandler _watchFolder.Deleted, AddressOf change AddHandler _watchFolder.Renamed, AddressOf Rename 'Start watching for events _watchFolder.EnableRaisingEvents = True End Sub Private Sub change(ByVal source As Object, ByVal e As System.IO.FileSystemEventArgs) If e.ChangeType = IO.WatcherChangeTypes.Changed Then _eType = evtType.changed notification() End If If e.ChangeType = IO.WatcherChangeTypes.Created Then _eType = evtType.created notification() End If If e.ChangeType = IO.WatcherChangeTypes.Deleted Then _eType = evtType.deleted notification() End If End Sub Private Sub notification() _mainForm.NotifyIcon1.ShowBalloonTip(500, "Folder Monitor", "A file has been " + [Enum].GetName(GetType(evtType), _eType), ToolTipIcon.Info) End Sub End Class

    Read the article

  • SelectedIndexChanged for programmatically created dropdownlist in ASP.NET fires multiple times.

    - by Achilles
    Consider the following: dim dropdownlist1 as new dropdownlist dim dropdownlist2 as new dropdownlist dim dropdownlist3 as new dropdownlist dropdownlist1.AutoPostBack = true dropdownlist2.AutoPostBack = true dropdownlist3.AutoPostBack = true AddHandler dropdownlist1.SelectedIndexChanged, AddressOf SomeEvent AddHandler dropdownlist2.SelectedIndexChanged, AddressOf SomeEvent AddHandler dropdownlist3.SelectedIndexChanged, AddressOf SomeEvent The SomeEvent fires as expected when any of the dropdown's selection is changed. However if say DropdownList2 has a selection made then I make a selection with either DropDownList1 or DropdownList3, then SomeEvent fires again. What is causing this behavior and how do I get just a single raising of that event? I suspect that when the viewstate for the dynamcially created dropdownlists is restored and the selection restored, then the event is fired because technically the selected index did change when the control was recreated. The reason I suspect this is that the event fires the for each dropdownlist...

    Read the article

  • XML-RPC with java

    - by Mona
    hi, I'm developing a server in XML-RPC using Java , but when i compile it , i get this error ServeurSomDiff.java:33: cannot find symbol symbol : method addHandler(java.lang.String,java.lang.String) location: class org.apache.xmlrpc.webserver.WebServer server.addHandler("SOMDIFF",new ServeurSomDiff ()); here 's my server : import java.util.Hashtable; import org.apache.xmlrpc.webserver.*; public class ServeurSomDiff { public ServeurSomDiff (){ } public Hashtable sumAndDifference (int x, int y) { Hashtable result = new Hashtable(); result.put("somme", new Integer(x + y)); result.put("difference", new Integer(x - y)); return result; } public static void main (String [] args) { try { WebServer server = new WebServer(8000); server.addHandler("SOMDIFF",new ServeurSomDiff()); server.start(); System.out.println("Serveur lance sur http://localhost:8000/RPC2"); } catch (Exception exception) {System.err.println("JavaServer: " + exception.toString()); } } } any ideas on how to fix this . thanks

    Read the article

  • redirect an event in VB.NET

    - by serhio
    I havea a UserControl1 (in witch I have an Label1) in Form1. I want to catch the MouseDown event from label and send it like from UserControl I do: Public Class UserControl1 Shadows Custom Event MouseDown As MouseEventHandler AddHandler(ByVal value As MouseEventHandler) AddHandler Label1.MouseDown, value End AddHandler RemoveHandler(ByVal value As MouseEventHandler) RemoveHandler Label1.MouseDown, value End RemoveHandler RaiseEvent(ByVal sender As Object, ByVal e As MouseEventArgs) 'RaiseMouseEvent(Me, e) ??? ' End RaiseEvent End Event End Class However, when I set in the Form1 the UserControl Private Sub UserControl11_MouseDown(ByVal sender As System.Object, _ ByVal e As System.Windows.Forms.MouseEventArgs) _ Handles UserControl11.MouseDown MessageBox.Show(sender.GetType.Name) 'here I have 'Label', want 'UserControl' End Sub

    Read the article

  • Bugzilla ./testserver.pl failing

    - by SomeKittens
    root@KittensTest:/var/www/Bugzilla/bugzilla-4.2.1# ./testserver.pl http://localhost/Bugzilla/bugzilla-4.2.1 TEST-OK Webserver is running under group id in $webservergroup. TEST-OK Got padlock picture. TEST-FAILED Webserver is fetching rather than executing CGI files. Check the AddHandler statement in your httpd.conf file. Well then. httpd.conf (from here[2.2.4.1.1]): <Directory /var/www/Bugzilla/bugzilla-4.2.1> AddHandler cgi-script .cgi .pl Options +Indexes +Includes +ExecCGI DirectoryIndex index.cgi AllowOverride Limit FileInfo Indexes </Directory> What am I doing wrong? I'm pretty new to this (first Bugzilla install), so I'll appreciate explanation.

    Read the article

  • Dynamic gridview columns event problem

    - by ropstah
    Hi, i have a GridView (selectable) in which I want to generate a dynamic GridView in a new row BELOW the selected row. I can add the row and gridview dynamically in the Gridview1 PreRender event. I need to use this event because: _OnDataBound is not called on every postback (same for _OnRowDataBound) _OnInit is not possible because the 'Inner table' for the Gridview is added after Init _OnLoad is not possible because the 'selected' row is not selected yet. I can add the columns to the dynamic GridView based on my ITemplate class. But now the button events won't fire.... Any suggestions? The dynamic adding of the gridview: Private Sub GridView1_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles GridView1.PreRender Dim g As GridView = sender g.DataBind() If g.SelectedRow IsNot Nothing AndAlso g.Controls.Count &gt; 0 Then Dim t As Table = g.Controls(0) Dim r As New GridViewRow(-1, -1, DataControlRowType.DataRow, DataControlRowState.Normal) Dim c As New TableCell Dim visibleColumnCount As Integer = 0 For Each d As DataControlField In g.Columns If d.Visible Then visibleColumnCount += 1 End If Next c.ColumnSpan = visibleColumnCount Dim ph As New PlaceHolder ph.Controls.Add(CreateStockGrid(g.SelectedDataKey.Value)) c.Controls.Add(ph) r.Cells.Add(c) t.Rows.AddAt(g.SelectedRow.RowIndex + 2, r) End If End Sub Private Function CreateStockGrid(ByVal PnmAutoKey As String) As GridView Dim col As Interfaces.esColumnMetadata Dim coll As New BLL.ViewStmCollection Dim entity As New BLL.ViewStm Dim query As BLL.ViewStmQuery = coll.Query Me._gridStock.AutoGenerateColumns = False Dim buttonf As New TemplateField() buttonf.ItemTemplate = New QuantityTemplateField(ListItemType.Item, "", "Button") buttonf.HeaderTemplate = New QuantityTemplateField(ListItemType.Header, "", "Button") buttonf.EditItemTemplate = New QuantityTemplateField(ListItemType.EditItem, "", "Button") Me._gridStock.Columns.Add(buttonf) For Each col In coll.es.Meta.Columns Dim headerf As New QuantityTemplateField(ListItemType.Header, col.PropertyName, col.Type.Name) Dim itemf As New QuantityTemplateField(ListItemType.Item, col.PropertyName, col.Type.Name) Dim editf As New QuantityTemplateField(ListItemType.EditItem, col.PropertyName, col.Type.Name) Dim f As New TemplateField() f.HeaderTemplate = headerf f.ItemTemplate = itemf f.EditItemTemplate = editf Me._gridStock.Columns.Add(f) Next query.Where(query.PnmAutoKey.Equal(PnmAutoKey)) coll.LoadAll() Me._gridStock.ID = "gvChild" Me._gridStock.DataSource = coll AddHandler Me._gridStock.RowCommand, AddressOf Me.gv_RowCommand Me._gridStock.DataBind() Return Me._gridStock End Function The ITemplate class: Public Class QuantityTemplateField : Implements ITemplate Private _itemType As ListItemType Private _fieldName As String Private _infoType As String Public Sub New(ByVal ItemType As ListItemType, ByVal FieldName As String, ByVal InfoType As String) Me._itemType = ItemType Me._fieldName = FieldName Me._infoType = InfoType End Sub Public Sub InstantiateIn(ByVal container As System.Web.UI.Control) Implements System.Web.UI.ITemplate.InstantiateIn Select Case Me._itemType Case ListItemType.Header Dim l As New Literal l.Text = "&lt;b&gt;" & Me._fieldName & "</b>" container.Controls.Add(l) Case ListItemType.Item Select Case Me._infoType Case "Button" Dim ib As New Button() Dim eb As New Button() ib.ID = "InsertButton" eb.ID = "EditButton" ib.Text = "Insert" eb.Text = "Edit" ib.CommandName = "Edit" eb.CommandName = "Edit" AddHandler ib.Click, AddressOf Me.InsertButton_OnClick AddHandler eb.Click, AddressOf Me.EditButton_OnClick container.Controls.Add(ib) container.Controls.Add(eb) Case Else Dim l As New Label l.ID = Me._fieldName l.Text = "" AddHandler l.DataBinding, AddressOf Me.OnDataBinding container.Controls.Add(l) End Select Case ListItemType.EditItem Select Case Me._infoType Case "Button" Dim b As New Button b.ID = "UpdateButton" b.Text = "Update" b.CommandName = "Update" b.OnClientClick = "return confirm('Sure?')" container.Controls.Add(b) Case Else Dim t As New TextBox t.ID = Me._fieldName AddHandler t.DataBinding, AddressOf Me.OnDataBinding container.Controls.Add(t) End Select End Select End Sub Private Sub InsertButton_OnClick(ByVal sender As Object, ByVal e As EventArgs) Console.WriteLine("insert click") End Sub Private Sub EditButton_OnClick(ByVal sender As Object, ByVal e As EventArgs) Console.WriteLine("edit click") End Sub Private Sub OnDataBinding(ByVal sender As Object, ByVal e As EventArgs) Dim boundValue As Object = Nothing Dim ctrl As Control = sender Dim dataItemContainer As IDataItemContainer = ctrl.NamingContainer boundValue = DataBinder.Eval(dataItemContainer.DataItem, Me._fieldName) Select Case Me._itemType Case ListItemType.Item Dim fieldLiteral As Label = sender fieldLiteral.Text = boundValue.ToString() Case ListItemType.EditItem Dim fieldTextbox As TextBox = sender fieldTextbox.Text = boundValue.ToString() End Select End Sub End Class

    Read the article

  • how can i disable the default console handler, while using the java logging api ?

    - by loudiyimo
    Hi I am trying to implement the java logging in my application. I want to use two handlers. A file handler and my own console handler. Both of my handlers work fine. My logging is send to a file and to the console . My logging is also sent to the default console handler, which i do not want. If you run my code you will see extra two line sent to the console. I don't want to use de default console handler. Does anyone know how to disable the default console handler. I only want to use the two hadlers i have created. Handler fh = new FileHandler("test.txt"); fh.setFormatter(formatter); logger.addHandler(fh); Handler ch = new ConsoleHandler(); ch.setFormatter(formatter); logger.addHandler(ch); import java.util.Date; import java.util.logging.ConsoleHandler; import java.util.logging.FileHandler; import java.util.logging.Formatter; import java.util.logging.Handler; import java.util.logging.Level; import java.util.logging.LogManager; import java.util.logging.LogRecord; import java.util.logging.Logger; public class LoggingExample { private static Logger logger = Logger.getLogger("test"); static { try { logger.setLevel(Level.INFO); Formatter formatter = new Formatter() { @Override public String format(LogRecord arg0) { StringBuilder b = new StringBuilder(); b.append(new Date()); b.append(" "); b.append(arg0.getSourceClassName()); b.append(" "); b.append(arg0.getSourceMethodName()); b.append(" "); b.append(arg0.getLevel()); b.append(" "); b.append(arg0.getMessage()); b.append(System.getProperty("line.separator")); return b.toString(); } }; Handler fh = new FileHandler("test.txt"); fh.setFormatter(formatter); logger.addHandler(fh); Handler ch = new ConsoleHandler(); ch.setFormatter(formatter); logger.addHandler(ch); LogManager lm = LogManager.getLogManager(); lm.addLogger(logger); } catch (Throwable e) { e.printStackTrace(); } } public static void main(String[] args) { logger.info("why does my test application use the standard console logger ?\n" + " I want only my console handler (Handler ch)\n " + "how can i turn the standard logger to the console off. ??"); } }

    Read the article

  • Staging server .htaccess for images, css and js

    - by Gavin Hall
    As we build and demo sites on our staging server with individual root folders for each such as /CLIENTNAME, we need to keep all the css, js and internal links for these sites referencing the server root. The following works for one folder each, but not sure how to adapt to work for all folders. Currently AddHandler php5-script .php RewriteEngine On RewriteRule ^(images|css|js)\/(.*) /ONEFOLDER/$1/$2 Would like AddHandler php5-script .php RewriteEngine On RewriteRule ^(images|css|js)\/(.*) /EVERYFOLDER/$1/$2 Many thanks in advance.

    Read the article

  • htaccess rewriterule works in one virtualhost, but not a second virtualhost

    - by Casey Flynn
    I have two virtualhosts configured with xampp on mac os x snow lion. Both use the following .htaccess file. <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / # Protect hidden files from being viewed <Files .*> Order Deny,Allow Deny From All </Files> #Removes access to the system folder by users. #Additionally this will allow you to create a System.php controller, #previously this would not have been possible. #'system' can be replaced if you have renamed your system folder. RewriteCond %{REQUEST_URI} ^system.* RewriteRule ^(.*)$ /index.php?/$1 [L] #When your application folder isn't in the system folder #This snippet prevents user access to the application folder #Submitted by: Fabdrol #Rename 'application' to your applications folder name. RewriteCond %{REQUEST_URI} ^application.* RewriteRule ^(.*)$ /index.php?/$1 [L] #Checks to see if the user is attempting to access a valid file, #such as an image or css document, if this isn't true it sends the #request to index.php RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php/$01 [L] # If we don't have mod_rewrite installed, all 404's # can be sent to index.php, and everything works as normal. # Submitted by: ElliotHaughin ErrorDocument 404 /index.php My goal is to eliminate /index.php/ from my url strings. This htaccess works perfectly for one project, but not for the other (project/vhost) This is my vhosts.conf # # This is the main Apache HTTP server configuration file. It contains the # configuration directives that give the server its instructions. # See <URL:http://httpd.apache.org/docs/2.2> for detailed information. # In particular, see # <URL:http://httpd.apache.org/docs/2.2/mod/directives.html> # for a discussion of each configuration directive. # # Do NOT simply read the instructions in here without understanding # what they do. They're here only as hints or reminders. If you are unsure # consult the online docs. You have been warned. # # Configuration and logfile names: If the filenames you specify for many # of the server's control files begin with "/" (or "drive:/" for Win32), the # server will use that explicit path. If the filenames do *not* begin # with "/", the value of ServerRoot is prepended -- so "logs/foo.log" # with ServerRoot set to "/Applications/xampp/xamppfiles" will be interpreted by the # server as "/Applications/xampp/xamppfiles/logs/foo.log". # # ServerRoot: The top of the directory tree under which the server's # configuration, error, and log files are kept. # # Do not add a slash at the end of the directory path. If you point # ServerRoot at a non-local disk, be sure to point the LockFile directive # at a local disk. If you wish to share the same ServerRoot for multiple # httpd daemons, you will need to change at least LockFile and PidFile. # ServerRoot "/Applications/XAMPP/xamppfiles" # # Listen: Allows you to bind Apache to specific IP addresses and/or # ports, instead of the default. See also the <VirtualHost> # directive. # # Change this to Listen on specific IP addresses as shown below to # prevent Apache from glomming onto all bound IP addresses. # #Listen 12.34.56.78:80 Listen 80 # # Dynamic Shared Object (DSO) Support # # To be able to use the functionality of a module which was built as a DSO you # have to place corresponding `LoadModule' lines at this location so the # directives contained in it are actually available _before_ they are used. # Statically compiled modules (those listed by `httpd -l') do not need # to be loaded here. # # Example: # LoadModule foo_module modules/mod_foo.so # LoadModule authn_file_module modules/mod_authn_file.so LoadModule authn_dbm_module modules/mod_authn_dbm.so LoadModule authn_anon_module modules/mod_authn_anon.so LoadModule authn_dbd_module modules/mod_authn_dbd.so LoadModule authn_default_module modules/mod_authn_default.so LoadModule authz_host_module modules/mod_authz_host.so LoadModule authz_groupfile_module modules/mod_authz_groupfile.so LoadModule authz_user_module modules/mod_authz_user.so LoadModule authz_dbm_module modules/mod_authz_dbm.so LoadModule authz_owner_module modules/mod_authz_owner.so LoadModule authnz_ldap_module modules/mod_authnz_ldap.so LoadModule authz_default_module modules/mod_authz_default.so LoadModule auth_basic_module modules/mod_auth_basic.so LoadModule auth_digest_module modules/mod_auth_digest.so LoadModule file_cache_module modules/mod_file_cache.so LoadModule cache_module modules/mod_cache.so LoadModule disk_cache_module modules/mod_disk_cache.so LoadModule mem_cache_module modules/mod_mem_cache.so LoadModule dbd_module modules/mod_dbd.so LoadModule bucketeer_module modules/mod_bucketeer.so LoadModule dumpio_module modules/mod_dumpio.so LoadModule echo_module modules/mod_echo.so LoadModule case_filter_module modules/mod_case_filter.so LoadModule case_filter_in_module modules/mod_case_filter_in.so LoadModule ext_filter_module modules/mod_ext_filter.so LoadModule include_module modules/mod_include.so LoadModule filter_module modules/mod_filter.so LoadModule charset_lite_module modules/mod_charset_lite.so LoadModule deflate_module modules/mod_deflate.so LoadModule ldap_module modules/mod_ldap.so LoadModule log_config_module modules/mod_log_config.so LoadModule logio_module modules/mod_logio.so LoadModule env_module modules/mod_env.so LoadModule mime_magic_module modules/mod_mime_magic.so LoadModule cern_meta_module modules/mod_cern_meta.so LoadModule expires_module modules/mod_expires.so LoadModule headers_module modules/mod_headers.so LoadModule ident_module modules/mod_ident.so LoadModule usertrack_module modules/mod_usertrack.so LoadModule unique_id_module modules/mod_unique_id.so LoadModule setenvif_module modules/mod_setenvif.so LoadModule proxy_module modules/mod_proxy.so LoadModule proxy_connect_module modules/mod_proxy_connect.so LoadModule proxy_ftp_module modules/mod_proxy_ftp.so LoadModule proxy_http_module modules/mod_proxy_http.so LoadModule proxy_ajp_module modules/mod_proxy_ajp.so LoadModule proxy_balancer_module modules/mod_proxy_balancer.so LoadModule mime_module modules/mod_mime.so LoadModule dav_module modules/mod_dav.so LoadModule status_module modules/mod_status.so LoadModule autoindex_module modules/mod_autoindex.so LoadModule asis_module modules/mod_asis.so LoadModule info_module modules/mod_info.so LoadModule suexec_module modules/mod_suexec.so LoadModule cgi_module modules/mod_cgi.so LoadModule cgid_module modules/mod_cgid.so LoadModule dav_fs_module modules/mod_dav_fs.so LoadModule vhost_alias_module modules/mod_vhost_alias.so LoadModule negotiation_module modules/mod_negotiation.so LoadModule dir_module modules/mod_dir.so LoadModule imagemap_module modules/mod_imagemap.so LoadModule actions_module modules/mod_actions.so LoadModule speling_module modules/mod_speling.so LoadModule userdir_module modules/mod_userdir.so LoadModule alias_module modules/mod_alias.so LoadModule rewrite_module modules/mod_rewrite.so #LoadModule apreq_module modules/mod_apreq2.so LoadModule ssl_module modules/mod_ssl.so <IfDefine JUSTTOMAKEAPXSHAPPY> LoadModule php4_module modules/libphp4.so LoadModule php5_module modules/libphp5.so </IfDefine> <IfModule !mpm_winnt_module> <IfModule !mpm_netware_module> # # If you wish httpd to run as a different user or group, you must run # httpd as root initially and it will switch. # # User/Group: The name (or #number) of the user/group to run httpd as. # It is usually good practice to create a dedicated user and group for # running httpd, as with most system services. # User nobody Group nogroup </IfModule> </IfModule> # 'Main' server configuration # # The directives in this section set up the values used by the 'main' # server, which responds to any requests that aren't handled by a # <VirtualHost> definition. These values also provide defaults for # any <VirtualHost> containers you may define later in the file. # # All of these directives may appear inside <VirtualHost> containers, # in which case these default settings will be overridden for the # virtual host being defined. # # # ServerAdmin: Your address, where problems with the server should be # e-mailed. This address appears on some server-generated pages, such # as error documents. e.g. [email protected] # ServerAdmin [email protected] # # ServerName gives the name and port that the server uses to identify itself. # This can often be determined automatically, but we recommend you specify # it explicitly to prevent problems during startup. # # If your host doesn't have a registered DNS name, enter its IP address here. # #ServerName www.example.com:80 # XAMPP ServerName localhost # # DocumentRoot: The directory out of which you will serve your # documents. By default, all requests are taken from this directory, but # symbolic links and aliases may be used to point to other locations. # DocumentRoot "/Users/caseyflynn/Documents/workspace/vibecompass" # # Each directory to which Apache has access can be configured with respect # to which services and features are allowed and/or disabled in that # directory (and its subdirectories). # # First, we configure the "default" to be a very restrictive set of # features. # <Directory /> Options FollowSymLinks AllowOverride None #XAMPP #Order deny,allow #Deny from all </Directory> # # Note that from this point forward you must specifically allow # particular features to be enabled - so if something's not working as # you might expect, make sure that you have specifically enabled it # below. # # # This should be changed to whatever you set DocumentRoot to. # <Directory "/Users/caseyflynn/Documents/workspace/vibecompass"> # # Possible values for the Options directive are "None", "All", # or any combination of: # Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews # # Note that "MultiViews" must be named *explicitly* --- "Options All" # doesn't give it to you. # # The Options directive is both complicated and important. Please see # http://httpd.apache.org/docs/2.2/mod/core.html#options # for more information. # Options Indexes FollowSymLinks ExecCGI Includes # # AllowOverride controls what directives may be placed in .htaccess files. # It can be "All", "None", or any combination of the keywords: # Options FileInfo AuthConfig Limit # AllowOverride All # # Controls who can get stuff from this server. # Order allow,deny Allow from all </Directory> # # DirectoryIndex: sets the file that Apache will serve if a directory # is requested. # <IfModule dir_module> DirectoryIndex index.html index.php index.htmls index.htm </IfModule> # # The following lines prevent .htaccess and .htpasswd files from being # viewed by Web clients. # <FilesMatch "^\.ht"> Order allow,deny Deny from all </FilesMatch> # # ErrorLog: The location of the error log file. # If you do not specify an ErrorLog directive within a <VirtualHost> # container, error messages relating to that virtual host will be # logged here. If you *do* define an error logfile for a <VirtualHost> # container, that host's errors will be logged there and not here. # ErrorLog logs/error_log # # LogLevel: Control the number of messages logged to the error_log. # Possible values include: debug, info, notice, warn, error, crit, # alert, emerg. # LogLevel warn <IfModule log_config_module> # # The following directives define some format nicknames for use with # a CustomLog directive (see below). # LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined LogFormat "%h %l %u %t \"%r\" %>s %b" common <IfModule logio_module> # You need to enable mod_logio.c to use %I and %O LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio </IfModule> # # The location and format of the access logfile (Common Logfile Format). # If you do not define any access logfiles within a <VirtualHost> # container, they will be logged here. Contrariwise, if you *do* # define per-<VirtualHost> access logfiles, transactions will be # logged therein and *not* in this file. # CustomLog logs/access_log common # # If you prefer a logfile with access, agent, and referer information # (Combined Logfile Format) you can use the following directive. # #CustomLog logs/access_log combined </IfModule> <IfModule alias_module> # # Redirect: Allows you to tell clients about documents that used to # exist in your server's namespace, but do not anymore. The client # will make a new request for the document at its new location. # Example: # Redirect permanent /foo http://www.example.com/bar # # Alias: Maps web paths into filesystem paths and is used to # access content that does not live under the DocumentRoot. # Example: # Alias /webpath /full/filesystem/path # # If you include a trailing / on /webpath then the server will # require it to be present in the URL. You will also likely # need to provide a <Directory> section to allow access to # the filesystem path. # # ScriptAlias: This controls which directories contain server scripts. # ScriptAliases are essentially the same as Aliases, except that # documents in the target directory are treated as applications and # run by the server when requested rather than as documents sent to the # client. The same rules about trailing "/" apply to ScriptAlias # directives as to Alias. # ScriptAlias /cgi-bin/ "/Applications/XAMPP/xamppfiles/cgi-bin/" </IfModule> <IfModule cgid_module> # # ScriptSock: On threaded servers, designate the path to the UNIX # socket used to communicate with the CGI daemon of mod_cgid. # #Scriptsock logs/cgisock </IfModule> # # "/Applications/xampp/xamppfiles/cgi-bin" should be changed to whatever your ScriptAliased # CGI directory exists, if you have that configured. # <Directory "/Applications/XAMPP/xamppfiles/phpmyadmin"> AllowOverride None Options None Order allow,deny Allow from all </Directory> # # DefaultType: the default MIME type the server will use for a document # if it cannot otherwise determine one, such as from filename extensions. # If your server contains mostly text or HTML documents, "text/plain" is # a good value. If most of your content is binary, such as applications # or images, you may want to use "application/octet-stream" instead to # keep browsers from trying to display binary files as though they are # text. # DefaultType text/plain <IfModule mime_module> # # TypesConfig points to the file containing the list of mappings from # filename extension to MIME-type. # TypesConfig etc/mime.types # # AddType allows you to add to or override the MIME configuration # file specified in TypesConfig for specific file types. # #AddType application/x-gzip .tgz # # AddEncoding allows you to have certain browsers uncompress # information on the fly. Note: Not all browsers support this. # #AddEncoding x-compress .Z #AddEncoding x-gzip .gz .tgz # # If the AddEncoding directives above are commented-out, then you # probably should define those extensions to indicate media types: # AddType application/x-compress .Z AddType application/x-gzip .gz .tgz # # AddHandler allows you to map certain file extensions to "handlers": # actions unrelated to filetype. These can be either built into the server # or added with the Action directive (see below) # # To use CGI scripts outside of ScriptAliased directories: # (You will also need to add "ExecCGI" to the "Options" directive.) # #AddHandler cgi-script .cgi AddHandler cgi-script .cgi .pl # For files that include their own HTTP headers: #AddHandler send-as-is asis # For server-parsed imagemap files: #AddHandler imap-file map # For type maps (negotiated resources): #AddHandler type-map var # # Filters allow you to process content before it is sent to the client. # # To parse .shtml files for server-side includes (SSI): # (You will also need to add "Includes" to the "Options" directive.) # AddType text/html .shtml AddOutputFilter INCLUDES .shtml </IfModule> # # The mod_mime_magic module allows the server to use various hints from the # contents of the file itself to determine its type. The MIMEMagicFile # directive tells the module where the hint definitions are located. # #MIMEMagicFile etc/magic # # Customizable error responses come in three flavors: # 1) plain text 2) local redirects 3) external redirects # # Some examples: #ErrorDocument 500 "The server made a boo boo." #ErrorDocument 404 /missing.html #ErrorDocument 404 "/cgi-bin/missing_handler.pl" #ErrorDocument 402 http://www.example.com/subscription_info.html # # # EnableMMAP and EnableSendfile: On systems that support it, # memory-mapping or the sendfile syscall is used to deliver # files. This usually improves server performance, but must # be turned off when serving from networked-mounted # filesystems or if support for these functions is otherwise # broken on your system. # EnableMMAP off EnableSendfile off # Supplemental configuration # # The configuration files in the /Applications/xampp/etc/extra/ directory can be # included to add extra features or to modify the default configuration of # the server, or you may simply copy their contents here and change as # necessary. # Server-pool management (MPM specific) #Include /Applications/XAMPP/etc/extra/httpd-mpm.conf # Multi-language error messages Include /Applications/XAMPP/etc/extra/httpd-multilang-errordoc.conf # Fancy directory listings #Include /Applications/XAMPP/etc/extra/httpd-autoindex.conf # Language settings #Include /Applications/XAMPP/etc/extra/httpd-languages.conf # User home directories Include /Applications/XAMPP/etc/extra/httpd-userdir.conf # Real-time info on requests and configuration #Include /Applications/XAMPP/etc/extra/httpd-info.conf # Virtual hosts Include /Applications/XAMPP/etc/extra/httpd-vhosts.conf # Local access to the Apache HTTP Server Manual #Include /Applications/XAMPP/etc/extra/httpd-manual.conf # Distributed authoring and versioning (WebDAV) #Include /Applications/XAMPP/etc/extra/httpd-dav.conf # Various default settings #Include /Applications/XAMPP/etc/extra/httpd-default.conf # Secure (SSL/TLS) connections Include /Applications/XAMPP/etc/extra/httpd-ssl.conf <IfModule ssl_module> <IfDefine SSL> Include etc/extra/httpd-ssl.conf </IfDefine> </IfModule> # # Note: The following must must be present to support # starting without SSL on platforms with no /dev/random equivalent # but a statically compiled-in mod_ssl. # <IfModule ssl_module> SSLRandomSeed startup builtin SSLRandomSeed connect builtin </IfModule> #XAMPP Include etc/extra/httpd-xampp.conf Any idea what might be the root of this? ANSWER: had to add this to my httpd.conf file <Directory /Users/caseyflynn/Documents/workspace/cobar> Options FollowSymLinks AllowOverride all #XAMPP Order deny,allow Allow from all </Directory>

    Read the article

  • Help me re-center a ModalPopup within an iframe when the iframe's parent window scrolls

    - by Cory Larson
    I have a web page with an iframe in it (I don't like it, but that's the way it has to be). It's not a cross-domain iframe so there's nothing to worry about there. I have written a jQuery extension that does the centering of a ModalPopup (which is called from an overridden AjaxControlToolkit.ModalPopupBehavior._layout method) based on the width and height of the iframe's parent, so that it looks centered even though the iframe is not in the center of the page. It's a lot of tricky stuff, especially since the web page I added the iframe to runs in quirks mode. Now, I've also overridden AjaxControlToolkit.ModalPopupBehavior._attachPopup, so that when the parent window resizes or scrolls, the ModalPopup inside of the iframe recenter's itself relative to the new size of the parent window. However, the same code that attaches the popup to the parent window's resize event does NOT work for the parent window's scroll event. See the code below, and the comments: AjaxControlToolkit.ModalPopupBehavior.prototype._attachPopup = function() { /// <summary> /// Attach the event handlers for the popup to the PARENT window /// </summary> if (this._DropShadow && !this._dropShadowBehavior) { this._dropShadowBehavior = $create(AjaxControlToolkit.DropShadowBehavior, {}, null, null, this._popupElement); } if (this._dragHandleElement && !this._dragBehavior) { this._dragBehavior = $create(AjaxControlToolkit.FloatingBehavior, {"handle" : this._dragHandleElement}, null, null, this._foregroundElement); } $addHandler(parent.window, 'resize', this._resizeHandler); // <== This WORKS $addHandler(parent.window, 'scroll', this._scrollHandler); // <== This DOES NOT work this._windowHandlersAttached = true; } Can anybody explain to me why the resize event works while the scroll event doesn't? Any suggestions or alternatives out there to help me out? I am working with jQuery, so if I can use something besides the $addHandler method from MS that'd be fine. Be aware that I also have to override the _detachPopup function to remove the handler, so I need to take that into account. Thanks!

    Read the article

  • gitweb on Ubuntu Server as Location/Directory instead of Virtual Host

    - by mbx
    Since DynDNS no longer resolves subdomains for free I have use gitweb on a subdir of the apache2. Usual suspects such as Pro Git suggest something like <VirtualHost *:80> ServerName gitserver DocumentRoot /srv/gitosis/repositories/ <Directory /srv/gitosis/repositories/> Options ExecCGI +FollowSymLinks +SymLinksIfOwnerMatch AllowOverride All order allow,deny Allow from all AddHandler cgi-script cgi DirectoryIndex gitweb.cgi </Directory> </VirtualHost> I tried various variations using Location and Directory tags with different attribute combinations without any notable success. My first Idea was close to the following Alias /gitweb /srv/gitosis/repositories <Location /gitweb> AuthType Basic AuthName "gitweb Repository view" AuthUserFile /etc/apache2/gitweb.passwd Require valid-user SSLRequireSSL SetEnv GITWEB_CONFIG /etc/gitweb.conf AddHandler cgi-script cgi DirectoryIndex /usr/lib/cgi-bin/gitweb.cgi </Location> Apache is in the gitosis group, the repositories are readable and executable for that group. So, what is the indended way to get websvn run on Ubuntu 10?

    Read the article

1 2 3 4 5 6 7 8 9 10  | Next Page >