I have my aspx as below:
<%# Page Language="C#" AutoEventWireup="true" CodeFile="test2.aspx.cs" Inherits="test2" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%# Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<ajaxToolkit:ToolkitScriptManager id="ToolkitScriptManager1" runat="server"></ajaxToolkit:ToolkitScriptManager>
<div>
<asp:TextBox runat="server" ID="txtDateFerie" autopostback="True"/>
<asp:Button runat="Server" ID="ibtnDateFerie"
CausesValidation="False" />
<ajaxToolkit:CalendarExtender Format="dd/MM/yyyy" ID="cbeDateFerie" runat="server" Enabled="True"
TargetControlID="txtDateFerie" PopupButtonID="ibtnDateFerie" />
</div>
</form>
</body>
</html>
I have AjaxControlToolkit.dll and System.Web.Extensions.dll in my project. However, when I click on the button, the calendar is not shown. I have looked for an answer on the internet, and it seems I am not missing anything here. Any idea where the problem may be?
Related
I am trying to develop an Ajax based website. where is installed ajax control toolkit on visual studio 2010. I created a page.
Here is the code
<%# Page Language="C#" AutoEventWireup="true" CodeBehind="test2.aspx.cs" Inherits="QMSStandard.test2" %>
<%# 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 runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<asp:CalendarExtender ID="CalendarExtender1" runat="server" TargetControlID="TextBox1">
</asp:CalendarExtender>
</div>
</form>
when I run this page its shows error
Error: AjaxControlToolkit requires ASP.NET Ajax 4.0 scripts. Ensure
the correct version of the scripts are referenced. If you are using an
ASP.NET ScriptManager, switch to the ToolkitScriptManager in
AjaxControlToolkit.dll.
Kindly suggest how can i use these controls.
first remove <asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager> and then drag and drop <asp:ToolkitScriptManager> from Ajax Toolbox control
I have tried this code to disable future dates to be selected but it does not seem to be working.
public void Calendar1_DayRender(object o, DayRenderEventArgs e)
{
if (e.Day.Date < DateTime.Today)
{
e.Day.IsSelectable = false;
}
}
<%# Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<!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 runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server" />
<link href="CSS.css" rel="stylesheet" type="text/css" />
<script src="Extension.min.js" type="text/javascript"></script>
<asp:TextBox ID="txtDate" runat="server" CssClass="disable_future_dates" />
<asp:ImageButton runat="server" ID="imgPopup" ImageUrl="~/Calendar.png" />
<cc1:CalendarExtender ID="CalendarExtender1" runat="server" TargetControlID="txtDate"
PopupButtonID="imgPopup" />
</form>
</body>
</html>
Disabling Future Dates
In order to disable future dates we need to follow 2 simple steps.
Add CSS.css and Extension.min.js files just below the ScriptManager as shown in the HTML Markup above.
Set the CssClass property to disable_future_dates for the TextBox control associated with the CalendarExtender for which you want to disable the future dates.
That’s it you need to do and your AJAX CalendarExtender will now disable the future dates.
When i add a radButton for example to a web page (ASP.Net) and give it a skin and run the web page,
if i am connected to internet then it shows the skin very well.
But if i am not connected to internet then it doesn't show the skin.
obviously it downloads something.
How to make it works offline (Without Internet) ??
This is the Design code
<%# Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="Default" %>
<!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 runat="server">
<title></title>
<telerik:RadStyleSheetManager id="RadStyleSheetManager1" runat="server" />
</head>
<body>
<form id="form1" runat="server">
<telerik:RadScriptManager ID="RadScriptManager1" runat="server">
<Scripts>
<asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
<asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
<asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
</Scripts>
</telerik:RadScriptManager>
<script type="text/javascript">
//Put your JavaScript code here.
</script>
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
</telerik:RadAjaxManager>
<div>
<telerik:RadButton ID="RadButton1" runat="server" Skin="Web20" Text="RadButton">
</telerik:RadButton>
</div>
</form>
</body>
</html>
Check web.config file for Telerik CDN settings:
<add key="Telerik.ScriptManager.TelerikCdn" value="Enabled" />
<add key="Telerik.StyleSheetManager.TelerikCdn" value="Enabled" />
and remove them to enable local css and js files.
Bin folder contain
MSCaptcha.dll
MSCaptcha.xml
html page contain
<%# Page Language="C#" AutoEventWireup="true" CodeFile="captcha.aspx.cs" Inherits="_Default" %>
<%# Register Assembly="MSCaptcha" Namespace="MSCaptcha" TagPrefix="CaptchaImage" %>
<!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 runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<CaptchaImage:CaptchaControl ID="CaptchaControl2" runat="server" />
</div>
</form>
</body>
</html>
Web config
<httpHandlers>
<add verb="GET" path="CaptchaImage.axd" type="MSCaptcha.CaptchaImageHandler, MSCaptcha"/>
</httpHandlers>
I have done all the things as shown in
http://www.msdotnet.co.in/2012/08/how-to-add-captcha-image-in-aspnet.html
and its running fine on local host but on online its showing Captcha text instead of image.
what shall i do
I have used Google Captcha, which will run on any web server.
Hello how can i add to imagebutton mouse leave event to run pagemethod i can't use javascript any idea?
<%# Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Zadanie_1_rysunki._Default" %>
<!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 runat="server">
<title></title>
</head>
<body><center>
<form id="form1" runat="server">
<asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="~/img/1.jpg" />
<div>
</div>
<asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true">
</asp:ScriptManager>
</form>
</center>
</body>
</html>
Since you have 'EnablePageMethods' set to "true", I believe you can set the OnMouseLeave event to
"PageMethods.MyPageMethod(param1, param2, paramN);"