Hi
I build an asp.net website.
on development invornment it is good
but after i published it into problex.com it became toooo slow
when i click on + Add new problem
it takes alomst 10 seconds to respond!!!
any idea how to fix that?
thanks
Hi
I build an asp.net website.
on development invornment it is good
but after i published it into problex.com it became toooo slow
when i click on + Add new problem
it takes alomst 10 seconds to respond!!!
any idea how to fix that?
thanks
hi,
I have a wizard control and in one wizard step i have an AsyncFileUpload and a datalist
i need to load the datalist after asyncfileUpload uploaded the file
belowe is my complete code which i got from another example but it does not work!
is there any other better way to do this?
<script type="text/javascript">
function uploadComplete2(sender, args) {
try {
var fileExtension = args.get_fileName();
var jpg = fileExtension.indexOf('.jpg');
var gif = fileExtension.indexOf('.gif');
var filesizeuploaded = parseInt(args.get_length());
if (jpg > 0 || gif > 0 && (filesizeuploaded < 1000000)) {
$get("dvFileInfo2").style.display = 'block';
$get("dvFileErrorInfo2").style.display = 'none';
$get("<%=uploadsuccess2.ClientID%>").innerHTML;
}
else {
$get("dvFileErrorInfo2").style.display = 'block';
$get("<%=uploaderror2.ClientID%>").innerHTML = ' <asp:Literal runat="server" Text='<%$ Resources:default,errInvalidImageType%>' />';
$get("dvFileInfo2").style.display = 'none';
return;
}
}
catch (e) {
$get("<%=uploaderror2.ClientID%>").innerHTML = e.message;
}
}
</script>
Protected Sub UpdatePanelUpload_Load(sender As Object, e As System.EventArgs) Handles UpdatePanelUpload.Load
imageList.DataBind()
fileUpload2.ClearAllFilesFromPersistedStore()
End Sub
<asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional" >
<ContentTemplate>
<asp:Wizard ID="Wizard1" runat="server"
onfinishbuttonclick="OnFinishButtonClick"
onactivestepchanged="OnActiveStepChanged"
StartNextButtonText='<%$ Resources:default,btnAddListing%>'
DisplaySideBar="false" >
<asp:WizardStep ID="WizardStep2" runat="server" AllowReturn="false" >
<asp:Panel runat="server" ID="panel_photos">
<label><asp:Literal ID="Literal38" runat="server" Text="<%$ Resources:default,Image%>" /></label>
<asp:AsyncFileUpload ID="fileUpload2" runat="server" BackColor="AliceBlue" UploadingBackColor="Red"
OnUploadedComplete="UploadImage2" OnClientUploadComplete="uploadComplete2" ThrobberID="throbber" />
<span style="display: none">
<asp:Label ID="flag" runat="server" Text="Waiting" ClientIDMode="Static" />
</span>
<asp:UpdatePanel ID="UpdatePanelUpload" runat="server" OnLoad="UpdatePanelUpload_Load">
<ContentTemplate>
<div id="photoUpload">
<asp:Label runat="server" ID="txtUploadMessage2" Style="display: none;">
<img alt="" src="images/Loading.gif" />
</asp:Label>
<div style="display: none; font-family: Courier; width: 600px" id="dvFileInfo2">
<asp:Label ID="uploadsuccess2" ForeColor="Blue" runat="server" Text='<%$ Resources:default,msgImageUploadSuccess %>' /><br />
</div>
<div style="display: none; font-family: Courier; width: 800px" id="dvFileErrorInfo2">
<asp:Label ID="uploaderror2" ForeColor="Red" runat="server" /><br />
</div>
</div>
<div class="imagetype">
<asp:RadioButtonList runat="server" ID="imageType" RepeatDirection="Horizontal" RepeatLayout="Table"/>
</div>
<br />
<label><asp:Literal ID="Literal37" runat="server" Text="<%$ Resources:admin,ImageList%>" /></label>
<div class="imageBox">
<asp:DataList runat="server" ID="imageList" RepeatColumns="5" RepeatDirection="Horizontal">
<ItemTemplate>
<asp:Imagebutton runat="server" ID="image" /><br />
<asp:Literal runat="server" ID="imageType" /><br />
<asp:LinkButton runat="server" ID="btnDelete" CommandArgument='<%# eval("ID") %>' CommandName="delete" Text='<%$ Resources:admin,btnDelete%>' />
</ItemTemplate>
</asp:DataList></div>
</ContentTemplate>
</asp:UpdatePanel>
<script type="text/javascript">
Sys.Application.add_init(application_init);
function application_init() {
var prm = Sys.WebForms.PageRequestManager.getInstance();
prm.add_pageLoaded(prm_pageLoaded);
}
function prm_pageLoaded() {
$('#flag').text('Waiting');
}
function uploadComplete(sender) {
$('#flag').text('Refresh');
}
$(document).ready(
setInterval(function () {
var f = $('#flag').text();
if (f != 'Waiting') { __doPostBack('UpdatePanelUpload', ''); }
}, 2000)
);
</script>
</asp:Panel>
</asp:WizardStep>
</WizardSteps>
</asp:Wizard>
</ContentTemplate>
</asp:UpdatePanel>
Hi,
I have placed AjaxFileUpload in visible state while page load and placed inside a UpdatePanel. Trigger will raised the AjaxFileUpload to visible state when clicked on a button. Everything works fine, AjaxFileUpload also displays on the webpage but while uploading the file, it was unable to upload files.
I guess error lies at the client end.
But all the above problem get solved, if I made the AjaxUploadFile module visible when the page loads.
I have installed the latest update of Toolkit provided by Codeplex.
Code is as below:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="documents.aspx.cs" Inherits="Document" %><%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head id="Head1" runat="server"><title>Untitled Page</title><link rel="stylesheet" href="css/document.css" type="text/css" /><link href="css/StyleSheet.css" rel="stylesheet" type="text/css" /><script type="text/javascript"> function customOpen(url) { var w = window.open(url, '', 'toolbar=0,status=0,navigationtoolbar=0,location=0,menubar=0,directories=0,resizable=1,scrollbars=1'); w.focus(); }</script><script type="text/javascript"> var styleToSelect; function onOk() { document.getElementById('Paragraph1').className = styleToSelect; }</script><%--<script language="javascript" type="text/javascript"> function ajaxFileUploadAttachments_ClientUploadComplete(sender, e) { if (sender._filesInQueue[sender._filesInQueue.length - 1]._isUploaded) __doPostBack('UpdatePanel2', ''); // Do post back only after all files have been uploaded }</script>--%></head><body><form id="form1" runat="server"><asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server"></asp:ToolkitScriptManager><div id="header"><div><a href="Default.aspx" class="logo"><img src="images/logo.png" alt="" /></a><ul><li ><a href="default.aspx">home</a></li><li><a href="Gallery.aspx">gallery</a></li><li class="selected"><a href="documents.aspx">Documents</a></li><li><a href="Contact.aspx">contact us</a></li><li><a href="logout.aspx">Logout</a></li><li><a href="admin/default.aspx">Admin</a></li></ul></div></div><div id="DocumentHead"><div><ul><li><asp:LinkButton ID="LinkButton3" runat="server" onclick="LinkButton3_Click">My Library</asp:LinkButton></li><li > |</li><li><asp:UpdatePanel ID="UpdatePanel9" runat="server" UpdateMode="Conditional"><ContentTemplate><asp:LinkButton ID="LinkButton4" ToolTip="Refresh Current List" runat="server" onclick="LinkButton4_Click">Refresh List</asp:LinkButton></ContentTemplate></asp:UpdatePanel></li><li><asp:UpdatePanel ID="UpdatePanel5" runat="server" UpdateMode="Conditional"><ContentTemplate><asp:LinkButton ID="LinkButton2" Visible="false" onclick="LinkButton2_Click" ToolTip="Upload Files" runat="server">Upload</asp:LinkButton></ContentTemplate><Triggers><asp:AsyncPostBackTrigger ControlID="TreeView1" EventName="SelectedNodeChanged" /><asp:AsyncPostBackTrigger ControlID="LinkButton3" EventName="Click" /></Triggers></asp:UpdatePanel></li><li><asp:UpdatePanel ID="UpdatePanel6" runat="server" UpdateMode="Conditional"><ContentTemplate><asp:LinkButton ID="LinkButton5" Visible= "false" onclick="LinkButton5_Click" ToolTip="Delete" runat="server">Delete</asp:LinkButton></ContentTemplate><Triggers><asp:AsyncPostBackTrigger ControlID="TreeView1" EventName="SelectedNodeChanged" /><asp:AsyncPostBackTrigger ControlID="LinkButton3" EventName="Click" /></Triggers></asp:UpdatePanel></li><li><asp:UpdatePanel ID="UpdatePanel10" runat="server" UpdateMode="Conditional"><ContentTemplate><asp:LinkButton ID="LinkButton8" Visible ="false" ToolTip="Download" runat="server" onclick="LinkButton8_Click">Download</asp:LinkButton></ContentTemplate><Triggers><asp:AsyncPostBackTrigger ControlID="TreeView1" EventName="SelectedNodeChanged" /><asp:AsyncPostBackTrigger ControlID="LinkButton3" EventName="Click" /><asp:PostBackTrigger ControlID = "LinkButton8" /></Triggers></asp:UpdatePanel></li><li><asp:UpdatePanel ID="UpdatePanel11" runat="server" UpdateMode="Conditional"><ContentTemplate><asp:LinkButton ID="LinkButton9" Visible ="false" ToolTip="View File" runat="server" onclick="LinkButton9_Click">View</asp:LinkButton></ContentTemplate><Triggers><asp:AsyncPostBackTrigger ControlID="TreeView1" EventName="SelectedNodeChanged" /><asp:AsyncPostBackTrigger ControlID="LinkButton3" EventName="Click" /></Triggers></asp:UpdatePanel></li><li><asp:UpdatePanel ID="UpdatePanel7" runat="server" UpdateMode="Conditional"><ContentTemplate><asp:LinkButton ID="LinkButton6" Enabled="false" Visible ="false" ToolTip="Move" runat="server">Move</asp:LinkButton><asp:ModalPopupExtender ID="ModalPopupExtender2" runat="server" TargetControlID="LinkButton6" PopupControlID="Panel2" BackgroundCssClass="modalBackground" DropShadow="true" OkControlID="OkButton" OnOkScript="onOk()" CancelControlID="CancelButton" /></ContentTemplate><Triggers><asp:AsyncPostBackTrigger ControlID="TreeView1" EventName="SelectedNodeChanged" /><asp:AsyncPostBackTrigger ControlID="LinkButton3" EventName="Click" /></Triggers></asp:UpdatePanel></li><li><asp:UpdatePanel ID="UpdatePanel8" runat="server" UpdateMode="Conditional"><ContentTemplate><asp:LinkButton ID="LinkButton7" Enabled="false" Visible ="false" ToolTip="Share" runat="server">Share</asp:LinkButton><asp:ModalPopupExtender ID="ModalPopupExtender1" runat="server" TargetControlID="LinkButton7" PopupControlID="Panel1" BackgroundCssClass="modalBackground" DropShadow="true" OkControlID="OkButton" OnOkScript="onOk()" CancelControlID="CancelButton" /></ContentTemplate><Triggers><asp:AsyncPostBackTrigger ControlID="TreeView1" EventName="SelectedNodeChanged" /><asp:AsyncPostBackTrigger ControlID="LinkButton3" EventName="Click" /></Triggers></asp:UpdatePanel></li><li><asp:UpdatePanel ID="UpdatePanel12" runat="server" UpdateMode="Conditional"><ContentTemplate><asp:LinkButton ID="LinkButton10" Visible ="false" ToolTip="Back" runat="server" onclick="LinkButton10_Click">Back</asp:LinkButton></ContentTemplate><Triggers><asp:AsyncPostBackTrigger ControlID="TreeView1" EventName="SelectedNodeChanged" /><asp:AsyncPostBackTrigger ControlID="GridView1" EventName="SelectedIndexChanged" /><asp:AsyncPostBackTrigger ControlID="LinkButton3" EventName="Click" /></Triggers></asp:UpdatePanel></li></ul></div></div><hr /><div id="body"><div class="body"><div id="leftnavigation"><asp:Timer ID="Timer1" OnTick="Timer1_Tick" runat="server" Interval="9000000"></asp:Timer><h1>Libraries<asp:LinkButton ID="LinkButton1" runat="server" onclick="LinkButton1_Click" ToolTip="Refresh Library"><%--<img src="images/untitled.bmp" alt="Refresh" />--%></asp:LinkButton></h1><asp:UpdatePanel ID="UpdatePanel3" runat="server" UpdateMode="Conditional"><ContentTemplate><asp:TreeView ID="TreeView1" runat="server" ImageSet="Arrows" ShowLines="True" onselectednodechanged="TreeView1_SelectedNodeChanged"><ParentNodeStyle Font-Bold="false" /><HoverNodeStyle Font-Underline="True" ForeColor="#5555DD" /><SelectedNodeStyle Font-Underline="True" HorizontalPadding="0px" VerticalPadding="0px" ForeColor="#5555DD" /><NodeStyle Font-Names="Verdana" Font-Size="8pt" ForeColor="DarkGreen" HorizontalPadding="5px" NodeSpacing="0px" VerticalPadding="0px" /></asp:TreeView></ContentTemplate><Triggers><asp:AsyncPostBackTrigger ControlID="TreeView1" EventName="SelectedNodeChanged" /><asp:AsyncPostBackTrigger ControlID="LinkButton1" EventName="Click" /><asp:AsyncPostBackTrigger ControlID="LinkButton3" EventName="Click" /><asp:AsyncPostBackTrigger ControlID="Timer1" EventName="Tick" /></Triggers></asp:UpdatePanel></div><div id="content"><h1>Details</h1><asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional"><ContentTemplate><asp:AjaxFileUpload ID="AjaxFileUpload1" Visible="false" OnUploadComplete="AjaxFileUpload1_OnUploadComplete" runat="server" /></ContentTemplate><Triggers><asp:AsyncPostBackTrigger ControlID="TreeView1" EventName="SelectedNodeChanged" /><asp:AsyncPostBackTrigger ControlID="LinkButton2" EventName="Click" /></Triggers></asp:UpdatePanel><asp:UpdatePanel ID="UpdatePanel2" OnLoad="UpdatePanel2_Load" runat="server" UpdateMode="Conditional"><ContentTemplate><div id ="Details"><asp:GridView ID="GridView1" runat="server" CellPadding="4" ForeColor="#333333" GridLines="Horizontal" Visible="False" Width="100%" onselectedindexchanged="GridView1_SelectedIndexChanged" PageSize="5"><PagerSettings Visible ="true" Mode="NumericFirstLast" /><RowStyle BackColor="#E3EAEB" ForeColor="DarkGreen" /><FooterStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" /><PagerStyle BackColor="#666666" ForeColor="White" HorizontalAlign="Center" /><SelectedRowStyle BackColor="#C5BBAF" Font-Bold="True" /><HeaderStyle BackColor="DarkGreen" Font-Bold="True" VerticalAlign="Middle" HorizontalAlign="Left" ForeColor="White" /><EditRowStyle BackColor="#7C6F57" /><AlternatingRowStyle BackColor="White" /><Columns><asp:ButtonField CommandName="Select" ButtonType="Button" /></Columns></asp:GridView></div></ContentTemplate><Triggers><asp:AsyncPostBackTrigger ControlID="LinkButton4" EventName="Click" /><asp:AsyncPostBackTrigger ControlID="LInkButton5" EventName="Click" /></Triggers></asp:UpdatePanel><div><p id="Paragraph1"> .</p><asp:Panel ID="Panel1" runat="server" CssClass="modalPopup" Style="display: none" Width="233px"><p>Select Details Below: </p><asp:Label ID="Label7" runat="server" Text="Select User : "></asp:Label> <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox><br /><div align="center"><asp:Button ID="OkButton" runat="server" Text="OK" /><asp:Button ID="CancelButton" runat="server" Text="Cancel" /></div></asp:Panel><br /></div><div><p id="P1"> .</p><asp:Panel ID="Panel2" runat="server" CssClass="modalPopup" Style="display: none" Width="233px"><p>Select Details Below: </p><asp:Label ID="Label8" runat="server" Text="Select Folder : "></asp:Label> <asp:TextBox ID="TextBox2" runat="server"></asp:TextBox><br /><div align="center"><asp:Button ID="Button1" runat="server" Text="OK" /><asp:Button ID="Button2" runat="server" Text="Cancel" /></div></asp:Panel><br /></div></div><div id="rightnavigation"><h2>Folder Details</h2><asp:UpdatePanel ID="UpdatePanel4" runat="server" UpdateMode="Conditional"><ContentTemplate><div><asp:Label ID="Label4" runat="server" Text="Library : " ForeColor="Green"></asp:Label><asp:Label ID="Label1" runat="server" Text="" ForeColor="Green"></asp:Label></div><div><asp:Label ID="Label5" runat="server" Text="Folder : " ForeColor="Green"></asp:Label> <asp:Label ID="Label2" runat="server" Text="" ForeColor="Green"></asp:Label></div><div><asp:Label ID="Label6" runat="server" Text="SubFolder : " ForeColor="Green"> </asp:Label><asp:Label ID="Label3" runat="server" Text="" ForeColor="Green"></asp:Label></div></ContentTemplate></asp:UpdatePanel></div></div></div><div id="footer"><div><ul class="contact"><li> Lumbini Bank Limited</li></ul><ul class="connect"><li class="mail"><a target= "_blank" href="http://192.168.0.2">mail</a></li></ul></div><p> Copyright © 2011. All Rights Reserved</p></div></form></body></html>
Thanks
Rahul Saud
IT Professional
Lumbini Bank Limited
Nepal
Hi, I am filling gridview from DB using
<div id="DIV_HelpAdv" class="readmore innerTextStyle" runat="server"><%# Eval("Body")%></div>
and now I want not to let anyone to copy and even select this text,
please help me
Regards
Hello,
The following code is working fine with Firefox and Chrome, which is, when I click on the first radio button it postback and keep the value but in IE it is not keeping the value. Why is it working like this?
Below is the code:
<%@ Page Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="ParallelOpsChooseEvolverPage._Default" %><%@ Register Assembly="ParallelOpsChooseEvolverPage" Namespace="ParallelOpsChooseEvolverPage.Controls" TagPrefix="ParallelOpsChooseEvolverPage" %><%@ Register Src="~/Controls/AdTypeSelector.ascx" TagName="AdTypeSelector" TagPrefix="poce" %><asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent"><title>Page de redirection vers le guichet virtuel correspondant selon le titre et rubrique choisi</title><script src="Scripts/jquery-1.4.1.js" type="text/javascript"></script><script type="text/javascript" src="Scripts/MiscScripts.js"></script></asp:Content><asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent"><asp:ScriptManager runat="server" ID="ScriptManager1" EnablePartialRendering="true"></asp:ScriptManager><asp:UpdatePanel runat="server" ID="updatePanel1" UpdateMode="Always" ChildrenAsTriggers="True"><ContentTemplate><div id="mainContent"><div id="normalClientContainer"><h2> Rubrique et types d'annonces</h2><div id="clientTypeTitleContainer" class="titleContainer"><span class="titles">Annoncez-vous pour une raison privée ou commerciale?</span></div><div id="clientContainer"><asp:RadioButtonList ID="rblClientType" runat="server" AutoPostBack="true" RepeatDirection="Horizontal" CssClass="radioButtonListContainer" RepeatLayout="Table" OnSelectedIndexChanged="ClientTypeChanged"><asp:ListItem Text="Annonce Privée" Value="p" /><asp:ListItem Text="Annonce commerciale" Value="g" /></asp:RadioButtonList></div><div id="dropDownListContainer"><div id="marketChoosetitleContainer" class="titleContainer"><span class="titles">Choisissez votre marché et votre rubrique</span></div></div><div id="publicationContainer"><div class="labelContainer"><asp:Label ID="lblPublication" runat="server" Text="Publication:" CssClass="label" /></div><asp:DropDownList CssClass="ddlist" ID="ddlPublication" runat="server" AutoPostBack="true" OnSelectedIndexChanged="PublicationChanged" /></div><div id="marketContainer"><div class="labelContainer"><asp:Label ID="lblMarket" runat="server" Text="Marché:" CssClass="label" /></div><asp:DropDownList CssClass="ddlist" ID="ddlMarket" runat="server" AutoPostBack="true" OnSelectedIndexChanged="MarketChanged" /></div><div id="categoryContainer"><div class="labelContainer"><asp:Label ID="lblCategory" runat="server" Text="Catégorie:" CssClass="label" /></div><asp:DropDownList CssClass="ddlist" ID="ddlCategory" runat="server" AutoPostBack="true" OnSelectedIndexChanged="CategoryChanged" /></div><div id="rubricContainer"><div class="labelContainer"><asp:Label ID="lblRubric" runat="server" Text="Rubrique:" CssClass="label" /></div><asp:DropDownList CssClass="ddlist" ID="ddlRubric" runat="server" OnSelectedIndexChanged="RubricSelected" AutoPostBack="true" /></div><div id="adTypesContainer" runat="server"><div id="adTypesTitleContainer" class="titleContainer"><span class="titles">Quel type d'annonce désirez-vous publier?</span></div><poce:AdTypeSelector runat="server" AdTypeControlSize="Small" ID="atsPA" RadioButtonText="Petite annonce" ImageUrl="~/Assets/PA.png" ContainerDisplayStyle="none" /><poce:AdTypeSelector runat="server" AdTypeControlSize="Small" ID="atsPAPhoto" RadioButtonText="Petite annonce photo" ImageUrl="~/Assets/PAPhoto.png" ContainerDisplayStyle="none" /><poce:AdTypeSelector runat="server" AdTypeControlSize="Small" ID="atsupload" RadioButtonText="Annonce finie - upload" ImageUrl="~/Assets/Upload.png" ContainerDisplayStyle="none" /><poce:AdTypeSelector runat="server" AdTypeControlSize="Small" ID="atsModule" RadioButtonText="Module" ImageUrl="~/Assets/Module.png" ContainerDisplayStyle="none" /><poce:AdTypeSelector runat="server" AdTypeControlSize="Big" ID="atsMM" RadioButtonText="Annonce à composer mm" ImageUrl="~/Assets/MM.png" ContainerDisplayStyle="none" /><asp:HiddenField runat="server" ID="hdCheckAdType" Value="" /></div><div id="errorContainer"><asp:Label ID="lblErrorMessage" runat="server" Text="" /></div><div class="em_bg4" style="width: 100%; display: none" runat="server" id="ConfirmButtonConfirmation"><div id="em_aufgabe_next" style="padding: 9px 20px 9px 9px;"><asp:LinkButton ID="LinkButton1" class="buttonorange" OnClick="ConfirmChoice" runat="server" PostBackUrl="Default.aspx"><img src="Assets/next-step.png" border="0" alt="" /></asp:LinkButton></div><div class="clr"><br></div></div><div id="DebugContainer"><asp:Label runat="server" ID="lblDebug" /></div></div></div></ContentTemplate></asp:UpdatePanel></asp:Content>
Thank you for your help!
i use modalpop extender and in the panel i have textbox with calender but its not working
any opensource control to select only years
I want to use the Ajax HTMLEditorExtender. The webpage on it strongly recommends protecting the website that uses this, from XSS (malicious scripting). So they say to modify the web.config as follows:
<configuration><configSections><sectionGroup name="system.web"><section name="sanitizer" requirePermission="false" type="AjaxControlToolkit.Sanitizer.ProviderSanitizerSection, AjaxControlToolkit"/></sectionGroup></configSections> AND correspondingly:<system.web><sanitizer defaultProvider="AntiXssSanitizerProvider"><providers><add name="AntiXssSanitizerProvider" type="AjaxControlToolkit.Sanitizer. AntiXssSanitizerProvider"></add></providers></sanitizer>
The problem is that the name "sanitizer" is not recognized (the part within System.web) even though the first part of the web.config creates a "section name" for it.
Is the documentation outdated? Thanks,
I have a button on my page (with ajax ConfirmButtonExtender).
If on the page the user has selected over say, 1 million rows of data (this is calculated in the code-behind), when they then click on the the button, a pop up message will ask if they wanted to batch export the selection (i.e. Yes or Cancel).
So essentially, there are 2 possible scenarios.
1) Selection under 1 million rows.
Do NOT show the pop-up confirm message at all when click on the button - just run some codes in code-behind page. (i.e. Bypass the ConfirmButtonExtender msg).
2) Selection over 1 million rows.
A pop up message appears asking user to confirm if they'd like to batch export selection. User will select Yes or Cancel.
My question is - is it possible for the confirm message from ConfirmButtonExtender to be conditional (based on some calculation in the code-behind)?
How do I go about achieving this? Keep in mind that when user first clicks on the button, some codes will first need to run on code-behind to calculate the # of selections then decide whether to prompt the pop-up message.
Any ideas?
i have a project which is doumnet management system
in this i create table which is desgination
desginationID
DesginationType
In DesginationType what i add ....is it director,mananger or something else..
Hi all,
i have one gridview in it's item template i have taken textbox named as txtProjectName,and i want to make it as auto complete textbox, below is what ia have done. :-
asp:GridView ID="gvDetails" runat="server" AutoGenerateColumns="False"
OnRowDataBound="gvDetails_RowDataBound" CssClass="GridViewStyle">
<Columns>
<asp:TemplateField>
<HeaderTemplate>
<asp:Label ID="Label3" runat="server" Text="Machine No"></asp:Label>
</HeaderTemplate>
<ItemTemplate>
<asp:Label ID="lblMachineNo" runat="server"></asp:Label>
<asp:Label ID="lblMachineId" Text='<%#Eval("AssetId") %>' Visible="false" runat="server"></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>
<asp:Label ID="Label7" runat="server" Text="Sr. No."></asp:Label>
</HeaderTemplate>
<ItemTemplate>
<asp:Label ID="lblSrNo" Text='<%#Eval("SrNo") %>' runat="server"></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>
<asp:Label ID="Label4" runat="server" Text="Brand"></asp:Label>
</HeaderTemplate>
<ItemTemplate>
<asp:Label ID="lblBrand" runat="server"></asp:Label>
<asp:Label ID="lblBrandId" Text='<%#Eval("Brand") %>' Visible="false" runat="server"></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>
<asp:Label ID="lblFi" runat="server" Text="Field off"></asp:Label>
</HeaderTemplate>
<ItemTemplate>
<asp:DropDownList ID="ddlFieldoff" runat="server">
</asp:DropDownList>
<asp:Label ID="lblFieldId" Text='<%#Eval("Location") %>' runat="server" Visible="False"></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>
<asp:Label ID="Label5" runat="server" Text="Dispatch Date"></asp:Label>
</HeaderTemplate>
<ItemTemplate>
<asp:TextBox ID="txtDispatchDate" runat="server" Width="80px"></asp:TextBox><asp:CalendarExtender
ID="txtDispatchDate_CalendarExtender" runat="server" Enabled="True"
Format="dd/MM/yyyy" TargetControlID="txtDispatchDate">
</asp:CalendarExtender>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>
<asp:Label ID="Label6" runat="server" Text="Project Name"></asp:Label>
</HeaderTemplate>
<ItemTemplate>
<asp:TextBox ID="txtProjectName" runat="server"></asp:TextBox>
<asp:AutoCompleteExtender ID="txtProjectName_AutoCompleteExtender"
runat="server" CompletionListCssClass="autocomplete_completionListElement"
CompletionListHighlightedItemCssClass="autocomplete_highlightedListItem"
CompletionListItemCssClass="autocomplete_listItem" DelimiterCharacters=""
Enabled="True" MinimumPrefixLength="1" ServiceMethod="GetProjectNames"
ServicePath="~/LMSWebService.asmx" TargetControlID="txtProjectName"
CompletionInterval="10" CompletionSetCount="12">
</asp:AutoCompleteExtender>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>
<asp:Button ID="btnAllot" runat="server" Text="Allot" CssClass="SaveButton" OnClick="btnAllot_Click" />
</HeaderTemplate>
<ItemTemplate>
<asp:CheckBox ID="chbxAllot" runat="server" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
<HeaderStyle CssClass="GridHeaderStyle" />
</asp:GridView>
below is the WebService code. :-
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
// To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
[System.Web.Script.Services.ScriptService]
public class LMSWebService : System.Web.Services.WebService {
public LMSWebService () {
//Uncomment the following line if using designed components
//InitializeComponent();
}
[WebMethod]
public string HelloWorld() {
return "Hello World";
}
[WebMethod]
[System.Web.Script.Services.ScriptMethod]
public List<string> GetProjectNames(string strPrefix)
{
List<string> result = new List<string>();
using (OleDbConnection conole = new OleDbConnection(@"Provider=Microsoft.JET.OlEDB.4.0;" + @"Data Source=" + Server.MapPath("App_Data/Data/fors.mdb") + ""))
{
using (OleDbCommand cmdole = new OleDbCommand("SELECT Distinct JobNo,JobName from master where closeStatus<>'c' and JobName Like '*"+ strPrefix +"*'", conole))
{
conole.Open();
OleDbDataReader oldr = cmdole.ExecuteReader();
while (oldr.Read() == true)
{
result.Add(oldr[1].ToString());
}
oldr.Dispose();
cmdole.Dispose();
conole.Close();
return result;
}
}
}
}
.but its not working ...
i have written in the grid row databound also..as below :-
TextBox txtProjects = ((TextBox)e.Row.FindControl("txtProjectName"));
AjaxControlToolkit.AutoCompleteExtender AutoCompelte1 = ((AjaxControlToolkit.AutoCompleteExtender)e.Row.FindControl("txtProjectName_AutoCompleteExtender"));
AutoCompelte1.TargetControlID = txtProjects.ID;
please help i am not getting the solution ..
I want to attach an event to the Previous and Next arrow buttons in the Calendar.
I find that I can install ajaxcontroltookit (by downloading from codeplex to my local PC), and I can open Visual Studio and create a tab in the left panel and right click and select "choose items" and choose items from the toolkit. I can drag those items onto a form. Generally those items will have a prefix, such as <ajaxcontrolToolkit:Html5Extender>. But now suppose I want to ftp that asp page, with the ajax controls on it, to a web server that has asp.net installed. The webserver is supposed to support ajax as well. How do I know what prefix to use? I assume that the webserver doesn't require me to upload the ajaxcontroltookit, since the basic ajax control are built into the latest versions of asp.net. So I shouldn't use the prefix "ajaxcontrolToolkit". But I tried the prefix "asp:" and that didn't work.
So what should I be doing to get the HTML5extender to work on a website that has Windows 12, and Net 4.5, and the latest asp version?
I have a VS2012 ASP.NET web application that is using the Ajax Control Toolkit. I have added the Ajax Control Toolkit using NuGet package manager to the project. I have button controls that are using the RoundedCornerExtender. I have Visual Studio 2012 to publish the site to my Windows Server 2008 R2 machine. The site publishes without errors, but the rounded buttons are not displaying rounded corners. They display as regular buttons.
The kicker in all of this is that if I go to the server desktop, and open an IE browser and browse to the site using localhost, the buttons will display properly. If I am on that same server desktop and browse to the site using the hostname, the buttons do NOT display correctly.
It would appear like the Ajax control toolkit is only working when browsing with localhost, and not with hostname. I have tried tweaking IIS settings and cannot seem to get this resolved. The directory structure looks correct. I cannot figure out why the page renders differently from the same browser on the same computer. The only difference is the url containing localhost, vs. hostname.
Also, if I browse to the server using a different PC using IE, the buttons also render incorrectly. The buttons only render properly if I am running the browser on the server and browse to localhost.
I have a web page with a TabContainer control in it. The master page has a Toolscript Manager on it for use in all the pages. I have a ListView inside one of the tabs of the TabContainer and would like to use an UpdatePanel inside of the InsertItemtemplate of that ListView. I put the UpdatePanel inside the template but it did not work 9continued to do a full postback). I even tried it around the entire ListView but neither worked. What do I need to do to get this to work and not postback the full page? Thanks.
http://www.asp.net/ajaxLibrary/AjaxControlToolkitSampleSite/ComboBox/ComboBox.aspx
Using ASP.NET 3.5 created in VS 2008
I have code that builds a message box, that was written by a former co-worker. I use it on all my web forms where I want a message box. it works perfectly when the code is on each form.
I've tried to put the server-side code into a class, and call it from the class. When the code is called, the web form otherwise works correctly, and no error messages appear, but neither does the message box.
Here's the html code:
<body style="background-color: #ccffff">
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server" />
Textboxes, labels, other stuff goes here
<!-- ######################################## POPUP MESSAGE BOX ######################################################## -->
<!--### Include LinkButton as Target Control and Leave out Text to Make it Invisible ###-->
<asp:LinkButton ID="lnkPopup" runat="server" />
<asp:ModalPopupExtender ID="mpeModalWindow" TargetControlID="lnkPopup" PopupControlID="pnlPopup"
runat="server" Drag="True" DropShadow="True" X="-1" Y="-1" Enabled="True" BackgroundCssClass="modalBackground"
PopupDragHandleControlID="pnlPopup" RepositionMode="RepositionOnWindowScroll" />
<!--### X and Y Are Screen Coordinates to Position the Popup Extender and Can Be Set Programmtically in Behind Code ###-->
<!--### The PANEL Will Render the Image (Icon), Text, and Buttons in The ModalPopUp Extender ###-->
<asp:Panel ID="pnlPopup" BackColor="#5BBFB0" Width="300" runat="server" Style="display: none"
CssClass="modalPopup" BorderStyle="Ridge" BorderWidth="5">
<!--### Ajax Update Panel ###-->
<asp:UpdatePanel ID="updatePanel2" runat="server">
<ContentTemplate>
<div class="divHeader" style="line-height: 30px">
<!--### The Message Box Display Header ###-->
<asp:Image ID="Images" runat="server" ImageUrl="" Height="30px" Width="30px" ImageAlign="Left" />
<asp:Label ID="lbl_Header" runat="server" Width="240px" ForeColor="#FFFF66" Font-Bold="True"
Font-Size="Large" CssClass="boxHeader" />
</div>
<br />
<div class="boxHeader">
<!--### Message Box Message Area ###-->
<asp:Label ID="lbl_BoxMessage" runat="server" Width="260" />
</div>
<br />
<div class="boxHeader">
<!--### Message Box Button Area ###-->
<asp:Button ID="btn_OK" Text="OK" runat="server" OnClick="btnOK_Cancel_Click" BorderStyle="Outset"
BackColor="#CCCCCC" ForeColor="#993300" Width="65px" CausesValidation="False" />
<asp:Button ID="btn_Cancel" Text="Cancel" OnClick="btnOK_Cancel_Click" runat="server"
BorderStyle="Outset" BackColor="#CCCCCC" ForeColor="#993300" Width="65" />
</div>
<br />
</ContentTemplate>
</asp:UpdatePanel>
</asp:Panel>
<!-- ############################################################################################################################# -->
</form>
</body>
Here is the server side code:
protected void BuildMsgBox(string title, string msg, string icon)
{
//*** Set the Appearance of the Modal Popup Control ***
Image errorImg = (Image)pnlPopup.FindControl("Images");
Label lblMsgBox = (Label)pnlPopup.FindControl("lbl_BoxMessage");
Label lblHeader = (Label)pnlPopup.FindControl("lbl_Header");
Button cancelButton = (Button)pnlPopup.FindControl("btn_Cancel");
Button OKButton = (Button)pnlPopup.FindControl("btn_OK");
lblHeader.Text = title;
lblMsgBox.Text = msg;
errorImg.ImageUrl = icon;
cancelButton.Visible = false;
mpeModalWindow.Show();
}
protected void btnOK_Cancel_Click(object sender, EventArgs e)
{
Button theBtn = (Button)sender;
if (theBtn.ID == "btn_OK")
{
mpeModalWindow.Hide();
}
}
Here I'm calling it from within a button on_click event:
snip...
if (dateCompare > 0)
{
title = "Invalid selection!";
msg = "The ending month must be later than the starting month.";
icon = "IconImages/warning.ico";
BuildMsgBox(title, msg, icon);
}
Now here is the code put into methods in a class:
using System;
using System.Data;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
/// <summary>
/// Summary description for MessageBox
/// </summary>
public static class MessageBox
{
public static void BuildMsgBox(string title, string msg, string icon)
{
Page page = HttpContext.Current.Handler as Page; //Reference to the calling form
Panel pnlPopup = HttpContext.Current.Handler as Panel;
AjaxControlToolkit.ModalPopupExtender mpeModalWindow = HttpContext.Current.Handler as AjaxControlToolkit.ModalPopupExtender;
//*** Set the Appearance of the Modal Popup Control ***
Image errorImg = (Image)pnlPopup.FindControl("Images");
Label lblMsgBox = (Label)pnlPopup.FindControl("lbl_BoxMessage");
Label lblHeader = (Label)pnlPopup.FindControl("lbl_Header");
Button cancelButton = (Button)pnlPopup.FindControl("btn_Cancel");
Button OKButton = (Button)pnlPopup.FindControl("btn_OK");
lblHeader.Text = title;
lblMsgBox.Text = msg;
errorImg.ImageUrl = icon;
cancelButton.Visible = false;
mpeModalWindow.Show();
}
public static void btnOK_Cancel_Click(object sender, EventArgs e)
{
Page page = HttpContext.Current.Handler as Page; //Reference to the calling form
AjaxControlToolkit.ModalPopupExtender mpeModalWindow = HttpContext.Current.Handler as AjaxControlToolkit.ModalPopupExtender;
Button theBtn = HttpContext.Current.Handler as Button;
if (theBtn.ID == "btn_OK")
{
mpeModalWindow.Hide();
}
}
}
And here it is being called from within the same button on_click event as above:
snip...
if (dateCompare > 0)
{
title = "Invalid selection!";
msg = "The ending month must be later than the starting month.";
icon = "IconImages/warning.ico";
MessageBox.BuildMsgBox(title, msg, icon);
Im building a AJAX file uploader tool using the AjaxFileUpload control and then displaying the uploaded files in a repeater in an updatepanel along with buttons to then remove each file from the list.
So far i have the file uploading and adding to the list within the repeater and also the ability to delete the files from the list working fine BUT i then get a JS error which stops the FileUploader from allowing more files to be uploaded (when the user clicks delete).
Front end code :
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager><script type="text/javascript"> function uploadComplete(sender) { var hiddenField = $get('<%=HiddenField3.ClientID %>'); if (hiddenField) { hiddenField.value = (new Date()).getTime(); __doPostBack('<%=HiddenField3.ClientID %>', ''); } } function DeleteButton(btn) { $get("#".btn).click(); }</script><asp:PlaceHolder runat="server" ID="phControls"><asp:UpdatePanel ID="uPnlUploadedFiles" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="False"><ContentTemplate><asp:Repeater runat="server" ID="rptFiles"><HeaderTemplate><ul></HeaderTemplate><ItemTemplate><asp:Literal runat="server" ID="litFileName"/> - <asp:Button runat="server" Text="Delete" ID="btnDelete" CommandName="deletefile" /><br /></ItemTemplate><FooterTemplate></ul></FooterTemplate></asp:Repeater><asp:HiddenField ID="HiddenField3" runat="server" OnValueChanged="HiddenField3_ValueChanged" /></ContentTemplate></asp:UpdatePanel><ajaxToolkit:AjaxFileUpload runat="server" ID="AjaxFileUpload1" MaximumNumberOfFiles="5" OnClientUploadComplete="uploadComplete" /></asp:PlaceHolder>
Code Behind :
public partial class DocumentUploader : System.Web.UI.UserControl { public int DocumentFolderId { get { if (Session["DocumentFolderId"] == null) Session["DocumentFolderId"] = 0; return (int)Session["DocumentFolderId"]; } set { int documentFolderId; int.TryParse(value.ToString(), out documentFolderId); Session["DocumentFolderId"] = documentFolderId; } } public Dictionary<string, UploadedFile> UploadedFiles { get { if (Session["UploadedFiles"] == null) Session["UploadedFiles"] = new Dictionary<string, UploadedFile>(); return Session["UploadedFiles"] as Dictionary<string, UploadedFile>; } set { Session["UploadedFiles"] = value; } } protected override void OnInit(EventArgs e) { AjaxFileUpload1.UploadComplete += AjaxFileUpload1_UploadComplete; rptFiles.ItemDataBound += rptFiles_ItemDataBound; rptFiles.ItemCommand += rptFiles_ItemCommand; } void rptFiles_ItemCommand(object source, RepeaterCommandEventArgs e) { if (e.CommandName == "deletefile") { if (e.CommandArgument != null) { UploadedFiles.Remove(e.CommandArgument.ToString()); rptFiles.DataSource = UploadedFiles; rptFiles.DataBind(); uPnlUploadedFiles.Update(); } } } void rptFiles_ItemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.DataItem == null) return; KeyValuePair<string, UploadedFile> kvp = (KeyValuePair<string, UploadedFile>)e.Item.DataItem; if (kvp.Value != null) { UploadedFile uploadedFile = kvp.Value; if (uploadedFile != null) { Literal litFileName = e.Item.FindControl("litFileName") as Literal; if (litFileName != null) litFileName.Text = uploadedFile.FileName; Button btnDelete = e.Item.FindControl("btnDelete") as Button; if (btnDelete != null) { btnDelete.CommandArgument = kvp.Key; btnDelete.OnClientClick = string.Format("DeleteButton('{0}');return false;", btnDelete.ClientID); } } } } protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { phControls.Visible = DocumentFolderId != 0; } } void AjaxFileUpload1_UploadComplete(object sender, AjaxControlToolkit.AjaxFileUploadEventArgs e) { if (e != null && !string.IsNullOrEmpty(e.FileId)) { // add files to list UploadedFiles.Add(e.FileId, new UploadedFile() { ContentType = e.ContentType, FileId = e.FileId, FileName = e.FileName, FileSize = e.FileSize, MediaId = UploadFile(e) }); } } private int UploadFile(AjaxControlToolkit.AjaxFileUploadEventArgs e) { int mediaId = 0; if (UmbracoUtils.GetSiteSettingsValue("memberDocumentsFolder") != null) { int memberLogosFolderId; if (int.TryParse(UmbracoUtils.GetSiteSettingsValue("memberDocumentsFolder"), out memberLogosFolderId)) { //mediaId = MediaUtils.CreateImage(DocumentFolderId, fileUpload.PostedFile, 0); } } return mediaId; } protected void HiddenField3_ValueChanged(object sender, EventArgs e) { rptFiles.DataSource = UploadedFiles; rptFiles.DataBind(); uPnlUploadedFiles.Update(); } } public class UploadedFile { public string ContentType { get; set; } public string FileId { get; set; } public string FileName { get; set; } public int FileSize { get; set; } public int MediaId { get; set; } }
JS error :
Sys.ArgumentUndefinedException: Sys.ArgumentUndefinedException: Value cannot be undefined. Parameter name: id [Break On This Error] { name: "eventArgs", type: XMLHttpRequestProgressEvent }
Any suggestions appreciated.
Steve
I'm using google maps in my site with markers.
When a marker is clicked, I'd like to display a popup.
this is easy, my problem is that the popup needs to be updated from the database before and the popup has some links that should be inside an UpdatePanel to avoid refresh.
Any idea on how to do this?
I can use the marker function to display a popup (with a given html) but I don't have any idea how to get the html with the updatepanel .
I thougt about using the ajax popup control but I don't know how to position it on the marker.
Someone probably impelemented this behavior.. help? :-)
Thanks.
I recently posted a question over on Stackoverflow and wasn't able to get a response from the community.
Is there a bug with the AjaxControlToolkit's PieChart, or am I forgetting something? Using the sample pie chart provided with the library's sample site, I removed all but two PieChartValue's and set the data to 70 and 30.
However, having only two values is not rendering the chart properly. I've verified it in both IE9 and FF11. If I add a third value and adjust the data to total 100, I'm golden...to a degree. If I have a data value over 50%, the PieChart doesn't render properly. A single value of 100 renders incorrectly as well, displaying a vertical line.
It looks like when the chart renders, it does so using the same arc by the shortest distance from point to point.
I thought the PieChart was supposed to support 1 or more data elements according to the library.