Can you set settings in ASPxGridView skins?
For example:
<Settings ShowHeaderFilterBlankItems="false" ShowFilterBar="Visible" ShowFilterRow="True" />
This would be very helpfull because all the grids that are using this style would have filter bar and filter row enabled by default.
If it is not possible, could you please explain me why?
Yes, it is possible to specify the ASPxGridView's properties (for all ASPxGridView instances in the corresponding theme) within the skin file:
<%# Register TagPrefix="dx" Namespace="DevExpress.Data" Assembly="DevExpress.Data.vX.Y, Version=X.Y.Z.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" %>
<%# Register TagPrefix="dx" Namespace="DevExpress.Web.ASPxGridView" Assembly="DevExpress.Web.ASPxGridView.vX.Y, Version=X.Y.Z.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" %>
<dx:ASPxGridView runat="server">
<Settings ShowHeaderFilterButton="true" ShowHeaderFilterBlankItems="false" ShowFilterBar="Visible" ShowFilterRow="True" />
</dx:ASPxGridView>
However, the skin file is intended more for specifying a visual appearance (styles, images, etc).
Related
We are upgrading our project from .Net2.0 to .net4.5.1.
The aspx page contains iframe tag as follows,
<iframe id="doc_preview" runat="server" src="" style="DISPLAY:inline; VISIBILITY:hidden"></iframe>
while building the project im getting the build error like "the type system.web.ui.htmlcontrols.htmliframe is not defined"
how can i resolve this?
Change the iframe to:
<asp:HtmlIframe id="doc_preview" runat="server" />
Rather than adding runat="server" to your iframe.
If it still throws issues then you'll want to add this to your web.config to make sure htmlcontrols are reference:
<controls>
<add tagPrefix="asp" namespace="System.Web.UI.HtmlControls" assembly="System.Web"/>
</controls>
The majority of all other issues ive read about the AJAX Toolkit not working is related to some form of error that populates. I do not have an error I can reference! Which makes this bug a little harder to understand. I have a feeling I am missing ONE step. Ive gone through all the documentation and it shows that I am doing everything correctly.
The Issue:
I am trying to use a calendar extender on a textbox (which I have read that I no longer need to but that is aside the point). When I go to click on said textbox to make sure the toolkit is working, no calendar pops up!
The Double-Check: To check to see if it is the calendar itself (again, read that it was no longer needed) I added a confirm button extender to test the toolkit. It doesn't work either.
What have I done so far? I have: installed/reinstalled using NuGet the lastest version of the Ajax Control Toolkit (7.1213), commented out the registry in web.config and added to top of page (and visa versa), restarted VS2012 with every uninstall/reinstall, tried pulling syntax straight from the toolbox (which was taken from ajaxcontroltoolkit.dll) instead of hand-typing.
The Code:
web.config (added by NuGet on installation)
...
<pages>
<controls>
<add tagPrefix="ajaxToolkit" assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" />
</controls>
</pages>
</system.web>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Microsoft.WindowsAzure.Storage" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.1.0.4" newVersion="2.1.0.4" />
</dependentAssembly>
</assemblyBinding>
</runtime>
...
page1.aspx
...
<%--patient ID panel--%>
<asp:Panel ID="pat_id_pnl" runat="server">
<div align="center">
<asp:Label runat="server" Text="SSN/MRN:" />
<asp:TextBox ID="ssn_mrn_txt" runat="server" style="margin-left:5px; margin-right:15px;"/>
<asp:Label runat="server" Text="Date of Appt:" />
<asp:TextBox ID="date_appt_txt" runat="server" style="margin-left:5px; margin-right:15px;"/>
<%--add calendar to date_appt_txt--%>
<ajaxToolkit:ToolkitScriptManager ID="ToolkitScriptManager1" runat="Server" />
<ajaxToolkit:CalendarExtender ID="CalendarExtender1" runat="server" TargetControlID="date_appt_txt" Format="MM/dd/yyyy" />
<asp:Button ID="search_btn" runat="server" Text="Search" />
<%--Test confirm button extender--%>
<ajaxToolkit:ConfirmButtonExtender ID="ConfirmButtonExtender1" runat="server" ConfirmText="Are you sure you want to click this?" TargetControlID="search_btn"></ajaxToolkit:ConfirmButtonExtender>
</div>
</asp:Panel>
....
The line I was referring to earlier when I said "commented out the registry in web.config and added to top of page" I meant I commented this out of the web.config:
<pages>
<controls>
<add tagPrefix="ajaxToolkit" assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" />
</controls>
</pages>
and added this to the top of the page before the first content place holder:
<%# Register tagPrefix="ajaxToolkit" assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" %>
Any help is greatly appreciated! Thanks.
So I figured a few things out after more searching.
To see an error with the ajax control toolkit, debug in internet explorer. Once I stopped debugging in chrome, I caught an error that said:
...AjaxControlToolkit requires ASP.NET Ajax 4.0 scripts...
I had to remove Microsoft.Scriptmanager.MSAjax.dll from the bin folder of the project
That fixed my issue! Hope that it helps.
I've just added Ajax Control Toolkit with NuGet, and I want to add the following piechart:
<ajaxToolkit:PieChart ID="pieChart1" runat="server" ChartHeight="300"
ChartWidth="450" ChartTitle="Widget Production in the world"
ChartTitleColor="#0E426C">
<PieChartValues>
<ajaxToolkit:PieChartValue Category="United States" Data="45"
PieChartValueColor="#6C1E83" PieChartValueStrokeColor="black" />
<ajaxToolkit:PieChartValue Category="Europe" Data="25"
PieChartValueColor="#D08AD9" PieChartValueStrokeColor="black" />
<ajaxToolkit:PieChartValue Category="Asia" Data="17"
PieChartValueColor="#6586A7" PieChartValueStrokeColor="black" />
<ajaxToolkit:PieChartValue Category="Australia" Data="13"
PieChartValueColor="#0E426C" PieChartValueStrokeColor="black" />
</PieChartValues>
</ajaxToolkit:PieChart>
However, my page has no clue what PieChart is, how can I add ajaxToolkit and link it to the dll file in the aspx page?
Mine looks like this:
<%# Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="asp" %>
If you drop an ajax control onto the form, it should create the registration for you. Mine above is an auto generated reference to the ajax toolkit. You also have to add a reference to the Ajax dll through the project references (although Nuget might have done this already, not sure).
I hope the following images will be useful. And download the needed AJAX .dll file.
Add this:
<%# Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="asp" %>
Step 1:
Step 2:
Step 3:
Step 4:
i am new to asp.net and i was to work in AjaxControlToolkit and i instaled and performed other operation but it is showing me report...,
error is:
The type name 'TextBoxWatermarkExtender' does not exist in the type 'AjaxControlToolkit'
protected global::AjaxControlToolkit.TextBoxWatermarkExtender TextBoxWatermarkExtender1;
code is:
<asp:TextBoxWatermarkExtender id="TBWEDOB" runat="server" targetcontrolid="txtDOB"
watermarktext="dd/mm/yy" watermarkcssclass="watermarked"> </asp:TextBoxWatermarkExtender>
plz any one pelp me on this flow....,
First Check This
<%# Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
in Your Page and see what is the TagPrefix in your page and than use that.like
<asp:TextBoxWatermarkExtender ID="TBWE2" runat="server"
TargetControlID="TextBox1"
WatermarkText="Type First Name Here"
WatermarkCssClass="watermarked" />
it will work defiantly
Why don't you simply try placeholder property to achieve the watermark in input fields.
Yes, There is a restriction of older browser, so if you are working with newer version (suppots HTML 5) then you can use it like this
<asp:TextBox ID="textbox1" runat="server" placeholder="dd/mm/yyyy"></asp:TextBox>
You haven't provided much information so it will be tough to identify where your mistake is, here's a simple step-by-step list of how you can use AJAX in your application, just follow the points below and it will work:
1) Download AJAX from codeplex, save and unzip anywhere on your machine
2) In Visual Studio Toolbox, Right click-> Add Tab, give it a name
3) Right click the newly created tab -> Choose Items...
4) Click Browse, find AjaxControlToolkit.dll and click OK
5) If all is well the controls will be added to your toolbox
6) Drag and drop a ToolkitScriptManager to the .aspx page, doing this will automatically:
6.1) Add a AjaxControlToolkit.dll reference to your project
6.2) Add the following line to the source view of your page
<%# Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
7)Drag and drop a TextBoxWatermarkExtender to the .aspx page and you're done:
<asp:ToolkitScriptManager ID="sm" runat="server" />
<asp:TextBoxWatermarkExtender ID="watermark" runat="server" TargetControlID="txtName" WatermarkText="Type name here..." />
<asp:TextBox ID="txtName" runat="server" />
try modifying the tag prefix
on the top of the page register the ajax tool kit.
<%# Register Namespace="AjaxControlToolkit" Assembly="AjaxControlToolkit" TagPrefix="ajax" %>
<ajax:TextBoxWatermarkExtender id="TBWEDOB" runat="server" targetcontrolid="txtDOB"
watermarktext="dd/mm/yy" watermarkcssclass="watermarked"> </ajax:TextBoxWatermarkExtender>
I am encountering this error whenever the button is clicked to collapse/expand the panel.
Error: CollapsiblePanelExtender A potentially dangerous Request.Form value was detected from the client.
Can someone tell me what I did wrong and what is causing this?
<asp:Button ID="Button1" runat="server" Text="Button" />
<ajaxToolkit:CollapsiblePanelExtender
TargetControlID="testPanel"
ID="CollapsiblePanelExtender1"
runat="server"
ExpandControlid="Button1"
CollapseControlID="Button1"
Collapsed="False"
ExpandDirection="Vertical"
AutoCollapse="false"
AutoExpand="false">
</ajaxToolkit:CollapsiblePanelExtender>
<asp:Panel ID="testPanel" runat="server">
stuff here
</asp:Panel>
Put validateRequest="false" in your page directive or web.config file.
Adding Cross-Site Scripting Protection to ASP.NET
for example if you already have:
<%# Page Language="vb" AutoEventWireup="false" Codebehind="MyForm.aspx.vb" Inherits="Proj.MyForm"%>
then this should become:
<%# Page Language="vb" AutoEventWireup="false" Codebehind="MyForm.aspx.vb" Inherits="Proj.MyForm" ValidateRequest="false"%>
Note:
If you are using .NET 4 then you will need to add requestValidationMode="2.0" to the httpRuntime configuration section of the web.config file. For example:
<httpRuntime requestValidationMode="2.0"/>
If you don't already have a httpRuntime section in the web.config file then this goes inside the section.
Thanks