Quantcast
Channel: ASP.NET AJAX + Ajax Control Toolkit (ACT)
Viewing all 5678 articles
Browse latest View live

no source error

$
0
0

i'm getting an error i can't debug. the error only shows up in visual web developer (express 2010). i can start the website, browse to a few pages but on one page (only) i get the following error IN vwd:

No Source Available

Call stack location:
AjaxControlToolkit.DLL!AjaxControlToolkit.ExtenderControlBase.OnLoad(System.EventArgs e) Line 306

Source file information:

Locating source for 'f:\TeamCity\buildAgent\work\80acd78aa4c25314\Server\AjaxControlToolkit\ExtenderBase\ExtenderControlBase.cs'. Checksum: MD5 {77 12 2 51 e9 6d 39 a4 13 34 4d 61 56 3e 88 d7}
The file 'f:\TeamCity\buildAgent\work\80acd78aa4c25314\Server\AjaxControlToolkit\ExtenderBase\ExtenderControlBase.cs' does not exist.
Looking in script documents for 'f:\TeamCity\buildAgent\work\80acd78aa4c25314\Server\AjaxControlToolkit\ExtenderBase\ExtenderControlBase.cs'...
Looking in the projects for 'f:\TeamCity\buildAgent\work\80acd78aa4c25314\Server\AjaxControlToolkit\ExtenderBase\ExtenderControlBase.cs'.
The file was not found in a project.
Looking in directory 'C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\vc7\atlmfc'...
Looking in directory 'C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\vc7\crt'...
Looking in directory 'c:\'...
The debug source files settings for the active solution indicate that the debugger will not ask the user to find the file: f:\TeamCity\buildAgent\work\80acd78aa4c25314\Server\AjaxControlToolkit\ExtenderBase\ExtenderControlBase.cs.
The debugger could not locate the source file 'f:\TeamCity\buildAgent\work\80acd78aa4c25314\Server\AjaxControlToolkit\ExtenderBase\ExtenderControlBase.cs'.

sometimes the (dev) web server also errors-out.

i think i have more clues:

it's the only page i'm using a controlbundle on. i removed the bundle and got an error in the browser. i ran a trace and got an 'Unhandled Execution Error' on Begin Load:

The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).
  at System.Web.UI.ControlCollection.Add(Control child)
  at AjaxControlToolkit.ScriptObjectBuilder.RegisterCssReferences(Control control) in f:\TeamCity\buildAgent\work\80acd78aa4c25314\Server\AjaxControlToolkit\ExtenderBase\ScriptObjectBuilder.cs:line 323
  at AjaxControlToolkit.ExtenderControlBase.OnLoad(EventArgs e) in f:\TeamCity\buildAgent\work\80acd78aa4c25314\Server\AjaxControlToolkit\ExtenderBase\ExtenderControlBase.cs:line 305
  at System.Web.UI.Control.LoadRecursive()
  at System.Web.UI.Control.LoadRecursive()
  at System.Web.UI.Control.LoadRecursive()
  at System.Web.UI.Control.LoadRecursive()
  at System.Web.UI.Control.LoadRecursive()
  at System.Web.UI.Control.LoadRecursive()
  at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)


Exporting Ajax Chart Control to Excel

$
0
0

hi, friends,

I am using Asp.net Ajax Chart Control.

it is nice and simple to use, and also easier to manage than normal asp.net chart control.

but I got error when I try to export Ajax chart to excel.

the error is :

Script control 'BarChart1' is not a registered script control. Script controls must be registered using RegisterScriptControl() before calling RegisterScriptDescriptors().
Parameter name: scriptControl

my Ajax Chart id is BarChart1.

I don't know how to register ScriptControl().

in my codebehind, I already wrote already to export GridView.

public override void VerifyRenderingInServerForm(Control control)
    {
        //base.VerifyRenderingInServerForm(control);
        //ScriptManager sm = ScriptManager.GetCurrent(Page);
        //sm.RegisterScriptControl(BarChart1);
    }

I believe this error is what other peoples also have encountered before.

but I still cannot find the solution yet.

regards

Could not load control AjaxControlToolkit.TabContainer

$
0
0

Message: Exception of type 'System.Web.HttpUnhandledException' was thrown.
Stack trace: at System.Web.UI.Page.HandleError(Exception e)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest()
at System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context)
at System.Web.UI.Page.ProcessRequest(HttpContext context)
at ASP.holderobjects_enrolmentpage_aspx.ProcessRequest(HttpContext context) in c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\500bd36a\62916912\App_Web_dj3j4gni.32.cs:line 0
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
Inner Message: Could not load control AjaxControlToolkit.TabContainer. The script reference(s) of this control was not loaded correctly. If AjaxControlToolkit.config is used, probably this control is not registered properly.
Hops: Exception of type 'System.Web.HttpUnhandledException' was thrown.
Source: System.Web
Inner Exception:System.Exception: Could not load control AjaxControlToolkit.TabContainer. The script reference(s) of this control was not loaded correctly. If AjaxControlToolkit.config is used, probably this control is not registered properly.
at AjaxControlToolkit.ToolkitScriptManager.OnPreRender(EventArgs e)
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
Base Exception:System.Exception: Could not load control AjaxControlToolkit.TabContainer. The script reference(s) of this control was not loaded correctly. If AjaxControlToolkit.config is used, probably this control is not registered properly.
at AjaxControlToolkit.ToolkitScriptManager.OnPreRender(EventArgs e)
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

Please help me to resolve this we are receiving this error frequently. 

Thanks in advance. 

Regards, 

N

Can I use AjaxContoltoolKit source of FIPS compliance fix

$
0
0

Hi, in our web project we are using AjaxContoltoolKit dll which was downloaded from the last release source https://ajaxcontroltoolkit.codeplex.com/releases/view/116091. It is working fine in normal environment.

Some days back, one of our customer has raised the FIPS compliant issue with AjaxContoltoolKit. As we have searched in AjaxContoltoolKit codeplex source, we found the following fix https://ajaxcontroltoolkit.codeplex.com/SourceControl/network/forks/cstick/AjaxControlToolkitFIPSHashAlgorithm for FIPS compliant.

We have downloaded this fix and tested it in our FIPS compliance enabled system, now it is working fine.

My question is, The FIPS compliant fix is not released yet in codeplex project and it is stated the message "Being Evaluated", so that can I use this source in my project? or give me any suggestions to overcome this FIPS compliant pbm.

PopupControlExtender and ImageButton Display Problems, Popup Disappears

$
0
0


I have the code below which uses a simple Image Button, Popup Control Extender and a Panel with a Table f text in it. It is a simple help/reference popup. In general it works. But the problem is that when you click on the image button the popup/table shows and then immediately disappears. Here's the kicker, if I click on the image button and hold the mouse button down and then roll away from the image button the popup display stays visible! Workable but annoying. Can someone help?

 

Update... if I add "OnClientCLick="return false;" to the Image Button definition the popup comes up and stays up, but will not disappear unless I click somewhere else on the screen. What should I use instead of "OnClientClick="return false;"?

 

<asp:ImageButtonID="BishopScoreRef_ImageButton"runat="server"Height="20px"ImageAlign="AbsMiddle"ImageUrl="~/Images and Icons/cal.png"Width="20px"/>

<asp:PopupControlExtenderID="BishopScoreRef_ImageButton_PopupControlExtender" runat="server"DynamicServicePath=""Enabled="True"ExtenderControlID=""PopupControlID="BishopsScore_Panel"Position="Bottom"TargetControlID="BishopScoreRef_ImageButton"></asp:PopupControlExtender>

<asp:PanelID="BishopsScore_Panel"runat="server"BackColor="White"BorderColor="Black"BorderStyle="Outset"BorderWidth="1px"HorizontalAlign="Center">

<asp:TableID="BishopScoreRef_Table"runat="server"BorderStyle="None"Caption="Bishop Scoring System Reference Table" CellPadding="2"Font-Size="Small"HorizontalAlign="Left"Visible="True"Width="500px"BackColor="White">

<asp:TableRowID="TableRow1"runat="server"HorizontalAlign="Center">

<asp:TableCellID="TableCell1"runat="server">Score</asp:TableCell>

<asp:TableCellID="TableCell2"runat="server">Dilation (cm)</asp:TableCell>

<asp:TableCellID="TableCell3"runat="server">Cervical Position</asp:TableCell>

<asp:TableCellID="TableCell4"runat="server">Effacement (%)</asp:TableCell>

<asp:TableCellID="TableCell5"runat="server">Station</asp:TableCell>

<asp:TableCellID="TableCell6"runat="server">Cervical Consistency</asp:TableCell>

</asp:TableRow>

<asp:TableRowID="TableRow2"runat="server"HorizontalAlign="Center">

<asp:TableCellID="TableCell7"runat="server">0</asp:TableCell>

<asp:TableCellID="TableCell8"runat="server">Closed</asp:TableCell>

<asp:TableCellID="TableCell9"runat="server">Posterior</asp:TableCell>

<asp:TableCellID="TableCell10"runat="server">0-30</asp:TableCell>

<asp:TableCellID="TableCell11"runat="server">-3</asp:TableCell>

<asp:TableCellID="TableCell12"runat="server">Firm</asp:TableCell>

</asp:TableRow>

<asp:TableRowID="TableRow3"runat="server"HorizontalAlign="Center">

<asp:TableCellID="TableCell13"runat="server">1</asp:TableCell>

<asp:TableCellID="TableCell14"runat="server">1-2</asp:TableCell>

<asp:TableCellID="TableCell15"runat="server">Midposition</asp:TableCell>

<asp:TableCellID="TableCell16"runat="server">40-50</asp:TableCell>

<asp:TableCellID="TableCell17"runat="server">-2</asp:TableCell>

<asp:TableCellID="TableCell18"runat="server">Medium</asp:TableCell>

</asp:TableRow>

<asp:TableRowID="TableRow4"runat="server"HorizontalAlign="Center">

<asp:TableCellID="TableCell19"runat="server">2</asp:TableCell>

<asp:TableCellID="TableCell20"runat="server">3-4</asp:TableCell>

<asp:TableCellID="TableCell21"runat="server">Anterior</asp:TableCell>

<asp:TableCellID="TableCell22"runat="server">60-70</asp:TableCell>

<asp:TableCellID="TableCell23"runat="server">-1, 0</asp:TableCell>

<asp:TableCellID="TableCell24"runat="server">Soft</asp:TableCell>

</asp:TableRow>

<asp:TableRowID="TableRow5"runat="server"HorizontalAlign="Center">

<asp:TableCellID="TableCell25"runat="server">3</asp:TableCell>

<asp:TableCellID="TableCell26"runat="server">5-6</asp:TableCell>

<asp:TableCellID="TableCell27"runat="server">--</asp:TableCell>

<asp:TableCellID="TableCell28"runat="server">80</asp:TableCell>

<asp:TableCellID="TableCell29"runat="server">+1/+2</asp:TableCell>

<asp:TableCellID="TableCell30"runat="server">--</asp:TableCell>

</asp:TableRow>

</asp:Table>

</asp:Panel>

Not able to bind an Accordian control under ItemTemplate

$
0
0

Hi,

I am using a TextBox under Accordion control and cannot able to bind the Datasource. Here's the code in .aspx:

<asp:TemplateField HeaderText="Message"> 
<ItemTemplate>

<ajaxToolkit:Accordion ID="RequestInfo" runat="server" SelectedIndex="-1" HeaderCssClass="accordianHeader" HeaderSelectedCssClass="accordianHeaderSelected" ContentCssClass="accordianContent" FadeTransitions="true" SuppressHeaderPostbacks="true" TransitionDuration="250" FramesPerSecond="40" RequireOpenedPane="false" AutoSize="None">
<ContentTemplate>
<asp:TextBox ID="txtMessage" runat="server" Text='<%#Eval("Message")%>' TextMode="MultiLine" ReadOnly="true"></asp:TextBox>

</ContentTemplate>

Can some one please suggest what's wrong happening here or what should I do. Have tried Databinder.Eval/Bind also but no luck. 

Thanks

calendar extender not working

$
0
0

hi

i have problem with calendar extender which is not working. this is my set up in vs 2013:

webconfig:

<pages><namespaces><add namespace="System.Web.Optimization" /><add namespace="Microsoft.AspNet.Identity" /></namespaces><controls><add assembly="Microsoft.AspNet.Web.Optimization.WebForms" namespace="Microsoft.AspNet.Web.Optimization.WebForms" tagPrefix="webopt" /><add tagPrefix="cc1" assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" /></controls></pages>



web page:

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server"><cc1:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server" EnableScriptGlobalization="true" EnableScriptLocalization="true"></cc1:ToolkitScriptManager><div><asp:Label ID="lblDate" runat="server" Text="Date" CssClass="lblLong200"></asp:Label><asp:TextBox ID="txtDate" runat="server"  CssClass="txtbox" ></asp:TextBox><cc1:CalendarExtender runat="server" ID="ceDate" TargetControlID="txtDate" Enabled="true" ></cc1:CalendarExtender><div style="height:5px;"></div></div></asp:Content>

everything seems to be ok but it just doesn't work. so i must be missing something ...

how to inject web form page into default page using ajax?

$
0
0

hello masters ... how to inject web form page into default page using ajax with user click on the link. i want the 'page link' clicked will only show on the default page every time user click any link in the Menu. 

Thanks in advance

Prashant 


AjaxFileUpload (ajaxtoolkit) prevent temp folder upload

$
0
0

When i use AjaxFileUpload for file upload, it initially buffers the file into the temp folder and later on upload complete it transfers the file.

How can we prevent the file uploading into temp instead direct to our working upload folder otherwise can i show the progress indicator for server transfer instead of temp folder transfer

how to add image of plus and minus sign on ajaxtoolkit accordion pane header ?

$
0
0

Hi All

I want to add image on each accordion pane header so when they click or expand content it will change plus to minus or vice versa.

Thanks

VIk

Poor performance of a GridView within an Update Panel

$
0
0

We are having a problem with this setup when we have more than 500 rows in the gridview.

The business requirement does not allow us to do paging as we are replacing a classic ASP app and have to match it.

We have discovered that the problem occurs when rendering the page, as the server-side code has completed. 

If we run this in Chrome, the page renders in a few seconds, but in IE9 the same data can take over a minute.

I've seen articles like this:

http://blogs.msdn.com/b/tom/archive/2008/09/15/slow-performance-of-a-gridview-inside-an-updatepanel.aspx  but it didn't work for us.

I'm considering changing from a gridview to a listview but I'm not sure if that will have everything I need.

Any ideas?

 

TreeView to pdf

$
0
0

Hi All,

I have created a web form that will display the Organisation Chart in Tree form. I have dynamically created Tree View control from code behind.Everything working fine.The problem is when I am exporting TreeView to pdf I am getting te following error

"0x800a139e - JavaScript runtime error: Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed."

The source code is

UpdateProgress1.Visible =

false;

            ImgTopBanner.Visible =

false;

            Response.AddHeader(

"content-disposition","attachment;filename=TestPage.pdf");

            Response.Cache.SetCacheability(

HttpCacheability.NoCache);

           

StringWriter sw = newStringWriter();

           

HtmlTextWriter hw = newHtmlTextWriter(sw);

           

this.Page.RenderControl(hw);

           

//TrvPrint.RenderControl(hw);

           

StringReader sr = newStringReader(sw.ToString());

           

Document pdfDoc = newDocument(PageSize.A4, 10f, 10f, 100f, 0f);

           

HTMLWorker htmlparser = newHTMLWorker(pdfDoc);

           

PdfWriter.GetInstance(pdfDoc, Response.OutputStream);

            pdfDoc.Open();

            htmlparser.Parse(sr);

            pdfDoc.Close();

            Response.Write(pdfDoc);

            Response.End();

Please help

Although I Am Using OnDemand="true," Tab Panel Content Loads When Page Loads

$
0
0

Windows Server 2008 R2.  IIS 7.  ASP.Net Framework 4.5.  Ajax Toolkit Version 7.1213 (Dec 2013) for .NET 4.5.

I have a tab control on a page with multiple tabs.  I defined OnDemand="true" for the main tab control.  My expectation is that the content on each tab is not activated or loaded until that tab is selected.  HOWEVER, the content on one of my tabs (which includes a panel with databound dropdownlists, listboxes, etc.), goes right ahead and databinds the controls when the page comes up.  Why is this happening?  I have an onload event handler for the asp:panel control contained on the tab, and it actually hits twice when the page comes up and the tab panel is NOT selected.  Argh!

How to display bold text after returning values using the AutoCompleteExtender

$
0
0

Hello to all,

I was wondering if there is away to display bold or color text within the returning values from an AutoCompleteExtender?

For an example if I type 'Th' to search a name of some movie in the textbox, I should get some values like this:

The body snatchers
The man with one red shoe
The texas chainsaw massacre

I would like to display the values like this:

Movie: The body snatchers
Movie: The man with one red shoe
Movie: The texas chainsaw massacre

Is this possible?

 

Here is my code behind in vb.net:

<scriptrunat="server">      

    <System.Web.Script.Services.ScriptMethod(), _
    System.Web.Services.WebMethod()> _

PublicSharedFunction GetSuggestions(ByVal prefixText AsString,ByVal count AsInteger)AsList(OfString)     

Dim MyConnection AsString = WebConfigurationManager.ConnectionStrings("MiscConnectionString").ConnectionString
Dim con AsSqlConnection = NewSqlConnection(MyConnection)
Dim cmd AsSqlCommand = NewSqlCommand()

cmd.Connection = con
cmd.CommandText ="select cust_no, insured_name, mail_city, actual_location from acctinfo where cust_no LIKE @SearchText + '%' OR insured_name LIKE @SearchText + '%' OR mail_city LIKE @SearchText + '%' OR actual_location LIKE @SearchText + '%'"
cmd.Parameters.AddWithValue("@SearchText", prefixText)
cmd.CommandType = CommandType.Text              

        con.Open()
        Dim customers AsList(OfString) = NewList(OfString)
   
Dim x AsList(OfString) = NewList(OfString)
   
Dim reader AsSqlDataReader = cmd.ExecuteReader


  
While reader.Read()
customers.Add(reader("cust_no").ToString()+ " - "+"Insured Name: "+ reader("insured_name").ToString.Trim()+ " - "+"Mail City: "+ reader("mail_city").ToString.Trim()+ " - "+"Location:"+ reader("actual_location").ToString.Trim()) 
  EndWhile

        con.Close()

Return customers

EndFunction

   

</script>

 

 

ModalPopupExtender closes abruptly on RadioButtonList item multi-click

$
0
0

I've a ModalPopupExtender which has RadioButtonList in it with values True & False with AutoPostBack = 'true'. This is inside a UpdatePanel. On the OnSelectedIndexChanged event of their individual click it does a certain steps (It does work appropriately). But, when either of the values are clicked more than one time (multi-clicked), then this AJAX Modal Popup closes.

Please suggest a workaround.


Form control values outside updatepanel get posted during partial postback.

$
0
0

I have posted a similair question in another thread but thought that since its using partialpost backs and maybe ajax stuff I should retry it here.
This was my previous post http://forums.asp.net/p/2005448/5766719.aspx .

I think that when a updatepanel does a partial postback, asp.net sends all form field (also outside of the updatepanel) to the server and back again. Can I disable this behaviour?

Regards,

Joham

Enable Disable TextBox using Checkbox event

$
0
0

I want to enable textbox in my webpage to be visible with the select/deselect of checkbox using ajax control.

Sys.Services.AuthenticationService on IE 11

$
0
0

I have been using Sys.Services.AuthenticationService for a couple of years on my website but since I installed Internet Explorer 11 it is giving me problems. I use it for logging in a user without the page refreshing. I used this code that I found as an example (I have pretty much the same code myself):http://msdn.microsoft.com/en-us/library/vstudio/bb398896%28v=vs.100%29.aspx

It is a very good way of logging in a user as it works in conjunction with the users that are in the ASP.NET membership tables. The above link does not show the web service but I am using one. I have a file calledAuthService.asmx which calls AuthService.cs in the App_Code folder. This contains all the methods that correspond to the javascript (login, log out etc.) When they are called in the javascript they get called in the C# also.

My site is a Visual Studio ASP.NET website and I have placed all the javascript code from that link in the site.master page. It takes the username and password values from the aspx page. Once it goes into theSys.Services.AuthenticationService.login part it goes to a back-end web service and calls a WebMethod calledlogin. When I set a breakpoint on this method, run my site on localhost and call the login on Firefox or Chrome, it jumps into the method and works perfectly, logging the user in everytime.

In Internet Explorer it does not jump into the method, it just goes as far as the javascript call Sys.Services.AuthenticationService.login. The usernames and passwords are correct and I haveauthenticationService enabled in the web.config file. It is only an issue with Internet Explorer 11 as it worked perfectly on older versions.

If I type the name of the web service into IE 11's address bar, it displays thelogin web method and I can actually enter the username and password and then it jumps into the method in Visual Studio. It just won't do it in the javascript and as I say, it is only in IE 11.

I know there have been issues with Ajax on IE 11 since it was released, this seems like another one. Has anyone had this issue before and resolved it?

Thank you for any replies.

MultiHandleSliderExtender

$
0
0

Where I'm missing....

I have two MultiHandleSliderExtender in a page. I want these date labels with the handles of each respectively.

<table><tr><td style="vertical-align: bottom; width: 100px;"><asp:TextBox ID="txtMultiHandle1_1_BoundControl" runat="server" Width="30" Text="0"
                    AutoPostBack="True" Style="display: none;" /></td><td style="vertical-align: middle;"><br /><br /><br /><br /><br /><br /><asp:TextBox ID="sliderOne" runat="server" Style="display: none;" AutoPostBack="true" /><cc1:MultiHandleSliderExtender ID="multiHandleSliderExtenderOne" runat="server" BehaviorID="multiHandleSliderExtenderOne"
                    TargetControlID="sliderOne" Orientation="Horizontal" EnableHandleAnimation="true"
                    EnableKeyboard="true" EnableMouseWheel="true" ShowHandleDragStyle="true" ShowHandleHoverStyle="true"
                    Minimum="0" Length="365" EnableInnerRangeDrag="true" ShowInnerRail="true" HandleAnimationDuration="0.0001"
                    RaiseChangeOnlyOnMouseUp="true" ><MultiHandleSliderTargets><cc1:MultiHandleSliderTarget ControlID="txtMultiHandle1_1_BoundControl" /><cc1:MultiHandleSliderTarget ControlID="txtMultiHandle1_2_BoundControl" /></MultiHandleSliderTargets></cc1:MultiHandleSliderExtender></td><td style="vertical-align: bottom; width: 100px;"><asp:TextBox ID="txtMultiHandle1_2_BoundControl" runat="server" Width="30" Text="40"
                    AutoPostBack="True" Style="display: none;" /></td></tr></table><table><tr><td style="vertical-align: bottom; width: 100px;"><asp:TextBox ID="txtMultiHandle2_1_BoundControl" runat="server" Width="30" Text="0"
                    AutoPostBack="True" Style="display: none;" /></td><td style="vertical-align: middle;"><br /><br /><br /><br /><br /><br /><asp:TextBox ID="sliderTwo" runat="server" Style="display: none;" AutoPostBack="true" /><cc1:MultiHandleSliderExtender ID="multiHandleSliderExtenderTwo" runat="server" BehaviorID="multiHandleSliderExtenderTwo"
                    TargetControlID="sliderTwo" Orientation="Horizontal" EnableHandleAnimation="true"
                    EnableKeyboard="true" EnableMouseWheel="true" ShowHandleDragStyle="true" ShowHandleHoverStyle="true"
                    Minimum="0" Length="365" EnableInnerRangeDrag="true" ShowInnerRail="true" HandleAnimationDuration="0.0001"
                    RaiseChangeOnlyOnMouseUp="true" ><MultiHandleSliderTargets><cc1:MultiHandleSliderTarget ControlID="txtMultiHandle2_1_BoundControl" /><cc1:MultiHandleSliderTarget ControlID="txtMultiHandle2_2_BoundControl" /></MultiHandleSliderTargets></cc1:MultiHandleSliderExtender></td><td style="vertical-align: bottom; width: 100px;"><asp:TextBox ID="txtMultiHandle2_2_BoundControl" runat="server" Width="30" Text="40"
                    AutoPostBack="True" Style="display: none;" /></td></tr></table>
Private Sub WebForm1_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init
        multiHandleSliderExtenderOne.OnClientDrag = "ValueChangedHandler_" & multiHandleSliderExtenderOne.ClientID
        multiHandleSliderExtenderOne.OnClientDrag = "ValueChangedHandler_" & multiHandleSliderExtenderTwo.ClientID
        initScriptForMultiHandleSliderExtender(Me)
        SetDate(Me, multiHandleSliderExtenderOne, txtMultiHandle1_1_BoundControl.ClientID, txtMultiHandle1_2_BoundControl.ClientID, "01-Aug-2015", "31-Dec-2015", "hi")
        SetDate(Me, multiHandleSliderExtenderTwo, txtMultiHandle2_1_BoundControl.ClientID, txtMultiHandle2_2_BoundControl.ClientID, "01-Jan-2014", "31-Jan-2015", "hi")
    End Sub
    Sub SetDate(ByVal thisPage As Control, ByRef mhse As MultiHandleSliderExtender, ByVal LeftTextBox As String, ByVal RightTextBox As String, ByVal StartDate As String, ByVal EndDate As String, ByVal Lang As String)
        Dim _StartDate As Date = CDate(StartDate)
        Dim _EndDate As Date = CDate(EndDate)
        mhse.Length = DateDiff(DateInterval.Day, _StartDate, _EndDate)
        mhse.Maximum = DateDiff(DateInterval.Day, _StartDate, _EndDate)
        Dim strStartDate As String = MonthName(_StartDate.Month) & " " & _StartDate.Day & ", " & _StartDate.Year
        Dim strEndDate As String = MonthName(_EndDate.Month) & " " & _EndDate.Day & ", " & _EndDate.Year
        Dim sb As New StringBuilder()
        sb.Append("<script type='text/javascript'>")

        sb.Append("function ValueChangedHandler_" & mhse.ClientID & "(sender, args) {")
        sb.Append("setDateValues('" & LeftTextBox & "','" & RightTextBox & "','" & strStartDate & "','" & strEndDate & "','" & Lang & "');")
        sb.Append("}")

        sb.Append("          setDateValues('" & LeftTextBox & "','" & RightTextBox & "','" & strStartDate & "','" & strEndDate & "','" & Lang & "');")

        sb.Append("    </script>")
        ScriptManager.RegisterStartupScript(thisPage, thisPage.GetType(), "drsScript" & mhse.ClientID, sb.ToString(), False)

    End Sub
    Private Sub initScriptForMultiHandleSliderExtender(ByVal thisPage As Control)
        Dim sb As New StringBuilder()
        sb.Append("<script type='text/javascript'>")
        sb.Append("Date.prototype.getWeekdayName = function(lang) {   ")
        sb.Append("lang = lang && (lang in Date.localeWeekdayName) ? lang : 'en';    ")
        sb.Append("return Date.localeWeekdayName[lang].weekday_names[this.getDay()];")
        sb.Append("};")
        sb.Append("Date.prototype.getWeekdayNameShort = function(lang) {   ")
        sb.Append("lang = lang && (lang in Date.localeWeekdayName) ? lang : 'en';    ")
        sb.Append("return Date.localeWeekdayName[lang].weekday_names_short[this.getDay()];")
        sb.Append("};")
        sb.Append("Date.prototype.getMonthName = function(lang) {   ")
        sb.Append("lang = lang && (lang in Date.localeMonth) ? lang : 'en';    ")
        sb.Append("return Date.localeMonth[lang].month_names[this.getMonth()];")
        sb.Append("};")
        sb.Append("Date.prototype.getMonthNameShort = function(lang) {   ")
        sb.Append("lang = lang && (lang in Date.localeMonth) ? lang : 'en'; ")
        sb.Append("return Date.localeMonth[lang].month_names_short[this.getMonth()];")
        sb.Append("};")
        sb.Append("Date.localeWeekdayName={en:{  weekday_names: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thrusday', 'Friday', 'Saturday'], 	weekday_names_short: ['Sun', 'Mon', 'Tue', 'Wed', 'Thr', 'Fri', 'Sat']}};")
        sb.Append("Date.localeWeekdayName.hi= {  weekday_names: ['रविवार', 'सोमवार', 'मंगलवार', 'बुधवार', 'गुरूवार', 'शुक्रवार', 'शनिवार'],    weekday_names_short: ['रवि', 'सोम', 'मंगल', 'बुध', 'गुरू', 'शुक्र', 'शनि'] };")
        sb.Append("Date.localeMonth={en:{  month_names: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'], 	month_names_short: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']}};")
        sb.Append("Date.localeMonth.hi= {  month_names: ['जनवरी', 'फरवरी', 'मार्च', 'अप्रेल', 'मई', 'जून', 'जुलाई', 'अगस्त', 'सितम्बर', 'अक्तूबर', 'नवम्बर', 'दिसम्बर'],    month_names_short: ['जन', 'फर', 'मार्च', 'अप्रेल', 'मई', 'जून', 'जुलाई', 'अग', 'सित', 'अक्तू', 'नव', 'दिस'] };")

        sb.Append("            function setDateValues(leftbox,rightbox,_startDate,_endDate,_lang) {")
        sb.Append("var startDate = new Date((_startDate));")
        sb.Append("var endDate = new Date((_endDate));")
        sb.Append("var date = [];")
        sb.Append("while (startDate <= endDate) ")
        sb.Append("{           ")
        sb.Append(" var weekdayName = startDate.getWeekdayNameShort(_lang);  ")
        sb.Append(" var month = startDate.getMonthName(_lang);  ")
        sb.Append(" var day = startDate.getDate();           ")
        sb.Append(" var year = startDate.getFullYear();          ")
        sb.Append(" var dateString = weekdayName+', '+('0' +day).slice(-2) + '-' + month + '-' + year;           ")
        sb.Append(" date.push(dateString);           ")
        sb.Append(" startDate = new Date(startDate.setDate(startDate.getDate() + 1))    ")
        sb.Append("};")
        sb.Append("var iDivL = document.createElement('div');")
        sb.Append("iDivL.id = 'divmin_'+leftbox;")
        sb.Append("iDivL.style.position = 'relative';")
        sb.Append("document.getElementsByTagName('body')[0].appendChild(iDivL);")
        sb.Append("var iDivR = document.createElement('div');")
        sb.Append("iDivR.id = 'divmax_'+rightbox;")
        sb.Append("iDivR.style.position = 'relative';")
        sb.Append("document.getElementsByTagName('body')[0].appendChild(iDivR);")
        sb.Append("                var min = document.getElementById(leftbox).value;")
        sb.Append("                var max = document.getElementById(rightbox).value;")
        sb.Append("                document.getElementById('divmin_'+leftbox).innerHTML = date[min];")
        sb.Append("                document.getElementById('divmax_'+rightbox).innerHTML = date[max];")

        sb.Append("                document.getElementById('divmin_'+leftbox).style.left = (35 + parseInt(min)) + 'px';")
        sb.Append("                document.getElementById('divmin_'+leftbox).style.top = (-25) + 'px';")
        sb.Append("                document.getElementById('divmax_'+rightbox).style.left = (45 + parseInt(max)) + 'px';")
        sb.Append("                document.getElementById('divmax_'+rightbox).style.top = (5) + 'px';")
        sb.Append("            };")

        sb.Append("    </script>")
        ScriptManager.RegisterClientScriptBlock(thisPage, thisPage.GetType(), "drsScript", sb.ToString(), False)
    End Sub



Ajax Auto Extender

$
0
0

Hi All,

I have created Auto Complete Extender which is working fine in Text Box. But it should work in same text box if user is searching anything with Comma separator.

Test1,Test2

Please suggest

Viewing all 5678 articles
Browse latest View live




Latest Images