Quantcast
Channel: ASP.NET AJAX + Ajax Control Toolkit (ACT)

ajaxToolkit:MaskedEditValidator - One label place for multiple validation errors

0
0

Hello!

How can I set one place for all validation errors?
I have several MaskedEditValidators in one form and I would like the errors not to be displayed next to the textbox, just like in the picture.

Best regards,

B.


MaskedEditExtender with ValidationExpression - validation issue before submitting the form

0
0
<td width="200" align="left"><asp:TextBox ID="tbPlanedPickUpTime" CssClass="mtb tbxTime" Width="150px" runat="server" />&nbsp;<span class="asterisk">*</span><ajaxToolkit:MaskedEditExtender runat="server" ID="meePlannedPickUpTime"
MaskType="Number" Mask="99:99-99:99" TargetControlID="tbPlanedPickUpTime" MessageValidatorTip="True" ClearTextOnInvalid="True" OnInvalidCssClass="validationError" ClearMaskOnLostFocus="True"></ajaxToolkit:MaskedEditExtender><ajaxToolkit:MaskedEditValidator runat="server" ID="mevPlannedPickUpTime" ControlToValidate="tbPlanedPickUpTime"
ControlExtender="meePlannedPickUpTime" Display="dynamic" IsValidEmpty="False"  ValidationExpression="^([0-1][0-9]|[2][0-3])([0-5][0-9])([0-1][0-9]|[2][0-3])([0-5][0-9])$" EmptyValueMessage="EmptyValueMessage" ErrorMessage="ErrorMessage" InvalidValueMessage="InvalidValueMessage" ValidateRequestMode="Inherit" /></td>


Hello. I have a problem using MaskedEditExtender to ValidationExpression.

When I enter the numbers and lost focus everything is fine - the mask works, validation works. For example - 12:12-12:12 is valid but 12:99-12:99 is invalid.

Whenever I try to submit the form, the validation always changes to Invalid.

Why can't I send the form? It looks like the regular expression was correct when typing text, but not when submitting the form.

Could someone please help me?

Best wishes,

B.

how make 2 Textbox Autocomplete on the same page

0
0

hi all

I want to make 2 autocomplete textbox In the same page

do I type this code twice?

Like this

///////////////////////////////// 1111111111111111111111111111111111
    [System.Web.Script.Services.ScriptMethod()]
    [System.Web.Services.WebMethod]

    public static List<string> GetCompletionList(string prefixText)
    {
        using (OracleConnection con = new OracleConnection("data source=localhost:1521/orcl; user id=alhakimy; password=alhakimyyes;"))
        {
            using (OracleCommand com = new OracleCommand())
            {
                com.CommandText = "select doc_no, doc_name from doctors where city_no= " + HttpContext.Current.Session["city_no"].ToString() + " and doc_name like '%" + prefixText + "%' ";
                com.Parameters.Add("TextBox1", prefixText);
                com.Connection = con;
                con.Open();
                List<string> summ = new List<string>();
                using (OracleDataReader sdr = com.ExecuteReader())
                {
                    while (sdr.Read())
                    {
                        summ.Add(string.Format("{0}-{1}", sdr["DOC_NAME"], sdr["Doc_NO"]));//اذا اضفنا عمود جملة السكلته سنضيفه هنا كالبقية
                    }
                }
                con.Close();
                return summ;
            }
        }
    }

    ////22222222222222222222222222222222222222222222222222222222222222222222222
    
    [System.Web.Script.Services.ScriptMethod()]
    [System.Web.Services.WebMethod]

    public static List<string> GetCompletionList2(string prefixText2)
    {
        using (OracleConnection con2 = new OracleConnection("data source=localhost:1521/orcl; user id=alhakimy; password=alhakimyyes;"))
        {
            using (OracleCommand com = new OracleCommand())
            {
                com.CommandText = "select pharms_no, pharms_name from pharms where city_no= " + HttpContext.Current.Session["city_no"].ToString() + " and pharms_name like '%" + prefixText2 + "%' ";
                com.Parameters.Add("TextBox3", prefixText2);
                com.Connection = con2;
                con2.Open();
                List<string> summ2 = new List<string>();
                using (OracleDataReader sdr2 = com.ExecuteReader())
                {
                    while (sdr2.Read())
                    {
                        summ2.Add(string.Format("{0}-{1}", sdr2["pharms_NAME"], sdr2["pharms_NO"]));//اذا اضفنا عمود جملة السكلته سنضيفه هنا كالبقية
                    }
                }
                con2.Close();
                return summ2;
            }
        }
    }
    //////////////////////////////////////////////

Because the second coke did not work

modalpopupextender vanishes instantly after clicking

0
0

As soon as you click the button, the 4 textboxes popup for a brief moment and then immediately vanish. What is causing this to happen? It is supposed to stay there until the close button is clicked;

<%@ Page Title="" Language="VB" MasterPageFile="~/templates/default.master" AutoEventWireup="false" CodeFile="Default2.aspx.vb" Inherits="Default2" %><%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %><asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server"><title>Create Login ID | MortgageLoanApply.com</title><meta name="description" content="Pacific West Capital" /><meta name="keywords" content="Registration, Create login" /><style type="text/css">
        .modalBackground {
            background-color: transparent;
            filter: alpha(opacity=90);
            opacity: 0.8;
        }

        .modalPopup {
            background-color: white;
            border-width: 3px;
            border-style: solid;
            border-color: black;
            padding-top: 1px;
            padding-left: 10px;
            padding-right: 10px;
            width: 185px;
            height: 160px;
            position: absolute;
            top: 180px;
            left: 350px;
        }
    </style><script type="text/javascript">$(document).ready(function () {$("btnSubmit").click(function () {
                //var x = document.getElementById("alerttype");
                //var y = document.getElementById("alertreason");
                alert("Value: " + $("#alerttype").val());
            });
        });</script></asp:Content><asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceholder1" runat="Server"><div id="menu" class="container"><ul><li><a href="default.aspx">Home</a></li><li><a href="features.aspx">Features</a></li><li><a href="pricing.aspx">Pricing</a></li><li><a href="login.aspx">Login</a></li><li class="current_page_item"><a href="register.aspx">Register</a></li><li><a href="contact.aspx">Contact</a></li></ul></div></asp:Content><asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceholder2" runat="Server"><asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager><!-- ModalPopupExtender --><cc1:ModalPopupExtender ID="mp1" runat="server" PopupControlID="Panel1" TargetControlID="BtnShow"
        CancelControlID="btnClose" BackgroundCssClass="modalBackground"></cc1:ModalPopupExtender><asp:Panel ID="Panel1" runat="server" CssClass="modalPopup" align="center" Style="display: none"><asp:Label ID="Label7" runat="server" Text="MortgageLoanApply.com - Terms of Service"
            ForeColor="#FFB30F" Font-Size="Large" Font-Bold="True"></asp:Label><div style="height: 60px"><asp:UpdatePanel ID="UpdatePanel1" runat="server"><ContentTemplate><asp:TextBox ID="TextBox1" runat="server"></asp:TextBox><asp:TextBox ID="TextBox2" runat="server"></asp:TextBox><asp:TextBox ID="TextBox3" runat="server"></asp:TextBox><asp:TextBox ID="TextBox4" runat="server"></asp:TextBox></ContentTemplate></asp:UpdatePanel></div><asp:Button ID="btnClose" runat="server" Text="Close" /></asp:Panel><!-- ModalPopupExtender --><asp:Button ID="BtnShow" runat="server" Text="Fee Split" /></asp:Content>

Ajax POST with ASP.NET Razor

0
0

Hi everyone, how do I stop a page from reloading when a submit button in a form has been pressed. I have been unable to implement ajax successfully. In my OnPostList method, I use model binding to get the values of the user input.

This is my form:

<form id="bankDropdown" method="post"><div><labelclass="ratings-text"for="bank">Select Bank:</label><selectname="BankOptions"class="form-control ratings-text"style="width:21%"id="bank">
            @foreach (var bank in Model.BankLists)
            {<optionname="BankOptions"value="@bank.ShortName"id="selection">@bank.ShortName</option>
            }</select></div><br /><div><label>Enter Start Date:</label><inputtype="date"asp-for="DateSelect.DateMonthYear1"class="DateMonthYear"name="DateMonthYear1"><idata-toggle="tooltip"title="Set to first day of the month for optimal results"class="far fa-question-circle"></i></div><br /><div><label>Enter End Date:</label><inputtype="date"asp-for="DateSelect.DateMonthYear"class="DateMonthYear"name="DateMonthYear"required><idata-toggle="tooltip"title="Set to last or current day of the month for optimal results"class="far fa-question-circle"></i></div><br /><div><inputclass="ratings-button"type="submit"  asp-page-handler="List" value="Submit"/></div></form>

This is the page model and it's OnPost method.

public IActionResult OnPostList(string DateMonthYear, string DateMonthYear1, string BankOptions)
        {
            CurrentDate = string.Format(DateMonthYear);
            SelectBank = BankOptions;

            BankLists = ModelService.RunBankList();
            TotalBankCollections = ModelService.RunTotalBankCollection1(DateMonthYear);
            TotalTransactionCounts = ModelService.RunTotalTransactionCount1(DateMonthYear1, DateMonthYear);

            long floatTotalCount = 0;
            int intVolumeCount = 0;
            string stringTotalVolume = "";//get individual bank monthly collections
            foreach (var collection in TotalBankCollections)
            {if (BankOptions == collection.ShortName)
                {
                    string myBank = collection.TotalCollection;
                    BankCollection = Convert.ToDecimal(myBank).ToString("#,###,###.##");
                }
            }//get total collections from all the banks
            foreach (var collection in TotalBankCollections)
            {
                floatTotalCount += (long)Convert.ToDouble(collection.TotalCollection);
                string stringTotalCount = Convert.ToDecimal(floatTotalCount).ToString("#,###,###.##");
                TotalCollectionCount = stringTotalCount;
            }//get individual monthly volume collections
            foreach (var collection in TotalTransactionCounts)
            {if (BankOptions == collection.ShortName)
                {
                    string myBank = collection.TotalCount;
                    MonthlyVolumeCount = Convert.ToDecimal(myBank).ToString("#,##0");
                }
            }//get total transactions of all banks
            foreach (var collection in TotalTransactionCounts)
            {
                intVolumeCount += int.Parse(collection.TotalCount);
                stringTotalVolume = intVolumeCount.ToString("#,##0");
                TotalVolumeCount = stringTotalVolume;
            }return Page();
        }

So far this is the ajax function I have been able to come up with. 

$.ajax({type: "POST",
        url: "/Identity/Account/Ratings?handler=List",contentType: 'application/json; charset=utf-8',dataType: "json",success: function (response) {
            alert(response);
        },failure: function (response) {
            alert(response);
        }
    });

modal popup extender

0
0

I don't understand why my popup is not staying open. The instant I click the button, the popup appears for a split second and closes immediately. I have enabled popup blockers in my browser. I have tried this with both firefox and the edge browser. Both of the shut the popup immediately. What is the reason?

<%@ Page Title="" Language="VB" MasterPageFile="~/templates/default.master" AutoEventWireup="false" CodeFile="Default3.aspx.vb" Inherits="Default3" %><%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %><asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server"><style type="text/css">
        .Background {
            background-color: Black;
            filter: alpha(opacity=90);
            opacity: 0.8;
        }

        .Popup {
            background-color: #FFFFFF;
            border-width: 3px;
            border-style: solid;
            border-color: black;
            padding-top: 10px;
            padding-left: 10px;
            width: 400px;
            height: 350px;
        }

        .lbl {
            font-size: 16px;
            font-style: italic;
            font-weight: bold;
        }
    </style></asp:Content><asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server"></asp:Content><asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder2" runat="Server"><asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager><asp:Button ID="Button1" runat="server" Text="Fill Form in Popup" /><!-- ModalPopupExtender --><cc1:ModalPopupExtender ID="mp1" runat="server" PopupControlID="Panl1" TargetControlID="Button1"
        CancelControlID="Button2" BackgroundCssClass="Background"></cc1:ModalPopupExtender><asp:Panel ID="Panl1" runat="server" CssClass="Popup" align="center" Style="display: none"><table><tr><td><asp:Label runat="server" CssClass="lbl" Text="First Name"></asp:Label></td><td><asp:TextBox runat="server" Font-Size="14px"></asp:TextBox></td></tr><tr><td><asp:Label ID="Label1" runat="server" CssClass="lbl" Text="Middle Name"></asp:Label></td><td><asp:TextBox ID="TextBox1" runat="server" Font-Size="14px"></asp:TextBox></td></tr><tr><td><asp:Label ID="Label2" runat="server" CssClass="lbl" Text="Last Name"></asp:Label></td><td><asp:TextBox ID="TextBox2" runat="server" Font-Size="14px"></asp:TextBox></td></tr><tr><td><asp:Label ID="Label3" runat="server" CssClass="lbl" Text="Gender"></asp:Label></td><td><asp:TextBox ID="TextBox3" runat="server" Font-Size="14px"></asp:TextBox></td></tr></table><asp:Button ID="Button2" runat="server" Text="Cancel" /><br /></asp:Panel></asp:Content>

Script Manager Not Using CDN on Remote Host for MS AJAX

0
0

I have a ScriptManager configured to use the CDN. It works great for everything except AJAX remotely. If I load the site on my local machine via all the AJAX scripts run off the CDN like they should, but when I upload it to my remote server I see no references to the CDN for AJAX and a bunch of references to ScriptResource.axd. What could cause the site not to use the CDN only on the remote host?

Here is the Script Manager

<asp:ScriptManager runat="server" EnableHistory="true" EnableSecureHistoryState="false" EnableCdn="True" EnableCdnFallback="True"><Scripts><%--To learn more about bundling scripts in ScriptManager see http://go.microsoft.com/fwlink/?LinkID=301884 --%><%--Framework Scripts--%><asp:ScriptReference Name="MsAjaxBundle" /><asp:ScriptReference Name="jquery" /><asp:ScriptReference Name="popper" /><asp:ScriptReference Name="bootstrap" /><asp:ScriptReference Name="respond" /><asp:ScriptReference Name="lazysizes" /><asp:ScriptReference Name="WebForms.js" Assembly="System.Web" Path="~/Scripts/WebForms/WebForms.js" /><asp:ScriptReference Name="WebUIValidation.js" Assembly="System.Web" Path="~/Scripts/WebForms/WebUIValidation.js" /><asp:ScriptReference Name="MenuStandards.js" Assembly="System.Web" Path="~/Scripts/WebForms/MenuStandards.js" /><asp:ScriptReference Name="GridView.js" Assembly="System.Web" Path="~/Scripts/WebForms/GridView.js" /><asp:ScriptReference Name="DetailsView.js" Assembly="System.Web" Path="~/Scripts/WebForms/DetailsView.js" /><asp:ScriptReference Name="WebParts.js" Assembly="System.Web" Path="~/Scripts/WebForms/WebParts.js" /><asp:ScriptReference Name="Focus.js" Assembly="System.Web" Path="~/Scripts/WebForms/Focus.js" /><asp:ScriptReference Name="WebFormsBundle" /><%--Site Scripts--%></Scripts><Services><asp:ServiceReference Path="/webservices/TagSearch.asmx" /><asp:ServiceReference Path="/webservices/CitySearch.asmx" /><asp:ServiceReference Path="/webservices/DCNames.asmx" /><asp:ServiceReference Path="/webservices/DCAgencies.asmx" /><asp:ServiceReference Path="/webservices/ExternalLink.asmx" /><asp:ServiceReference Path="/webservices/insertdsc.asmx" /></Services></asp:ScriptManager>

Here is the BundleConfig.cs file

public class BundleConfig
    {
        // For more information on Bundling, visit http://go.microsoft.com/fwlink/?LinkID=303951
        public static void RegisterBundles(BundleCollection bundles)
        {
            bundles.Add(new ScriptBundle("~/bundles/WebFormsJs").Include("~/Scripts/WebForms/WebForms.js","~/Scripts/WebForms/WebUIValidation.js","~/Scripts/WebForms/MenuStandards.js","~/Scripts/WebForms/Focus.js","~/Scripts/WebForms/GridView.js","~/Scripts/WebForms/DetailsView.js","~/Scripts/WebForms/TreeView.js","~/Scripts/WebForms/WebParts.js"));

            // Order is very important for these files to work, they have explicit dependencies
            bundles.Add(new ScriptBundle("~/bundles/MsAjaxJs").Include("~/Scripts/WebForms/MsAjax/MicrosoftAjax.js","~/Scripts/WebForms/MsAjax/MicrosoftAjaxApplicationServices.js","~/Scripts/WebForms/MsAjax/MicrosoftAjaxTimer.js","~/Scripts/WebForms/MsAjax/MicrosoftAjaxWebForms.js"));


            // Use the Development version of Modernizr to develop with and learn from. Then, when you’re
            // ready for production, use the build tool at http://modernizr.com to pick only the tests you need
            bundles.Add(new ScriptBundle("~/bundles/modernizr").Include("~/Scripts/modernizr-*"));
            ScriptManager.ScriptResourceMapping.AddDefinition("respond",
                new ScriptResourceDefinition
                {
                    Path = "~/Scripts/respond.min.js",
                    DebugPath = "~/Scripts/respond.js",
                    CdnPath = "https://cdnjs.cloudflare.com/ajax/libs/respond.js/1.4.0/respond.min.js",
                    CdnDebugPath = "https://cdnjs.cloudflare.com/ajax/libs/respond.js/1.4.0/respond.js",
                    CdnSupportsSecureConnection = true

                });
            ScriptManager.ScriptResourceMapping.AddDefinition(
                "popper",
                new ScriptResourceDefinition
                {
                    Path = "~/Scripts/umd/popper.min.js",
                    DebugPath = "~/Scripts/umd.popper.js",
                    CdnPath = "https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.1/umd/popper.min.js",
                    CdnDebugPath = "https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.1/umd/popper.js",
                    CdnSupportsSecureConnection = true,
                });
            ScriptManager.ScriptResourceMapping.AddDefinition("lazysizes",
                new ScriptResourceDefinition
                {
                    Path = "~/lib/lazysizes/lazysizes.min.js",
                    DebugPath = "~/lib/lazysizes/lazysizes.js",
                    CdnPath = "https://cdnjs.cloudflare.com/ajax/libs/lazysizes/5.2.2/lazysizes.min.js",
                    CdnDebugPath = "https://cdnjs.cloudflare.com/ajax/libs/lazysizes/5.2.2/lazysizes.js",
                    CdnSupportsSecureConnection = true,
                });
        }
    }

Here is the source code from a page running on my local machine WITHOUT SSL

<script src="http://ajax.aspnetcdn.com/ajax/4.5.1/1/MsAjaxBundle.js" type="text/javascript"></script><script type="text/javascript">
//<![CDATA[
(window.Sys)||document.write('<script type="text/javascript" src="/bundles/MsAjaxJs?v=D6VN0fHlwFSIWjbVzi6mZyE9Ls-4LNrSSYVGRU46XF81"><\/script>');//]]></script><script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-3.5.1.min.js" type="text/javascript"></script><script type="text/javascript">
//<![CDATA[
(window.jQuery)||document.write('<script type="text/javascript" src="Scripts/jquery-3.5.1.min.js"><\/script>');//]]></script><script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.1/umd/popper.min.js" type="text/javascript"></script><script src="http://ajax.aspnetcdn.com/ajax/bootstrap/4.5.3/bootstrap.min.js" type="text/javascript"></script><script type="text/javascript">
//<![CDATA[
(window.jQuery.fn.carousel)||document.write('<script type="text/javascript" src="Scripts/bootstrap.min.js"><\/script>');//]]></script><script src="https://cdnjs.cloudflare.com/ajax/libs/respond.js/1.4.0/respond.min.js" type="text/javascript"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/lazysizes/5.2.2/lazysizes.min.js" type="text/javascript"></script><script src="http://ajax.aspnetcdn.com/ajax/4.5.1/1/WebFormsBundle.js" type="text/javascript"></script><script type="text/javascript">
//<![CDATA[
(window.WebForm_PostBackOptions)||document.write('<script type="text/javascript" src="/bundles/WebFormsJs?v=N8tymL9KraMLGAMFuPycfH3pXe6uUlRXdhtYv8A_jUU1"><\/script>');//]]></script><script src="//ajax.aspnetcdn.com/ajax/act/16_1_1/Scripts/AjaxControlToolkit/Release/Localization.Resources.js" type="text/javascript"></script><script src="//ajax.aspnetcdn.com/ajax/act/16_1_1/Scripts/AjaxControlToolkit/Release/ComponentSet.js" type="text/javascript"></script><script src="//ajax.aspnetcdn.com/ajax/act/16_1_1/Scripts/AjaxControlToolkit/Release/Common.js" type="text/javascript"></script><script src="//ajax.aspnetcdn.com/ajax/act/16_1_1/Scripts/AjaxControlToolkit/Release/BaseScripts.js" type="text/javascript"></script><script src="//ajax.aspnetcdn.com/ajax/act/16_1_1/Scripts/AjaxControlToolkit/Release/CascadingDropDown.js" type="text/javascript"></script><script src="//ajax.aspnetcdn.com/ajax/act/16_1_1/Scripts/AjaxControlToolkit/Release/Compat.Timer.js" type="text/javascript"></script><script src="//ajax.aspnetcdn.com/ajax/act/16_1_1/Scripts/AjaxControlToolkit/Release/AnimationScripts.js" type="text/javascript"></script><script src="//ajax.aspnetcdn.com/ajax/act/16_1_1/Scripts/AjaxControlToolkit/Release/Animation.js" type="text/javascript"></script><script src="//ajax.aspnetcdn.com/ajax/act/16_1_1/Scripts/AjaxControlToolkit/Release/Popup.js" type="text/javascript"></script><script src="//ajax.aspnetcdn.com/ajax/act/16_1_1/Scripts/AjaxControlToolkit/Release/AutoComplete.js" type="text/javascript"></script><script src="//ajax.aspnetcdn.com/ajax/act/16_1_1/Scripts/AjaxControlToolkit/Release/TextBoxWatermark.js" type="text/javascript"></script><script src="//ajax.aspnetcdn.com/ajax/act/16_1_1/Scripts/AjaxControlToolkit/Release/UpdatePanelAnimation.js" type="text/javascript"></script><script src="/webservices/TagSearch.asmx/js" type="text/javascript"></script><script src="/webservices/CitySearch.asmx/js" type="text/javascript"></script><script src="/webservices/DCNames.asmx/js" type="text/javascript"></script><script src="/webservices/DCAgencies.asmx/js" type="text/javascript"></script><script src="/webservices/ExternalLink.asmx/js" type="text/javascript"></script><script src="/webservices/insertdsc.asmx/js" type="text/javascript"></script><script type="text/javascript">

Here is the source code from the website running live on a remote IIS server:

<script src="https://ajax.aspnetcdn.com/ajax/4.5.1/1/MsAjaxBundle.js" type="text/javascript"></script><script type="text/javascript">
//<![CDATA[
(window.Sys)||document.write('<script type="text/javascript" src="/bundles/MsAjaxJs?v=D6VN0fHlwFSIWjbVzi6mZyE9Ls-4LNrSSYVGRU46XF81"><\/script>');//]]></script><script src="https://ajax.aspnetcdn.com/ajax/jQuery/jquery-3.5.1.min.js" type="text/javascript"></script><script type="text/javascript">
//<![CDATA[
(window.jQuery)||document.write('<script type="text/javascript" src="Scripts/jquery-3.5.1.min.js"><\/script>');//]]></script><script src="Scripts/umd/popper.min.js" type="text/javascript"></script><script src="https://ajax.aspnetcdn.com/ajax/bootstrap/4.5.3/bootstrap.min.js" type="text/javascript"></script><script type="text/javascript">
//<![CDATA[
(window.jQuery.fn.carousel)||document.write('<script type="text/javascript" src="Scripts/bootstrap.min.js"><\/script>');//]]></script><script src="Scripts/respond.min.js" type="text/javascript"></script><script src="https://ajax.aspnetcdn.com/ajax/4.5.1/1/WebFormsBundle.js" type="text/javascript"></script><script type="text/javascript">
//<![CDATA[
(window.WebForm_PostBackOptions)||document.write('<script type="text/javascript" src="/bundles/WebFormsJs?v=N8tymL9KraMLGAMFuPycfH3pXe6uUlRXdhtYv8A_jUU1"><\/script>');//]]></script><script src="/ScriptResource.axd?d=eE6V8nDbUVn0gtG6hKNX_H5ly8e9cwxzW3q3vRJPfy5skbgRrovnomPG4i-h8-d3URvm-BPODK02iP8oaS4AZfYR4BiyYXFsaVSYY9QcjqyqnilXJjhUWqOcqVTI5DPC0&amp;t=ffffffffcfeeeb28" type="text/javascript"></script><script src="/ScriptResource.axd?d=jwf4VSQi7LeShc44FJ-gAe5nni8SKiHof9ZpQXs-RIqwUNUqLFFgjipEpwtQR-HdpV3nHtMrhPO0onBjDVm73D4snDHSSC7pE-FO4MramILqRP7aD5eMGMYTp4VujgV-0&amp;t=ffffffffcfeeeb28" type="text/javascript"></script><script src="/ScriptResource.axd?d=mcAASOSteirJeuV-3by3UbEn3p-mpdEcd1sRA5zInOh5TNPuPOJnQC8ASiooha3dRVIASfQpjfCo3G8nxlSoPoF4irYbgDnV1u_fy27DOYw1&amp;t=ffffffffcfeeeb28" type="text/javascript"></script><script src="/ScriptResource.axd?d=HEFpVKbnoeQjkjHkFKu3MMEOEafgbVZ21KhB8D80Ha46LrKCIclUprKqt-chXd8DvgfQLHtzMALj7PxoL2LhO2-AJpoqJE5qoAfQD4BQMBmAmLUIWArdvlLTBFLVIE7-0&amp;t=ffffffffcfeeeb28" type="text/javascript"></script><script src="/ScriptResource.axd?d=sw781r6OAlXlgwOkqK1g8vRL1gCOI082752n9cj6l_PwUzfIN331R-tMsK98gWqplWSx2_ykkxvFj9S4te_rsL3mBmj9x_AsP-yNWx-2-OSJvL-s3KFo3ia_KJK9S_S40&amp;t=ffffffffcfeeeb28" type="text/javascript"></script><script src="/ScriptResource.axd?d=nai7mGcYyE2dix_TwveLDU9hmnp2XRKb_GClCOjfmCRDTLnd4hDl_EOgL6WCiUoZvwMXDNgizxeX5PM-aeDhKJMteSrc-bZne7Lpr26_bb_Lga5MMY3WSjGinUMAKpRD0&amp;t=ffffffffcfeeeb28" type="text/javascript"></script><script src="/ScriptResource.axd?d=LQ1q2RBSthBAZhliMjtG_1T0ECJHFAyC5NiFu2Wj5NEqL4QpERixjF7MtUOW1G62iCbvY6qDJrM_oXE_ySI21o6_twYXyZ45epRK_QMEf4Kcms7I-3Z3VloXhwZaXUWb0&amp;t=ffffffffcfeeeb28" type="text/javascript"></script><script src="/ScriptResource.axd?d=VOYD8Xe7kQA0lniBYXVpAiYSLexe236H8TylBEHjjLQrEUCj3CRrI2mntk_zsqaRzybrbJ5JOVo5JnP4Ezh1Fh7x6UPieAoTp6Nhxorg3llDUh2FDoajMe5GtgDGPtoJ0&amp;t=ffffffffcfeeeb28" type="text/javascript"></script><script src="/ScriptResource.axd?d=24039AtbfhsNBYQDFUMYHMdbUXMO2ih8tRvYOZ9cyxyGun2Q123pf-U1c1ngne7bMi1-sqi39mqodYMe8DAHixb23kJSs787mYEBnHdNbRs1&amp;t=ffffffffcfeeeb28" type="text/javascript"></script><script src="/ScriptResource.axd?d=iDJsJb59XB5efowLsFnqUBzvj-eE812QeUALGtnyR1TQB8oRxJFt4Znw9KYsG76Wpml5vLzQ32wZD6u7RS4Tvz2R5mOPcHatHsUONHdz4r2-Hc7mXmrA7V6iKnYEc_z00&amp;t=ffffffffcfeeeb28" type="text/javascript"></script><script src="/ScriptResource.axd?d=X6kQKInQS5YQqruiTh57iCbkLgl8IAfvnxKXjXy_ZB1jh5R4j5t9CdT5_OYNkCMQe8PuGgkWLVLh_BnnaWCecpOfcqBGBvTqFVbpJVKZz-SP-hMplkN-SUxIcWsDVd710&amp;t=ffffffffcfeeeb28" type="text/javascript"></script><script src="/ScriptResource.axd?d=GhMTAxdxy2a-Wl-WY5EfmYGG8LhUPcKJ65XafKrF36RFcXRIIrawXrLK-7RA9FGLZA4gvHHf3EMbIQhVdsOr5i4iQC2KRicTVjh_fBALGfJG0vSPPXcl4bEWkvvLSlD40&amp;t=ffffffffcfeeeb28" type="text/javascript"></script><script src="webservices/CitySearch.asmx/js" type="text/javascript"></script><script src="webservices/TagSearch.asmx/js" type="text/javascript"></script><script src="webservices/DCNames.asmx/js" type="text/javascript"></script><script src="webservices/DCAgencies.asmx/js" type="text/javascript"></script><script src="webservices/ExternalLink.asmx/js" type="text/javascript"></script><script src="webservices/insertdsc.asmx/js" type="text/javascript"></script><script src="webservices/Category.asmx/js" type="text/javascript"></script>

UPDATE: Seems the problem is solely with the AJAX Control Toolkit and Nothing else. I am guessing since my remote server supports SSL only and upgrades insecure request that has something to do with it..

CollapsiblePanelExtender height

0
0

Hello,

I have the following CollapsiblePanelExtender on my web form. Is it possible to extend the height of the CollapsiblePanelExtender all the way to the bottom of the page. below is my code:

<title></title><style type="text/css">
        .cpHeader
        {
            color: white;
            background-color: #719DDB;
            font: bold 11px auto "Trebuchet MS", Verdana;
            font-size: 12px;
            cursor: pointer;
            width:450px;
            height:18px;
            padding: 4px;           
        }
        .cpBody
        {
            background-color: #DCE4F9;
            font: normal 11px auto Verdana, Arial;
            border: 1px gray;               
            width:450px;
            padding: 4px;
            padding-top: 7px;
             height: 0;
            overflow: hidden;
            margin-bottom:300px;
        }    
        .collapsiblePanelContainer {
                    height: 0;
                    overflow: hidden;
}</style></head><body><form id="form1" runat="server"><div><asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager><asp:UpdatePanel ID="UpdatePanel1" runat="server"><ContentTemplate><asp:Panel ID="pHeader" runat="server" CssClass="cpHeader"><asp:Label ID="lblText" runat="server" /></asp:Panel><asp:Panel ID="pBody" runat="server" CssClass="cpBody">
            Lorem ipsum dolor sit amet, consectetur adipisicing elit,
            sed do eiusmod tempor incididunt ut labore et dolore magna
aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur</asp:Panel><cc1:CollapsiblePanelExtender ID="CollapsiblePanelExtender1" runat="server" TargetControlID="pBody" CollapseControlID="pHeader" ExpandControlID="pHeader"
Collapsed="true" TextLabelID="lblText" CollapsedText="Click to Show Content.."  ExpandedText="Click to Hide Content.."
CollapsedSize="0" ExpandDirection="vertical" ExpandedSize="5000"  ></cc1:CollapsiblePanelExtender></ContentTemplate></asp:UpdatePanel></div></form></body></html>

any help will be highly apprecaited


How to open Popup window from gridview edit button.

0
0

i am opening webform from button ,which is outside gridview,and Popup window is getting open,but i do not know that how to use same code in gridview on edit button ,and open window and pass pay_ID to that form which will open.

Below is code which i am using to open popup form 

<asp:Button ID="btn_New" runat="server"  Text="New" Width="74px" OnClick="btn_New_Click" />     <cc1:modalpopupextender ID="mp1" runat="server"  PopupControlID="Panl3" TargetControlID="btn_New" CancelControlID="btn_close" BackgroundCssClass="Background"> </cc1:modalpopupextender>                        <asp:Panel ID="Panl3" runat="server" CssClass="Popup" align="left" style = "display:none"><asp:Button ID="Button2" runat="server" Text="Close" /><iframe  style=" width: 980px; height: 750px;" id="irm1" src="partypy2.aspx" runat="server"></iframe><br/></asp:Panel>

Now i want to open same forms from gridview ,but with pass Pay_ID to webform,to retrieve data from database on webform,

<asp:GridView ID="gvpayment" runat="server"  BackColor="White" autogeneratecolumns="false"
                        BorderColor="#E7E7FF" BorderStyle="None" BorderWidth="1px" CellPadding="3" CssClass="myGridClass" 
                        Font-Names="Arial" GridLines="Horizontal" Height="198px"  style="margin-left: 3px" Width="807px" ShowFooter="True" OnRowDataBound="gvpayment_RowDataBound"
                        OnSelectedIndexChanged="gvpayment_SelectedIndexChanged" AutoGenerateSelectButton="True"><AlternatingRowStyle BackColor="#F7F7F7" /><Columns><%--      <asp:TemplateField HeaderText="Sr No" HeaderStyle-Width="5%" HeaderStyle-HorizontalAlign="Left"><ItemTemplate><%# Container.DataItemIndex + 1 %></ItemTemplate></asp:TemplateField>--%><asp:BoundField DataField="Pay_ID" ReadOnly="True" HeaderText="ID" /><%--          <asp:TemplateField HeaderText="ID"><ItemTemplate><asp:Label ID="Pay_ID" runat="server" Text='<%#Bind("Pay_ID")%>'></asp:Label></ItemTemplate></asp:TemplateField>--%><asp:TemplateField HeaderText="Party" Visible="true"><ItemTemplate><asp:Label ID="Level_Four_Name" runat="server" Text='<%#Bind("Level_Four_Name")%>'></asp:Label></ItemTemplate></asp:TemplateField><asp:TemplateField HeaderText="Remark" Visible="false"><ItemTemplate><asp:Label ID="Pay_Remarks" runat="server" Text='<%#Bind("Pay_Remarks")%>'></asp:Label></ItemTemplate></asp:TemplateField><asp:TemplateField HeaderText="Date"><ItemTemplate><asp:Label ID="Pay_Date" runat="server" Text='<%#Bind("Pay_Date")%>'></asp:Label></ItemTemplate></asp:TemplateField><asp:TemplateField HeaderText="Amount"><ItemTemplate><asp:Label ID="Pay_Amount" runat="server" Text='<%#Bind("Pay_Amount")%>'></asp:Label></ItemTemplate><FooterTemplate><asp:Label ID="lblTotalpay" runat="server"></asp:Label></FooterTemplate></asp:TemplateField><asp:TemplateField HeaderText="Edit"><ItemTemplate><asp:LinkButton ID="Pay_ID" Text='<%#Eval("Pay_ID") %>' runat="server" /></ItemTemplate></asp:TemplateField></Columns><FooterStyle BackColor="#B5C7DE" ForeColor="#4A3C8C" /><HeaderStyle BackColor="#4A3C8C" Font-Bold="True" ForeColor="#F7F7F7" /><PagerStyle BackColor="#E7E7FF" ForeColor="#4A3C8C" HorizontalAlign="Right" /><RowStyle BackColor="#E7E7FF" ForeColor="#4A3C8C" /><SelectedRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="#F7F7F7" /><SortedAscendingCellStyle BackColor="#F4F4FD" /><SortedAscendingHeaderStyle BackColor="#5A4C9D" /><SortedDescendingCellStyle BackColor="#D8D8F0" /><SortedDescendingHeaderStyle BackColor="#3E3277" /></asp:GridView>



UpdatePanel partial update broken by "span" element

0
0

I've tested this extensively and scoured the web for anything about it, without any luck.

I have a simple table enclosed within an UpdatePanel.  Some of the table cells issues postbacks when clicked.  Whenever I include any kind of "span" element within any of the cells, the partial page update breaks and I get a full update.

A few hopefully helpful bits:

1. I've used ASP.NET, UpdatePanel and AJAX extensively.  No other problems.

2. There are no HTML errors within the UpdatePanel (nor anywhere on the page).  All controls have unique IDs.

3. The only thing I've found resembling this error online are issues with the LinkButton causing this problem if the ClientIDMode is not set to "AutoID".  This is not the problem here.

Thanks for any help.  If you are interested in this, but need to see more, let me know and I'll grant you access to the resource.

How can I solve this complex problem of Dialogs/Modals and Scripts which includes communication with the BackEnd?

0
0

I have a code similar to this on the View from my Asp.Net Core 5.0.1 App, which at the end includes a Script code which open a Modal, which is called by the button which has the label Check, and in the JavaScript/Script/JQuery code is stored the values written in the view for the variables 'Ac1' and 'Ac2' of the model, on the variable 'AC' from the Script, which is sent to the Controller, to a method which this Modal calls:

@model Cm.ViewModels.Ac<div class="container"><div class="card level-3"><h3>Ac</h3><hr /><div class="row"><div class="col-md-12"><form asp-action="Create"><div class="form-group"><div>Ac1</div><input asp-for="Ac1" type="time" class="form-control" /><span asp-validation-for="Ac1" class="text-danger"></span></div><div class="form-group"><div>Ac2</div><input asp-for="Ac2" type="time" class="form-control" /><span asp-validation-for="Ac2" class="text-danger"></span></div><div class="form-group"><input type="submit" value="SAVE" class="btn btn-primary" /> |<!-- Button to Open the Modal --><button id="btnOpenModal" type="button" class="btn btn-primary" data-toggle="modal" data-target="#myModal">
                            CHECK</button></div></form></div></div></div></div><!-- The Modal --><div class="modal" id="myModal"><div class="modal-dialog"><div class="modal-content"><!-- Modal Header --><div class="modal-header"><h4 class="modal-title">CHECK AC:</h4><button type="button" class="close" data-dismiss="modal">&times;</button></div><!-- Modal body --><div class="modal-body" id="modalcontent"></div><!-- Modal footer --><div class="modal-footer"><button type="button" class="btn btn-danger" data-dismiss="modal">CANCEL</button><button type="button" class="btn btn-primary" data-dismiss="modal">OK</button></div></div></div></div><link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.min.css" /><link rel="stylesheet" href="~/css/site.css" /><script src="~/lib/jquery/dist/jquery.min.js"></script><script src="~/lib/bootstrap/dist/js/bootstrap.bundle.min.js"></script><script>$(function () {$("#btnOpenModal").click(function () {
            var AC = {};
            AC.Ac1 = $("#Ac1").val();
            AC.Ac2 = $("#Ac2").val();$.ajax({
                type: "POST",
                url: "/AC/GetViewContent",
                data: AC,
                beforeSend: function (request) {
                    request.setRequestHeader("RequestVerificationToken",$("[name='__RequestVerificationToken']").val());
                },
                success: function (data) {$('#modalcontent').html(data);
                },
                error: function (response) {$("#myModal").modal('toggle')

                }
            });
        });

        $("#myModal").on("click", ".btn-default", function () {
                alert("Cancel button click");
            });$("#myModal").on("click", ".btn-danger", function () {
            // code
            alert("Delete button click");$('#myModal').modal('hide') 
        });
    });</script>

Controller Code: 

        [HttpPost]
        [ValidateAntiForgeryToken]
        public IActionResult GetViewContent(Ac ACM)
        {
            if (ACM.Ac1 == null || ACM.Ac2 == null)
            {
            return Ok("10.");
            }

            if (ACM.Ac1 >= ACM.Ac2)
            {
                return Ok("11");
            }

            if (ACM.Ac1 <= ACM.Ac2)
            {
                return Ok("12.");
            }
            if (ACM.Ac1 == ACM.Ac2)
            {
             return Ok("44.");
            }
         }
	[HttpPost]
        [ValidateAntiForgeryToken]
        public async Task<IActionResult> Create(Ac ACP)
        {
return View("YES"); }

Right now, all that the code does is that it loads me a different message in  the Modal, depending on whether Ac1 or Ac2 are null, if Ac1 is greater than Ac2, if Ac2 is equal to Ac2, etc.

Now the really complex part of the problem:
The behavior of the code is far from what I would really like to do with it, and what I post now is just a test.

What I would really like the code to do is show me on the View a completely different Modal depending on the value returned by the Controller, instead of just changing the message which the Modal shows in just one Div depending on that answer, the way I wanted to do this originally, is to find how to copy the message that the controller returns, in some variable of the View, and make this change what is shown in the View, through Ifs in the Modal that depended on that local variable, but I had to learn that doing that is technically impossible, since Script variables and View variables exist in completely different environments and times, which don't communicate directly with each other, ok.

So, how about this?:

How about, if I have 4 different Modals in my view code, and depending on whether the controller response is "10." , "11", "12." or "44." the Script calls me to a different Modal, and opens the Modal corresponding to that answer? Is it possible to do that, and if so, how can it be done??

How in this part of the code:

success: function (data) {$('#modalcontent').html(data);
                },
                error: function (response) {$("#myModal").modal('toggle')
                }

how in that part of the code, Can I access the controller's response, as a 'Variable' and put Ifs here which do different things depending on what the response is?? Can I for example have access to the controller's response, as a String, and call a different Modal depending on which is the second Character of that String ?? ( '0', '1', '2', '4' being the conditioning actions ).

And these questions lead me to a possible second way to solve this (which I don't know how to implement either),and the explanation of why I want to do this:

1)If the Controller response is "10.", I would like the Modal to have an 'X' message, and that just the Cancel button appears below.

2)If the Controller response is "11", I would like the Modal to have an 'Y' message, and that just the Cancel button appears below.

3)If the Controller response is "12.", I would like the Modal to have an 'Z' message, and both the Cancel and OK button appears below, BUT the OK button calls me the Controller's Create method, like the form's Submit button.

4)If the Controller response is "44.", I would like the Modal to have an 'W' message, and both the Cancel and OK button appears below, BUT the OK button calls A DIFFERENT METHOD from the Controllers OR that I call the Create method the same as the Previous button, but sending a different Id-Path variable?, so that I can put an If inside the Create method of the Controller, which makes the code act different if I am calling this method from Modal3 or Modal4.

I will try to illustrate the situation in case it wasn't clear, with an picture:


That said, this leads me to another possible solution, that perhaps, instead of put code for 4 Modals in the View and try to call them individually (although the good thing about doing that is that I can control the Html code of each Modal individually, but well If that is complicated to implement and unnecessary, changing the message and buttons is enough), maybe what the Script could do is simply alter or modify the buttons in the modal, even hiding them?Is it possible to do that? Can the Script hide buttons from me, and change them, in addition to changing the message of the Div, depending on which is the response it receives from the Controller 'GetViewContent' method? How can I do it???

All this problem comes basically, because I want to learn how to completely change the content of a Modal, depending on the response which is received from the BackEnd, or how to use that response as a variable in the Script code part, my actual code is more complex than this of course, and I really need a code that works like this because I need to show a different Modal, for each possible case.

Can anybody help me?

By the way, as a separate question in the middle of all this, the Script works for me with a small bug now, since if I deactivate the Modal the screen stays stuck, and I can only avoid that using 'data-dismiss', It would also be good to know how to solve that.

Anyway, thank you very much for reading, in advance.

showing a hidden panel in OnTextChanged event

0
0

I want to show a hidden panel when a user tabs out of a text box. I want to do this asynchronously. I wrote the following code. In below code my <asp:Panel is on another part of the page. Its not right above the updatePanel. I just put the panel above my textbox code for simplicity.

<form id="form1" runat="server" method="post"><asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager><asp:Panel runat="server" ID="pnlTest" Visible="false">
            This is a test</asp:Panel><asp:UpdatePanel ID="up1" runat="server"><ContentTemplate ><asp:TextBox ID="txtTest" runat="server" OnTextChanged="txtestChanged" AutoPostBack="true"></asp:TextBox></ContentTemplate><Triggers><asp:AsyncPostBackTrigger ControlID ="txtTest" /></Triggers></asp:UpdatePanel></form>

any help will be greatly appreciated.

Update a value / item without updating a page

0
0

Hi,

Can someone help me with an example of updating an item or value without updating the full page? everything I find is related to pages.


My problem is as follows I have a project in asp.net mvc that performs a listing when someone edits the listing I keep the current time that the record was modified, so far everything was perfect, but for the value to be displayed I am loading the complete page.

 @foreach (var item4 in item2.status)
                                {@item4.Data_mod
                                }

I currently have the function below to update the value in the database

$("#ordertable").on("click", ".Editbtn", function () {
                var status = new Object();
                //more code
                status.Data_mod = $(this).closest('tr').find(".Data_mod").val();
                if (status != null) {$.ajax({
                        type: "POST",
                        url: "/Home/EditPost",
                        data: JSON.stringify(status),
                        contentType: "application/json; charset=utf-8",
                        dataType: "json", 
                    });
                }location.reload();

as you see in the end i'm using a location.reload();

my question is how can i only update @item4.Data_mod by pressing the button "Editar".

Thanks for any help!

ajax $.get runs late after the loop !!

0
0

Hello

I have a a loop processing $.get statement inside it. The $.get returns value from controller function. as follows:

res = null;
for (key in data.Results) {
   var url = "/Search/Get_ManID?MakeName=Test";$.get(url, function (data) {
   res = data; // it will get some value , data = 148
}
alert(res);

It will alert null instead of the value that it will hold.

The issue is that the alert statement will run before the $.get function.

How can I control the order of code running.

Border barchart overflow

0
0

Hello, I'm using AjaxKitTools for BarChart and c# to fill the data. But the border of the BarChart it's overflow, I don't know how to control the Width of this.

https://prntscr.com/11t2iau

ASPX:

<div class="center2" style="overflow:auto"><ajaxToolkit:BarChart ID="BarChart1" runat="server" 
    chartheight="350" BaseLineColor="#A156AB"
    ChartType="Column" ChartTitleColor="#0E426C" Visible = "false" 
    BackColor="Transparent"
    CategoryAxisLineColor="#D08AD9" ValueAxisLineColor="#D08AD9" ></ajaxToolkit:BarChart></div>

C#

DataTable dt = GetData(query);

            string[] x = new string[dt.Rows.Count];
            decimal[] y = new decimal[dt.Rows.Count];
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                x[i] = dt.Rows[i][0].ToString();
                y[i] = Convert.ToInt32(dt.Rows[i][1]);
            }
            BarChart1.Series.Add(new AjaxControlToolkit.BarChartSeries { Data = y, BarColor = "#088da5" });
            BarChart1.CategoriesAxis = string.Join(",", x);
            BarChart1.ChartTitle = string.Format("{0} Order Distribution", ddlCountries.SelectedItem.Value);
            if (x.Length > 3)
            {
                BarChart1.ChartWidth = (x.Length * 100).ToString();
            }
            BarChart1.Visible = ddlCountries.SelectedItem.Value != "";


Databound strange behaviour with large amount of data

0
0

I'm experiencing a strange behaviour of a <AjaxToolkit:Combobox> widget used on Asp.net form.

I got it declared this way:

<ajaxToolkit:ComboBox
    ID="cbConvenzionato"
    runat="server"
    AutoCompleteMode="SuggestAppend"
    DropDownStyle="DropDownList"
    DataSourceID="sdsConvenzionati"
    DataTextField="nome"
    DataValueField="id"
    AutoPostBack="true" 
    Width="200px" 
    OnSelectedIndexChanged="cbConvenzionato_SelectedIndexChanged" 
    AppendDataBoundItems="true"><asp:ListItem Text="Tutti" Value="" Selected="True" /></ajaxToolkit:ComboBox>

And its related data-source in this way:

<asp:SqlDataSource
    ID="sdsConvenzionati"
    runat="server"
    ConnectionString="<%$ ConnectionStrings:db %>"
    ProviderName="<%$ ConnectionStrings:db.ProviderName %>"
    SelectCommand="
        SELECT
            id,
            nome
        FROM
            anag_convenzionati
        WHERE
            ((data_cancellazione IS NULL) OR (data_cancellazione = ''))
        ORDER BY nome;" />

I think that the problem is given from the amount of data provided from the datasource since I used the same approach many times and I never had such kind of issues.

The amount of raw data transfered for such table should be around 100k (calculations made exporting data from database and encoding it the way JSON should).

The abnormal behaviour is not on the data visualization itself since combobox appears to be filled with all the data but from theinteractive selection/filtering mechanism that brokes and does not even allow to enter characters inside the widget. The only way toselect items is trough graphical interaction (that may takes time since there are lots of items).

Threre's a way to fix this?

P.S. As a side question I would like to know if there's a way to change the way the item selection mechanism works i.e. I need a control that allows to search for a substring instead left string matching.

Best regards,

 Mike

Display day name when date is selected

0
0

Hello

I use this in my page

when i select any date without postback i want to show day name 

for example i select 13 it has to show in Label1 as : TUE

For example i select 18 it has to show in Label1 as : SUN

The Day name should be like this SUN,MON,TUE,WED,THU,FRI,SAT...

How to do without postabck.. thanking you

AutoCompleteExtender in Gridview not working

0
0

Hello,

I have 3 AutoCompleteExtenders in a Webform. The first one for getting customers works as it should. I have 2 more in a gridview that are just not firing. I have used pretty much the same code as the first one. AutoCompleteExtender1 is the only one working. I have declared the scriptmanager in the master page also. How do I get the extenders in the footer & edit templates to work?

I put a break point in Items.asmx and I can see that the code run does not reach there.

Here is the code, a little long. Any help appreciated.

<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="PipemanWebPortal.Views.PurchaseOrders.Default" %><%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %><asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server"><h2>Add Purchase Order</h2><script type="text/javascript">$(document).ready(function () {
            window.setTimeout(function () {$(".alert").fadeTo(1500, 0).slideUp(500, function () {$(this).remove();
                });
            }, 3000);
        });

        // On Page Load
        $(function () {
            SetDatePicker();
        });
        // On UpdatePanel Refresh
        var prm = Sys.WebForms.PageRequestManager.getInstance();
        if (prm != null) {
            prm.add_endRequest(function (sender, e) {
                if (sender._postBackSettings.panelsToUpdate != null) {
                    SetDatePicker();$(".datepicker-orient-bottom").hide();
                }
            });
        };

        function SetDatePicker() {
            $('#datetimepicker').datepicker
                ({
                    format: 'dd.MM.yyyy',
                    inline: true,
                    todayHighlight: true,
                    autoclose: true
                });
        }</script><div runat="server" visible="false" id="AlertDanger" class="alert alert-danger"><a href="#" class="close" data-dismiss="alert">&times;</a><strong>You must choose a date</strong></div><div runat="server" visible="false" id="AlertSuccess" class="alert alert-success"><a href="#" class="close" data-dismiss="alert">&times;</a><strong>Purchase requisition saved successfully</strong></div><asp:Panel ID="PODetails" runat="server"><div><asp:UpdatePanel ID="UpdatePanelPO" runat="server"><ContentTemplate><asp:Panel ID="Panel1" runat="server" BackColor="#E6E6E6"><fieldset class="form-horizontal"><div class="row"><div class="form-group col-sm-6"><asp:Label runat="server" CssClass="col-sm-6 control-label">Required Date</asp:Label><div class="col-sm-6"><div class="input-group date" id="datetimepicker"><span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span></span><asp:TextBox ID="txtRequiredDate" runat="server" CssClass="form-control"></asp:TextBox><asp:RequiredFieldValidator runat="server" ControlToValidate="txtRequiredDate" Display="Dynamic"
                                                CssClass="text-danger" ErrorMessage="The Required Date field is required." /></div></div></div><div class="form-group col-sm-6"><asp:Label runat="server" CssClass="col-sm-6 control-label">No.</asp:Label><div class="col-sm-6"><asp:Label ID="lblDocNum" runat="server" CssClass="form-control"></asp:Label></div></div></div></fieldset><fieldset class="form-horizontal"><div class="row"><div class="form-group col-sm-6"><asp:Label runat="server" CssClass="col-sm-6 control-label" class="">Cust. PO No.</asp:Label><div class="col-sm-6"><div class="input-group"><asp:TextBox ID="txtPurchaseOrderNo" runat="server" CssClass="form-control"></asp:TextBox><asp:RequiredFieldValidator runat="server" ControlToValidate="txtPurchaseOrderNo" Display="Dynamic"
                                                CssClass="text-danger" ErrorMessage="The Cust. Purchase Order No field is required." /></div></div></div><div class="form-group col-sm-6"><asp:Label runat="server" CssClass="col-sm-6 control-label">Contact</asp:Label><div class="col-sm-6"><div class="input-group"><asp:TextBox ID="txtContact" runat="server" CssClass="form-control"></asp:TextBox><asp:RequiredFieldValidator runat="server" ControlToValidate="txtContact" Display="Dynamic"
                                                CssClass="text-danger" ErrorMessage="The Contact field is required." /></div></div></div></div></fieldset><fieldset class="form-horizontal"><div class="row"><div class="form-group col-sm-3"><asp:Label runat="server" CssClass="col-sm-12 control-label" class="">Customer Name</asp:Label></div><div class="form-group col-sm-9"><asp:TextBox ID="txtCustomer" runat="server" CssClass="form-control"></asp:TextBox><ajaxToolkit:AutoCompleteExtender
                                        ID="AutoCompleteExtender1"
                                        runat="server"
                                        TargetControlID="txtCustomer"
                                        ServicePath="../../Web_Service/Customers.asmx"
                                        ServiceMethod="GetCustomers"
                                        MinimumPrefixLength="2"
                                        EnableCaching="true"
                                        CompletionSetCount="10"
                                        CompletionInterval="10"
                                        DelimiterCharacters=";, :"
                                        ShowOnlyCurrentWordInCompletionListItem="true"></ajaxToolkit:AutoCompleteExtender><asp:RequiredFieldValidator runat="server" ControlToValidate="txtCustomer" Display="Dynamic"
                                        CssClass="text-danger" ErrorMessage="The Customer field is required." /></div></div></div></fieldset></asp:Panel><asp:GridView ID="pOGridView"
                        runat="server"
                        AutoGenerateColumns="False"
                        AllowPaging="True"
                        AllowSorting="True"
                        ShowFooter="True"
                        OnRowEditing="pOGridView_RowEditing"
                        OnRowUpdating="pOGridView_RowUpdating"
                        OnPageIndexChanging="pOGridView_PageIndexChanging"
                        OnRowCancelingEdit="pOGridView_RowCancelingEdit"
                        PagerStyle-CssClass="bs-pagination"
                        ShowHeaderWhenEmpty="True"
                        EmptyDataText="No Records Found"
                        CssClass="table table-striped table-bordered table-hover table-condensed"><Columns><asp:TemplateField ItemStyle-Width="30px" HeaderText="#"><ItemTemplate><asp:Label ID="lblLineNum" Text='<%# Container.DataItemIndex + 1 %>' runat="server" /></ItemTemplate></asp:TemplateField><asp:TemplateField ItemStyle-Width="120px" HeaderText="Item"><ItemTemplate><asp:Label ID="lblItem" runat="server"
                                        Text='<%# Bind("Item")%>'></asp:Label></ItemTemplate><EditItemTemplate><asp:TextBox ID="txtItem" runat="server" Width="300px" Text='<%# Bind("Item")%>'></asp:TextBox><ajaxToolkit:AutoCompleteExtender
                                        ID="AutoCompleteExtender2"
                                        runat="server"
                                        TargetControlID="txtItem"
                                        ServicePath="../../Web_Service/Items.asmx"
                                        ServiceMethod="GetItems"
                                        MinimumPrefixLength="2"
                                        EnableCaching="true"
                                        CompletionSetCount="10"
                                        CompletionInterval="10"
                                        DelimiterCharacters=";, :"
                                        ShowOnlyCurrentWordInCompletionListItem="true"></ajaxToolkit:AutoCompleteExtender><asp:RequiredFieldValidator runat="server" ControlToValidate="txtItem" Display="Dynamic" ValidationGroup="Edit"
                                        CssClass="text-danger" ErrorMessage="The Item field is required." /></EditItemTemplate><FooterTemplate><asp:TextBox ID="txtItem" runat="server" Width="300px"></asp:TextBox><ajaxToolkit:AutoCompleteExtender
                                        ID="AutoCompleteExtender3"
                                        runat="server"
                                        TargetControlID="txtItem"
                                        ServicePath="../../Web_Service/Items.asmx"
                                        ServiceMethod="GetItems"
                                        MinimumPrefixLength="2"
                                        EnableCaching="true"
                                        CompletionSetCount="10"
                                        CompletionInterval="10"
                                        DelimiterCharacters=";, :"
                                        ShowOnlyCurrentWordInCompletionListItem="true"></ajaxToolkit:AutoCompleteExtender><asp:RequiredFieldValidator runat="server" ControlToValidate="txtItem" Display="Dynamic" ValidationGroup="Insert"
                                        CssClass="text-danger" InitialValue="-1" ErrorMessage="The Item field is required." /></FooterTemplate></asp:TemplateField><asp:TemplateField ItemStyle-Width="60px" HeaderText="Qty."><ItemTemplate><asp:Label ID="lblQuantity" runat="server"
                                        Text='<%# Bind("Quantity")%>'></asp:Label></ItemTemplate><EditItemTemplate><asp:TextBox ID="txtQuantity" runat="server" Width="100px"
                                        Text='<%# Bind("Quantity")%>'></asp:TextBox><asp:RequiredFieldValidator runat="server" ControlToValidate="txtQuantity" Display="Dynamic" ValidationGroup="Edit"
                                        CssClass="text-danger" ErrorMessage="The Quantity field is required." /><asp:RegularExpressionValidator ControlToValidate="txtQuantity" runat="server" CssClass="text-danger" Display="Dynamic"
                                        ErrorMessage="Only integers allowed." ValidationExpression="^(0|[1-9]\d*)$"
                                        ValidationGroup="Edit"></asp:RegularExpressionValidator></EditItemTemplate><FooterTemplate><asp:TextBox ID="txtQuantity" runat="server" Width="100px"></asp:TextBox><asp:RequiredFieldValidator runat="server" ControlToValidate="txtQuantity" Display="Dynamic" ValidationGroup="Insert"
                                        CssClass="text-danger" ErrorMessage="The Quantity field is required." /><asp:RegularExpressionValidator ControlToValidate="txtQuantity" runat="server" CssClass="text-danger" Display="Dynamic"
                                        ErrorMessage="Only integers allowed." ValidationExpression="^(0|[1-9]\d*)$"
                                        ValidationGroup="Insert"></asp:RegularExpressionValidator></FooterTemplate></asp:TemplateField><asp:TemplateField ItemStyle-Width="80px" HeaderText="Unit Price"><ItemTemplate><asp:Label ID="lblUnitPrice" runat="server"
                                        Text='<%# Bind("UnitPrice")%>'></asp:Label></ItemTemplate><EditItemTemplate><asp:TextBox ID="txtUnitPrice" runat="server" Width="100px"
                                        Text='<%# Bind("UnitPrice")%>'></asp:TextBox><asp:RequiredFieldValidator runat="server" ControlToValidate="txtUnitPrice" Display="Dynamic" ValidationGroup="Edit"
                                        CssClass="text-danger" ErrorMessage="The Unit Price is required." /><asp:RegularExpressionValidator ControlToValidate="txtUnitPrice" runat="server" CssClass="text-danger" Display="Dynamic"
                                        ErrorMessage="Only numbers allowed." ValidationExpression="^[0-9]{0,6}(\.[0-9]{1,2})?$"
                                        ValidationGroup="Edit"></asp:RegularExpressionValidator></EditItemTemplate><FooterTemplate><asp:TextBox ID="txtUnitPrice" runat="server" Width="100px"></asp:TextBox><asp:RequiredFieldValidator runat="server" ControlToValidate="txtUnitPrice" Display="Dynamic" ValidationGroup="Insert"
                                        CssClass="text-danger" ErrorMessage="The Unit Price is required." /><asp:RegularExpressionValidator ControlToValidate="txtUnitPrice" runat="server" CssClass="text-danger" Display="Dynamic"
                                        ErrorMessage="Only numbers allowed." ValidationExpression="^[0-9]{0,6}(\.[0-9]{1,2})?$"
                                        ValidationGroup="Insert"></asp:RegularExpressionValidator></FooterTemplate></asp:TemplateField><asp:TemplateField ItemStyle-Width="80px" HeaderText="Order Price"><ItemTemplate><asp:Label ID="lblOrderPrice" runat="server"
                                        Text='<%# Bind("OrderPrice")%>'></asp:Label></ItemTemplate><EditItemTemplate><asp:TextBox ID="txtOrderPrice" runat="server" Width="100px"
                                        Text='<%# Bind("OrderPrice")%>'></asp:TextBox><asp:RequiredFieldValidator runat="server" ControlToValidate="txtOrderPrice" Display="Dynamic" ValidationGroup="Edit"
                                        CssClass="text-danger" ErrorMessage="The Order Price is required." /><asp:RegularExpressionValidator ControlToValidate="txtOrderPrice" runat="server" CssClass="text-danger" Display="Dynamic"
                                        ErrorMessage="Only numbers allowed." ValidationExpression="^[0-9]{0,6}(\.[0-9]{1,2})?$"
                                        ValidationGroup="Edit"></asp:RegularExpressionValidator></EditItemTemplate><FooterTemplate><asp:TextBox ID="txtOrderPrice" runat="server" Width="100px"></asp:TextBox><asp:RequiredFieldValidator runat="server" ControlToValidate="txtUnitPrice" Display="Dynamic" ValidationGroup="Insert"
                                        CssClass="text-danger" ErrorMessage="The Order Price is required." /><asp:RegularExpressionValidator ControlToValidate="txtOrderPrice" runat="server" CssClass="text-danger" Display="Dynamic"
                                        ErrorMessage="Only numbers allowed." ValidationExpression="^[0-9]{0,6}(\.[0-9]{1,2})?$"
                                        ValidationGroup="Insert"></asp:RegularExpressionValidator></FooterTemplate></asp:TemplateField><asp:CommandField ShowEditButton="True" ValidationGroup="Edit" /><asp:TemplateField><ItemTemplate><asp:LinkButton ID="lnkRemove" runat="server"
                                        CommandArgument='<%# Bind("LineNum")%>'
                                        OnClientClick="return confirm('Are you sure you want to delete this row?')"
                                        Text="Delete" OnClick="DeleteRowPurchaseOrder"></asp:LinkButton></ItemTemplate><FooterTemplate><asp:Button ID="btnAdd" runat="server" Text="Add" ValidationGroup="Insert" CssClass="btn btn-primary btn-sm"
                                        OnClick="AddRowPurchaseOrder" /></FooterTemplate></asp:TemplateField></Columns></asp:GridView><div class="form-group"><div class="row"><div class="col-sm-3"><asp:Button runat="server" ID="InsertButton" OnClick="Insert" Text="Insert" CssClass="btn btn-block btn-primary" /></div><div class="col-sm-3"><asp:Button runat="server" ID="CancelButton" OnClick="Cancel" Text="Cancel" CausesValidation="false" CssClass="btn btn-block btn-default" /></div></div></div></ContentTemplate></asp:UpdatePanel></div></asp:Panel></asp:Content>

The dropdownlist is remove when postback is performed inside the updatepanel

0
0

I put the dropdownlist control in the updatepanel so that the page does not refresh until the postback operation is done, but when I select one of the dropdownlist options and the postback operation is performed, the dropdownlist is removed from the page, even inside the viewsource. Can not be seen please check to see where my code problem is

this is befor select dropdown items:

and this is after select one of dropdown  items:


                        <asp:UpdatePanel ID="UpdatePanel1" UpdateMode="Conditional" runat="server">
                            <ContentTemplate>

                    <div class="row">
                        <div class="col s12 m12 l12">

                            <div id="basic-tabs" class="card card card-default scrollspy">

                                <%--content tag--%>
                                <div class="card-content">
                                    <h4 class="header">تبلیغات اینفلوئنسر مارکتینگ</h4>
                                    <div class="row">
<%--                                        <div class="col s12">
                                            <p>در این روش از تبلیغ، افراد تاثیرگذار یا اینفلوئنسر در اینستاگرام، در مورد شما یا کسب و کار شما شروع به صحبت کرده و به دیگران معرفی میکنند.</p>
                                            <p>مدت زمان نمایش تبلیغ کاملا بستگی به اینفلوئنسر دارد، اما بطور پیش فرض دائمی میباشد.</p>
                                            <p>اگر هدفتان از تبلیغ برندسازی یا افزایش درآمد است، این روش از تبلیغات بهترین گزینه است.</p>
                                            <p>سرعت انتشار و تاثیرگذاری این نوع تبلیغات بسیار بالاست. به شکلی که تبلیغات شما به صورت ویروسی در اینترنت منتشر می‌شود.</p>
                                            <p>در صورت کنسل شدن سفارش شما بعد از پرداخت و قبل از شروع تبلیغات، 10 درصد از هزینه کل نزد دیدوگرام باقی خواهد ماند.</p>
                                            <p>در صورتی که تصمیم به اینگونه تبلیغ دارید، حتما جزئیات دقیق کمپین تبلیغاتی خود را در بخش استعلام ارسال کنید تا به درخواست شما رسیدگی شود.</p>
                                            <br />
                                        </div>--%>
                                        <div class="col s12">

                                            <div class="card-alert card gradient-45deg-light-blue-cyan">
                                                <div class="card-content white-text">
                                                    <p>
                                                        <i class="material-icons">info_outline</i> 
                                                        قیمت‌ها طبق آخرین تعرفه دریافت شده از صاحبان
                                                        پیج نوشته شده است و ممکن است برای اجرای کمپین تا ۱۰%
                                                        تغییر کند.
                                                        <br />
                                                        همچنین قیمت‌ها مشمول ۱۰٪ هزینه مدیریت کمپین خواهند شد.
                                                    </p>
                                                </div>
                                            </div>


                                        </div>

                                        <div class="col s12">

                                            <div class="row col l4 m4 s12">
                                                    <div class="input-field">
                                                        <label class="contact-input" for="ContentPlaceHolder1_txtSearch">جستجوی اسم کانال</label>
                                                        <i class="material-icons prefix">search</i>
                                                        <asp:TextBox ID="txtSearch" runat="server" OnTextChanged="txtSearch_TextChanged" AutoPostBack="true"></asp:TextBox>
                                                    </div>
                                            </div>
                                            <div class="row col 14 m4 s12">
                                                    <div class="input-field">
                                                        <i class="material-icons prefix">toc</i>

                                                        <asp:SqlDataSource ID="sqldsBio" runat="server" ConnectionString='<%$ ConnectionStrings:conStr %>' SelectCommand="InfluenceryPage_Bio_List" SelectCommandType="StoredProcedure"></asp:SqlDataSource>
                                                        <asp:DropDownList ID="ddlBio" AppendDataBoundItems="true" AutoPostBack="true" runat="server" DataSourceID="sqldsBio" DataTextField="inBio" DataValueField="inBio" OnSelectedIndexChanged="ddlBio_SelectedIndexChanged">
                                                            <asp:ListItem Text="بیوگرافی مورد نظر را انتخاب کنید" Selected="True" disabled></asp:ListItem>
                                                        </asp:DropDownList>

                                                    </div>
                                            </div>
                                            <div class="row col l4 m4 s12">
                                                    <div class="input-field">
                                                        <i class="material-icons prefix">import_export</i>
                                                        <asp:DropDownList ID="ddlSort" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddlSort_SelectedIndexChanged">
                                                            <asp:ListItem Text="" Selected="True" disabled></asp:ListItem>
                                                            <asp:ListItem Value="1">قیمت ارزان به گران</asp:ListItem>
                                                            <asp:ListItem Value="2">قیمت گران به ارزان</asp:ListItem>
                                                            <asp:ListItem Value="3">فالوئر از زیاد به کم</asp:ListItem>
                                                            <asp:ListItem Value="4">فالوئر از کم به زیاد</asp:ListItem>
                                                            <asp:ListItem Value="5">نرخ تعامل از زیاد به کم</asp:ListItem>
                                                        </asp:DropDownList>
                                                    </div>
                                            </div>

                                        </div>

                                    </div>
                                </div>
                                <%--end content tag--%>
                            

                                <div class="row">
                                    <!-- News 1 -->
                                    <div class="col s12 m12 l12">
                                        
                                        <asp:ListView ID="lstInluenceryPages" runat="server" DataKeyNames="id" ItemPlaceholderID="itemPlaceHolder" GroupPlaceholderID="grpPlaceHolder" OnItemCommand="lstInluenceryPages_ItemCommand">
                                            <LayoutTemplate>

                                                    <asp:PlaceHolder ID="grpPlaceHolder" runat="server"></asp:PlaceHolder>      
                                                                                                                
                                            </LayoutTemplate>

                                            <GroupTemplate>
                                                <asp:PlaceHolder ID="itemPlaceHolder" runat="server"></asp:PlaceHolder>
                                            </GroupTemplate>

                                            <ItemTemplate>

                                                <asp:HiddenField ID="hdfDeptID" Value='<%# Eval("id") %>' runat="server" />

                                                <div class="col s12 m4 l4">

                                                    <div class="card-panel border-radius-6 pt-4 pb-4">

                                                        <div class="display-flex justify-content-between flex-wrap mt-2">
                                                            <div class="row">
                                                                <div class="col m3">
                                                                    <img src="<%#Eval("inpic").ToString().Replace("~","") %>" width="55" alt="news" class="circle mr-10 vertical-text-middle">
                                                                </div>
                                                                <div class="col m9">
                                                                    <span class="pt-2"><%#Eval("intitle") %></span><br />
                                                                    <span class="pt-2"><img src="/assets/images/icon/instaicon.png"> <a href='https://www.instagram.com/<%#Eval("inid").ToString().Replace("@","") %>' target="_blank"><%#Eval("inid").ToString().Replace("@","") %></a></span><br />
                                                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="pt-2"><%#Eval("inbio") %></span></div>
                                                            </div>
                                                            <div class="row pt-15">
                                                                <div class="col m12">
                                                                    <div class="display-flex mt-3 right-align social-icon">
                                                                        <span class="display-block center"><span class="material-icons">perm_identity</span> <br /> <%#Eval("infollowers") %> </span>
                                                                        <span class="influenceryGadgets display-block center ml-5"><span class="material-icons">chat_bubble_outline</span> <br /> <%#Eval("inposts") %></span>
                                                                        <span class="influenceryGadgets display-block center ml-5"><span class="material-icons">favorite_border</span> <br /> <%#Eval("inlikes") %></span>
                                                                        <span class="influenceryGadgets display-block center ml-5"><span class="material-icons">star_border</span> <br /> <%#Eval("iningagement") %></span>
                                                                    </div>
                                                                </div>
                                                            </div>

                                                        </div>

                                                        <div class="display-flex flex-wrap justify-content-center mt-5">
                                                            <h5 class="mt-3 green-text"><%# Get_Change_Money_Format(Eval("inprice").ToString()) + " تومان" %></h5>
                                          
                                                            <a class="mt-2 btn btn-block nocolor-bordered modal-trigger z-depth-4" href='#modal<%#Eval("id")%>'>مشاهده پست ها</a>
                                                            <asp:Button ID="btnAddToBasket" CommandArgument='<%# Eval("id") %>' CommandName="AddToBasket"  CssClass="mt-2 waves-effect waves-light gradient-45deg-deep-purple-blue btn btn-block modal-trigger z-depth-4" runat="server" Text="افزودن به سبد خرید" />
                                                        </div>

                                                    </div>

                                                        <!-- Modal Structure -->
                                                        <div id='modal<%#Eval("id")%>' class="modal modal-lg">
                                                            <div class="modal-content pt-2">

                                                                <header class="modal-header">
                                                                    <h5 class="modal-title">پرطرفدارترین پست‌های
                                                                        <strong>

                                                                            پرطرفدارترین پست های << <%#Eval("inid") %> >> | <%#Eval("intitle") %> 

                                                                        </strong>
                                                                        <i class="far fa-question-circle fa-flip-horizontal text-gray"></i>
                                                                    </h5>
                                                                    <button type="button" aria-label="Close" class="close">×</button>
                                                                </header>

                                                                <div class="row" id="product-one">

                                                                    <div class="row">

                                                                        <div dir="ltr" class="d-flex text-left pb-2 px-4 col m12">
                                                                            <a target="_blank" href='https://www.instagram.com/<%#Eval("inid").ToString().Replace("@","") %>'>
                                                                                <img src="<%#Eval("inpic").ToString().Replace("~","") %>" height="70" class="img-thumbnail rounded-circle float-left profileImg_3097z">
                                                                            </a> 
                                                                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<div class="d-flex flex-column justify-content-center px-4">
                                                                                <div class="dir-ltr d-inline-block py-1 mb-1 mb-md-2">
                                                                                    <strong class="usernameSection_3NxnJ">
                                                                                        <a target="_blank" href='https://www.instagram.com/<%#Eval("inid").ToString().Replace("@","") %>'> <%#Eval("inid") %> </a>
                                                                                    </strong>
                                                                                </div> 
                                                                                <div>
                                                                                    <ul class="profileInfo_1-Z3p">
                                                                                    <li>
                                                                                        <span class="font-weight-bold"><%#Eval("infollowers") %></span>فالورها
                                                                                    </li> 
                                                                                    <li>
                                                                                        <span class="font-weight-bold"><%#Eval("inposts") %></span>پست ها
                                                                                    </li> 
                                                                                    <li>
                                                                                        <span class="font-weight-bold"><%#Eval("inlikes") %></span>لایک ها
                                                                                    </li> 
                                                                                    <li>
                                                                                        <span class="font-weight-bold"><%#Eval("iningagement") %></span></span>اینگیجمنت
                                                                                    </li>
                                                                                    </ul>
                                                                                </div> 
                                                                                <div>
                                                                                    <span class="badge badge-light category_2Ju0m">
                                                                                    ورزش
                                                                                    </span>
                                                                                </div>
                                                                            </div>
                                                                        </div>

                                                                    </div>


                                                                    <div class="row">   
                                                                
                                                                        <asp:SqlDataSource ID="sqldsPostImages" runat="server" ConnectionString='<%$ ConnectionStrings:conStr %>' SelectCommand="SELECT * FROM [tblAdsInfluenceryPosts] WHERE ([adid] = @adid)">
                                                                                <SelectParameters>
                                                                                    <asp:ControlParameter ControlID="hdfDeptID" PropertyName="Value" Name="adid" Type="Int32"></asp:ControlParameter>
                                                                                </SelectParameters>
                                                                            </asp:SqlDataSource>
                                                                        <asp:ListView ID="lstPostImages" runat="server" ItemPlaceholderID="itemPlaceHolder" GroupPlaceholderID="grpPlaceHolder" DataSourceID="sqldsPostImages">
                                                                            <LayoutTemplate>

                                                                                    <asp:PlaceHolder ID="grpPlaceHolder" runat="server"></asp:PlaceHolder>      
                                                                                                                
                                                                            </LayoutTemplate>

                                                                            <GroupTemplate>
                                                                                <asp:PlaceHolder ID="itemPlaceHolder" runat="server"></asp:PlaceHolder>
                                                                            </GroupTemplate>

                                                                            <ItemTemplate>                                                                                                                                                                                           
                                                                                    <div class="col m4 s12">
                                                                                        <a class="text-body">
                                                                                            <div class="card h-100 postCard">
                                                                                                <img src='<%#Eval("imgLink").ToString().Replace("~","") %>' />

                                                                                                <div class="card-body">

                                                                                                    <div class="d-flex mt-2">
                                                                                                        <div class="d-flex justify-content-center align-items-center flex-grow-1">
                                                                                                            <strong class="number">
                                                                                                                     <%#Eval("postLikes") %>
                                                                                                            </strong> 
                                                                                                            <span class="material-icons">favorite_border</span>
                                                                                                        </div> 
                                                                                                        <div class="d-flex justify-content-center align-items-center flex-grow-1">
                                                                                                            <strong class="number">
                                                                                                                     <%#Eval("postComments") %>
                                                                                                            </strong> 
                                                                                                            <span class="material-icons">chat_bubble_outline</span>
                                                                                                        </div>
                                                                                                    </div>
                                                                                                   
                                                                                                    <p class="card-text">
                                                                                                        <%#Eval("postDesc") %>
                                                                                                    </p>                                                                                            
                                                                                                </div>

                                                                                            </div>
                                                                                        </a>
                                                                                    </div>                                                                        
                                                                            </ItemTemplate>
                                                                        </asp:ListView>


                                                                    </div>


                                                                </div>
                                                            </div>
                                                        </div>

                                                </div>
                                            </ItemTemplate>
                                        </asp:ListView>


                                    </div>

                                 </div>

                            </div>
                    </div>


                                <div class="col s12 m12 l12">
                                    <div class="gradient-۴۵deg-light-blue-indigo mediaDetail_dVIaq" id="PnlBasket" runat="server">
                                        <div class="order-1 order-md-2 flex-grow-1 w-100 w-md-auto">
                                            <div class="center-align basketMedium">
                                                مجموع:
                                                <b><asp:Label ID="lblBasketPrice" runat="server" Text="0"></asp:Label></b>
                                                تومان
                                                <small class="fanum">
                                                    (<asp:Label ID="lblPageCount" runat="server" Text="0"></asp:Label> پیج)
                                                </small>
                                            </div>
                                        </div>
                                        <a class="btn waves-effect waves-light red" href="/influencery_invoice">
                                            مشاهده سبد
                                            <i class="fa fa-chevron-left ml-0 mr-2"></i>
                                        </a>
                                    </div>
                                </div>


                </div>

                            </ContentTemplate>
                        </asp:UpdatePanel>

Update Panel shows data from multiple users

0
0

Hello,

I have a web app with multiple pages relating to performing Exchange tasks for non exchange administrators.

One of these pages will allow a user to view / add / remove permissions from a mailbox.

It works fine, but the viewing takes around 40 seconds because of all the calls to exchange cmdlets.

So, I thought I'd add an Update Panel and provide progress on each step. 

That works great if only one user uses the page at a time, but if multiple people run it, the data is either combined for both or one person gets the other's data.

This is my update panel:

<asp:UpdatePanel ID="pnlResults" runat="server" UpdateMode="Conditional" Visible="false" ChildrenAsTriggers="false"><ContentTemplate><asp:Label ID="lblResults" runat="server" Height="150px"></asp:Label><br /><asp:TextBox ID="txtProgress" runat="server" Visible="false" TextMode="MultiLine" BorderStyle="None" Width="95%" Style="overflow: hidden;" AutoPostBack="false"></asp:TextBox><br /><br /><asp:Table ID="thePermissionTable" runat="server" AutoPostBack="true" BorderStyle="None"></asp:Table><br /><asp:Button ID="btnRemoveAccess" runat="server" Visible="false" Text="!Remove Access!"></asp:Button><br /><asp:Button ID="btnBack" Text="Return" runat="server" OnClick="BtnBack_Click" Visible="true" AutoPostBack="true"></asp:Button><asp:TextBox ID="txtPermissionToRevoke" runat="server" Width="0px" Height="0px" BorderStyle="None"></asp:TextBox><asp:TextBox ID="txtSendOnBehalf" runat="server" Width="0px" Height="0px" BorderStyle="None"></asp:TextBox><asp:TextBox ID="txtSendOnBehalfToRevoke" runat="server" Width="0px" Height="0px" BorderStyle="None"></asp:TextBox></ContentTemplate><Triggers><asp:AsyncPostBackTrigger ControlID="Timer1" EventName="Tick" /></Triggers></asp:UpdatePanel>

This is timer1_tick:

protected void Timer1_Tick(object sender, EventArgs e)
    {
        if (inProcess)
        {
            txtProgress.Rows = content.Split('\r').Length + 1;
            txtProgress.Text = content;
        }
        if (processComplete && content.Substring(content.Length - processCompleteMsg.Length) == processCompleteMsg) //has final message been set?
        {
            inProcess = false;
            btnNext.Visible = false;
            btnBack.Visible = true;
            txtProgress.Text = content;
            if (tableDone)
            {
                if (rdoAction.SelectedValue.ToString().ToLower() == "remove-access")
                {
                    pnlButtons.Visible = true;
                    btnRemoveAccess.Visible = true;
                }
                thePermissionTable.Visible = true;
            }
            Timer1.Enabled = false;
        }
        else
        {
            if (displayTable)
                CreateTable();
            if (rdoAction.SelectedValue.ToString().ToLower() == "remove-access")
            {
                pnlButtons.Visible = true;
                btnRemoveAccess.Visible = true;
            }
        }
    }

I start the process with my button click in RaisePostBackEvent like so:
                   switch (action)
                    {
                        case "display-access":
                            Timer1.Enabled = true;
                            inProcess = true;
                            pnlButtons.Visible = false;
                            Thread workerThread = new Thread(new ThreadStart(() =>
                            {
                                FnGetCurrentAccess();
                            }));
                            workerThread.Start();
                            break;
}

FnGetCurrentAccess() does almost all of the exchange cmdlets by calling my commonfunctions class, and adds to the content which is a private static string.

I have no idea how to make this work, so I appreciate any ideas.

Karl





Latest Images