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

How to add error message into validation summary control in asp.net

$
0
0

Hi All,

I am stuck in one requirement, I have a web page which have 4 text-boxes, 2 text-boxes validate with javascript and other 2 text-boxes validate with required field validator. i have one validation summery control and i want to show all four error message into validation summery control with out creating any custom validation.

Please help.

Thanks

Pushp Singh


How do I delay the AsyncPostBackTrigger?

$
0
0

Following is what I have written on the front end of my web page

<div id="Div1" style="float: left;"><asp:UpdatePanel ID="UpdatePanel2" runat="server"><Triggers><asp:AsyncPostBackTrigger ControlID="txtAN" EventName="TextChanged" /></Triggers><ContentTemplate><asp:TextBox ID="TextBox1" runat="server" CssClass="text_font" Height="16" Width="100" MaxLength="500"                                                  OnTextChanged="txtAN_TextChanged" AutoPostBack="true"></asp:TextBox></ContentTemplate></asp:UpdatePanel></div>

A value (Ex : 0003333) is being scanned in to this text box (TextBox1) from a QR code reader. But there is a weird delay when scanning the value from the QR code reader. First the digit0 (zero) (which is the first digit of the given example) appears in the text box but the rest of the values (003333) appear after a few milliseconds. As soon as the first digit appears, my event (txtAN_TextChanged) gets triggered so an incorrect value is given as the input. 

Can someone help me to solve this matter. Thanks in advance.

MessageBox does not apper while Page loading

$
0
0

Hi Together

Could someone help me with following issue...

I am Using following MessageBox to display some erroros or success ocurances on the page:

public static void ShowMessage(Page page, string message)
        {
            message = Regex.Replace(message, @"[^\w\.@-]", "",
                                RegexOptions.None, TimeSpan.FromSeconds(1.5)); 
            AjaxControlToolkit.ToolkitScriptManager.RegisterStartupScript(page, page.GetType(), "MessageBox", "alert('" + message + "')", true);
        }

If some Errors happens in c# methods in code behind after page submit message box is appearing fine.

The Problem is that the message does not appear in case of some error during page loading...

Example:

My web form is loading some user from activeDirectory into greadview..

GetUserPrincipal method is called when page is loading to fill up griedview.

If some error happens in GetUserPrincipal method during loading of the page, my message box, which is integrated in catch part of the method,

does not appear.

What is the Problem...Do you have any idea?

Thanks in advance for your help

Asp Code Part:

<asp:Panel Style="display: none;" ID="UsrPopupPanel1" runat="server"><div id="UsrPopupMainContent" class="PopupMainContent"><div id="UsrPopupToolbox"><asp:TextBox ID="UserName" runat="server"></asp:TextBox><asp:Button ID="SearchUser" CssClass="EditButton" runat="server" Text="Search" OnClick="SearchUser_Click" /></div><div id="DivGridTable"><asp:ObjectDataSource ID="ObjectDataSource1" runat="server" SelectMethod="GetUserPrincipals" TypeName="UserManagement.AD.AdManagement"
                                FilterExpression="LastName like '{0}*'" EnableCaching="false"><FilterParameters><asp:ControlParameter Name="LastName" ControlID="UserName" PropertyName="Text" /></FilterParameters></asp:ObjectDataSource><asp:GridView ID="GridView1" runat="server" DataSourceID="ObjectDataSource1"
                                OnRowDataBound="GridView1_RowDataBound" AllowSorting="True" OnSorting="GridView1_Sorting" AutoGenerateColumns="False"><Columns><asp:BoundField DataField="LastName" HeaderText="LastName" SortExpression="LastName" /><asp:BoundField DataField="FirstName" HeaderText="FirstName" SortExpression="FirstName" /><%--<asp:BoundField DataField="Name" HeaderText="Name" SortExpression="Name" />--%><asp:BoundField DataField="AccountName" HeaderText="AccountName" SortExpression="AccountName" /></Columns><FooterStyle CssClass="GridFooter" /><HeaderStyle CssClass="GridHeader" /><PagerStyle CssClass="GridPage" /><RowStyle CssClass="GridRaw" /><SelectedRowStyle CssClass="GridSelectedRow" /><SortedAscendingCellStyle CssClass="GridSort" /></asp:GridView><br /></div><asp:Button ID="CloseButton" CssClass="EditButton" runat="server" Text="Close" /><asp:Button ID="OKButton" CssClass="EditButton" runat="server" Text="OK" /></div></asp:Panel><ajaxToolkit:ModalPopupExtender
                    ID="ModalPopupExtender1"
                    TargetControlID="btnNewMailboxBrowse"
                    PopupControlID="UsrPopupPanel1"
                    OkControlID="OKButton" CancelControlID="CloseButton"
                    BehaviorID="mpe" runat="server"></ajaxToolkit:ModalPopupExtender></ContentTemplate></asp:UpdatePanel>

Method in Code Behind:

public DataTable GetUserPrincipals()
        {
            DataTable results = new DataTable();

            List<string> excludedOUs = new List<string>();
            string linkedDomainFqdn = HttpContext.Current.Session["LinkedDomainFQDN"] as string;
            string linkedUsersOu = HttpContext.Current.Session["LinkedUsersOU"] as string;
            string linkdeLdapAccount = HttpContext.Current.Session["LinkedLdapAccount"] as string;
            string linkedLdappassword = PassDecryption.DecryptPassword(HttpContext.Current.Session["LinkedLdapPass"] as string);
            using (PrincipalContext principalcontext = new PrincipalContext(ContextType.Domain, linkedDomainFqdn, linkedUsersOu, linkdeLdapAccount, linkedLdappassword))
            {
                Page page = HttpContext.Current.CurrentHandler as Page;

                try
                {
                    UserPrincipal adPrincipal = new UserPrincipal(principalcontext);

                    adPrincipal.SamAccountName = "*";
                    PrincipalSearcher principalSearcher = new PrincipalSearcher();
                    principalSearcher.QueryFilter = adPrincipal;
                    results.Columns.Add("LastName");
                    results.Columns.Add("FirstName");
                    results.Columns.Add("AccountName");

                    foreach (UserPrincipal p in principalSearcher.FindAll())
                    {
                        if (!p.DistinguishedName.Contains("CN=Users"))
                        {
                            DataRow dr = results.NewRow();
                            if (p.Surname != null)
                            dr["LastName"] = p.Surname;
			    dr["FirstName"] = p.GivenName;
                            dr["AccountName"] = p.SamAccountName;
                            results.Rows.Add(dr);
                        }
                    }

                    //results.AsEnumerable().OrderBy(o => o["LastName"].ToString());
                    results.DefaultView.Sort = "LastName" + " " + "ASC";
                    results = results.DefaultView.ToTable();
                    principalcontext.Dispose();


                }
                catch (Exception exception)
                {
                    
                    MessageBoxInfo.ShowMessage(page, "Exception caught:" + exception.Message.ToString());
                    principalcontext.Dispose();
                }
                finally { principalcontext.Dispose(); }
                //return adPrinicpals;
                return results;
            }
        }

Calling WCF service from jQuery Ajax using POST method

$
0
0

var     AddUser="http://12.168.176.125/WcfRestService/Service1.svc/UserPost";

function

adduser(){

           

var UserInfo =[{

               

"UserId":2,

               

"uAlias":"v-lujin",

               

"uPassword":"123",

               

"uFirst_Name":"lu",

               

"uLast_Name":"jing",

               

"uState":"yes"

           

}];

            $

.ajax({

                type

:"POST",

                url

: AddUser,

                data

: JSON.stringify(UserInfo),

                dataType

:"json",

                processData

:false,

                contentType

:"application/json;charset=utf-8",

                success

:function(){

                    alert

("success");

               

},

                error

:function(error){

                    alert

(JSON.stringify(UserInfo));

               

}

           

});

       

}

ajax submit a object and how to get it in code behind C#

$
0
0
$(document).ready(function () {$("#login").click(function () {

                var username = $("#username").val();

                var password = $("#password").val();

                var user = '{ "username":"' + username + '", "password": "' + password + '" }';//这里,就是将数据封装成json
               
                $.ajax({
                    type: "POST",
                    cache: false,
                    dataType: "json",
                    contentType: "application/json; charset=utf-8",
                    url: 'http://localhost:16620/WebForm1.aspx/User2',
                    data: user ,
                    success: function (result) {
                        alert(result.d);

                    },

                    error: function (err) {

                        alert(err.error());

                    }
             
                })
            })
        })
<form id="form1" runat="server"><div><p>username<input type="text" id="username"/></p><p>password<input type="text" id="password" /></p><input type="button" id="login" value="提交"/></div></form>
 [WebMethod(true)]
 public static string User2(string username,string password)  //work well
        {
        }

[WebMethod(true)]
 public static string User2(string json) //don't wrok,how to let this work as a json string. Because,this could prevent the params are too many.
        {
           
        }




Add FilteredTextBoxExtender problem

$
0
0

I am trying to add a FilteredTextBoxExtender via code in a ListView and it is not working (not throwing error either).  My code is below. Am I missing something?  Thanks.

    Protected Sub lvSchedule_ItemDataBound(sender As Object, e As System.Web.UI.WebControls.ListViewItemEventArgs) Handles lvSchedule.ItemDataBound

                Dim fextender As AjaxControlToolkit.FilteredTextBoxExtender = New AjaxControlToolkit.FilteredTextBoxExtender
                Dim tb As TextBox = CType(lvSchedule.FindControl("txtCarbLiquid"), TextBox)
                fextender.FilterMode = AjaxControlToolkit.FilterModes.ValidChars
                fextender.ValidChars = "0123456789"
                fextender.TargetControlID = tb.ID

                lvSchedule.Controls.Add(fextender)

    END Sub

Looping through aspxgridview rows

$
0
0

Hi,

       I am using an aspxgridview (devexpress controls) and want to loop through all the rows in vb.net

 

Please help

regards

sanjish 

The HTML Editor Extender sanitizer.ddl assembly file not showing in Bin folder ?

$
0
0

I have installed the toolkit extensions into bin folder and I cannot see the folder that supposed to contain the sanitizer ?

I am reading from a website that shows the assembly references in a solution web application project.

Whereas I am using the alternative web site file version. 

How may I view  the assembly dll reference files to verify whether or not the sanitizer is loaded ?

and if not get the sanitizer ?  


Button In Modal Panel Not Firing On First Click (Firing Second click)

$
0
0

HI,

I have a Modal Panel that is displayed on the click of a button. On the Modal Panel, I have another button used to search and return details to a gridview. The problem is that on the first click of the search button, nothing happens, but upon clicking it again, it works. Any ideas?

<asp:Panel ID="ModalPanel" runat="server" Width="700px" CssClass="PopupBox" DropShadow="true" CancelControlID="btnSearchCancel" OKControlID="btnSearchCancel0" Height="600px"><h2>Search For Details</h2><p><label>Search Field</label><asp:TextBox ID="tSearchField" runat="server"></asp:TextBox></p><p><asp:Button ID="btnSearchPopup" runat="server" Text="Search" CssClass="buttonCenter" 
                    onClick="btnSearchDetails_Click" CausesValidation="False"/><asp:Button ID="btnSearchCancel" runat="server" Text="Cancel" 
                    CausesValidation="False" /></p><asp:GridView ID="gvSearch" runat="server" AutoGenerateColumns="False" 
                DataKeyNames="RegAn" AllowPaging="true" CssClass="table-searchresults"></asp:GridView></asp:Panel><p><asp:ModalPopupExtender ID="mpeSearch" runat="server" PopupControlID="ModalPanel" 
                TargetControlID="btnSearch" /></p>

btnSearch_Details is some serverside code to fill the Gridview

Thanks in advance.

Disable Calendar extender future date

$
0
0

I am using Ajax Calendar Extender. I would like to enable only future date for Calendar Extender control. How do we do that

 

HTMLEditorExtender text formatting properties

$
0
0

How may I modify the editor text ?

I have tried to vary the p element style because the line height was incorrect (extra line break)

 like:

.ajax__html_editor_extender_texteditor p
{
        line-height: 0px;
}

The text when inserted is half showing, until I press return key, then whole text reappears ?

How to show calender extender on top of modal popup extender?

$
0
0
<div>

I have used Ajax Modal popup extender for popup an the css for modal popup is as folows:

.modalBackground
{
    -webkit-border-radius: 12px 12px 23px 23px;
    border-radius: 12px 12px 23px 23px;
    -webkit-box-shadow: 12px 12px 12px 0 #946C10;
    box-shadow: 12px 12px 12px 0 #946C10;
    background-color: LightGrey;
    filter: alpha(opacity=80);
    opacity: 0.7;
    position:fixed; 
}

and the HTML for modal popup is as shown bellow:

<cc1:ModalPopupExtender ID="ModalPopupExtender1" runat="server" TargetControlID="btncomplains"
            PopupControlID="panelstatus" BackgroundCssClass="modalBackground" CancelControlID="ImageCancel1">
        </cc1:ModalPopupExtender>

<asp:Panel ID="panelstatus" GroupingText="Submit Details" BackColor="WhiteSmoke"
            Width="600px" runat="server" Style="border: thick solid #CCCCCC;">
            <div>
                <div align="right" style="padding: 2px; width: auto; height: 25px;">
                    <asp:Image ID="ImageCancel1" runat="server" ImageUrl="~/images/close2.png" CssClass="image_hover"
                        Width="25px" />
                </div>
                <asp:UpdatePanel ID="UpdatePanelpopup1" runat="server">
                    <ContentTemplate>
                        <table style="width: 580px">
                            <tr>
                                <td class="textalignment">
                                    <asp:Label ID="lblserialno" runat="server" Font-Bold="True" Text="Serial Number :"></asp:Label>
                                </td>
                                <td class="auto-style5">
                                    <asp:TextBox ID="txtserialno" runat="server" CssClass="textbox"></asp:TextBox>
                                </td>
                                <td class="tablealignmentcnlbtn">
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtserialno"
                                        ErrorMessage="Please Enter Serial No" ForeColor="#FF3300" ValidationGroup="process"
                                        Font-Size="Small"></asp:RequiredFieldValidator>
                                </td>
                            </tr>
                            <tr>
                                <td class="textalignment">
                                    <asp:Label ID="lblpinno" runat="server" Font-Bold="True" Text="Pin Number :"></asp:Label>
                                </td>
                                <td class="auto-style5">
                                    <asp:TextBox ID="txtpinno" runat="server" CssClass="textbox"></asp:TextBox>
                                </td>
                                <td class="tablealignment">
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtpinno"
                                        ErrorMessage="Please Enter Pin No" ForeColor="#FF3300" ValidationGroup="process"
                                        Font-Size="Small"></asp:RequiredFieldValidator>
                                </td>
                            </tr>
                            <tr>
                                <td class="textalignment">
                                    <asp:Label ID="lbltransactionid" runat="server" Font-Bold="True" Text="Transaction ID :"></asp:Label>
                                </td>
                                <td class="auto-style5">
                                    <asp:TextBox ID="txttransactionid" runat="server" CssClass="textbox"></asp:TextBox>
                                </td>
                                <td>
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="txttransactionid"
                                        ErrorMessage="Please Enter TransactionId" ForeColor="#FF3300" ValidationGroup="process"
                                        Font-Size="Small"></asp:RequiredFieldValidator>
                                </td>
                            </tr>
                            <tr>
                                <td class="textalignment">
                                    <asp:Label ID="lblrechargedate" runat="server" Font-Bold="True" Text="Recharge Date :"></asp:Label>
                                </td>
                                <td class="auto-style5">
                                    <asp:TextBox ID="txtrechargedate" runat="server" CssClass="textbox"></asp:TextBox>
                                    <cc1:TextBoxWatermarkExtender ID="txtrechargedate_TextBoxWatermarkExtender" runat="server" TargetControlID="txtrechargedate"   WatermarkText="MM/DD/YYYY" WatermarkCssClass="watermark">
                                    </cc1:TextBoxWatermarkExtender>
                                    <cc1:FilteredTextBoxExtender ID="txtrechargedate_FilteredTextBoxExtender" runat="server"
                                        FilterType="Custom,Numbers" TargetControlID="txtrechargedate" ValidChars="/">
                                    </cc1:FilteredTextBoxExtender>
                                    <cc1:CalendarExtender ID="txtrechargedate_CalendarExtender" runat="server" Enabled="True"
                                        TargetControlID="txtrechargedate" PopupPosition="BottomLeft">
                                    </cc1:CalendarExtender>
                                    <td class="tablealignment">
                                        <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" ControlToValidate="txtrechargedate"
                                            ErrorMessage="*" Font-Size="Small" ForeColor="#FF3300" ValidationGroup="process"></asp:RequiredFieldValidator>
                                        <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ErrorMessage="Please Enter Date In (MM/DD/YYYY) format"
                                            ControlToValidate="txtrechargedate" ForeColor="#FF3300" ValidationExpression="^((((0[13578])|([13578])|(1[02]))[\/](([1-9])|([0-2][0-9])|(3[01])))|(((0[469])|([469])|(11))[\/](([1-9])|([0-2][0-9])|(30)))|((2|02)[\/](([1-9])|([0-2][0-9]))))[\/]\d{4}$|^\d{4}$"
                                            ValidationGroup="process" Font-Size="Small"></asp:RegularExpressionValidator>
                                    </td>
                            </tr>
                            <tr>
                                <td class="tablevalidation">
                                    &nbsp;
                                </td>
                                <td class="auto-style5">
                                    <asp:Button ID="btnpopsubmit" runat="server" CssClass="buttonsubmit" Font-Size="Medium"
                                        Height="40px" OnClick="btnpopsubmit_Click" Text="Submit" ValidationGroup="process"
                                        Width="100px" />
                                </td>
                                <td>
                                </td>
                            </tr>
                        </table>
                    </ContentTemplate>
                </asp:UpdatePanel>
            </div>
            <%-- </div>--%>
        </asp:Panel>

I have tried all sorts of z-index but nothing seem to have worked i have changed z-index from 0 to 99999999

and nothing have changed and so i resorted to required field validators and watermark but pls help me to show that on top of modal popup and pls tell me if i am doing anything wrong

I have also tried this script but didint worked:

<script language="javascript" type="text/javascript">
         function onCalendarShown(sender,args)
         {  
             alert(sender._popupBehavior._element.style.tostring());
             sender._popupBehavior._element.style.zIndex=9999999;
             
         }
         </script>

as you can see the calender is shown behind the popup

pls help!!

</div>

Changed AjaxControlToolkit version and web application still expects previous version

$
0
0

We have a WebForms web project that used to use ASP.NET 4.0 but was using version 3.5.60623.0 of the Ajax Control Toolkit.  We recently changed the project to use ASP.NET 4.5 and swapped the AjaxControlToolkit with version 4.5.7.123.  I registered this assembly in the web.config, like this (no version specified):

<httpRuntime targetFramework="4.5" />
<pages controlRenderingCompatibilityVersion="4.0">
<controls>
<add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add tagPrefix="act" namespace="AjaxControlToolkit" assembly="AjaxControlToolkit" />
</controls>
</pages>

We have code that logs all unhandled exceptions in our application and I've been seeing several exceptions like this below:

Exception Type: System.IO.FileLoadException

Message: Could not load file or assembly 'AjaxControlToolkit, Version=3.5.60623.0, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

Source: mscorlib

Stack Trace:

at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean forIntrospection)
at System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
at System.Reflection.Assembly.Load(String assemblyString)
at AjaxControlToolkit.ToolkitScriptManager.ScriptEntry.LoadAssembly()
at AjaxControlToolkit.ToolkitScriptManager.DeserializeScriptEntries(String serializedScriptEntries, Boolean loaded)
at AjaxControlToolkit.ToolkitScriptManager.OutputCombinedScriptFile(HttpContext context)
at AjaxControlToolkit.ToolkitScriptManager.OnInit(EventArgs e)
at System.Web.UI.Control.InitRecursive(Control namingContainer)
at System.Web.UI.Control.InitRecursive(Control namingContainer)
at System.Web.UI.Control.InitRecursive(Control namingContainer)
at System.Web.UI.Control.InitRecursive(Control namingContainer)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

I've double-checked the project settings to make sure that the correct version is referenced and that there are no other referenced assemblies that use the old version of the AjaxControlToolkit.  What's odd is that I've browsed to the page and don't see this exception so I cannot replicate it.  I've gone through the code of the page in question, as well as the master page and any possible controls used within.  The master page contains a ToolkitScriptManager as opposed to a ScriptManager per the recommendations for this version and we are not accessing the ToolkitScriptManager in the code-behind.

Any idea what might be going on here?

How to show calender extender on top of modal popup extender?

$
0
0

I have used Ajax Modal popup extender for popup an the css for modal popup is as folows:

.modalBackground
{
    -webkit-border-radius: 12px 12px 23px 23px;
    border-radius: 12px 12px 23px 23px;
    -webkit-box-shadow: 12px 12px 12px 0 #946C10;
    box-shadow: 12px 12px 12px 0 #946C10;
    background-color: LightGrey;
    filter: alpha(opacity=80);
    opacity: 0.7;
    position:fixed; 
}

and the HTML for modal popup is as shown bellow:

<cc1:ModalPopupExtender ID="ModalPopupExtender1" runat="server" TargetControlID="btncomplains"
            PopupControlID="panelstatus" BackgroundCssClass="modalBackground" CancelControlID="ImageCancel1">
        </cc1:ModalPopupExtender>

<asp:Panel ID="panelstatus" GroupingText="Submit Details" BackColor="WhiteSmoke"
            Width="600px" runat="server" Style="border: thick solid #CCCCCC;">
            <div>
                <div align="right" style="padding: 2px; width: auto; height: 25px;">
                    <asp:Image ID="ImageCancel1" runat="server" ImageUrl="~/images/close2.png" CssClass="image_hover"
                        Width="25px" />
                </div>
                <asp:UpdatePanel ID="UpdatePanelpopup1" runat="server">
                    <ContentTemplate>
                        <table style="width: 580px">
                            <tr>
                                <td class="textalignment">
                                    <asp:Label ID="lblserialno" runat="server" Font-Bold="True" Text="Serial Number :"></asp:Label>
                                </td>
                                <td class="auto-style5">
                                    <asp:TextBox ID="txtserialno" runat="server" CssClass="textbox"></asp:TextBox>
                                </td>
                                <td class="tablealignmentcnlbtn">
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtserialno"
                                        ErrorMessage="Please Enter Serial No" ForeColor="#FF3300" ValidationGroup="process"
                                        Font-Size="Small"></asp:RequiredFieldValidator>
                                </td>
                            </tr>
                            <tr>
                                <td class="textalignment">
                                    <asp:Label ID="lblpinno" runat="server" Font-Bold="True" Text="Pin Number :"></asp:Label>
                                </td>
                                <td class="auto-style5">
                                    <asp:TextBox ID="txtpinno" runat="server" CssClass="textbox"></asp:TextBox>
                                </td>
                                <td class="tablealignment">
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtpinno"
                                        ErrorMessage="Please Enter Pin No" ForeColor="#FF3300" ValidationGroup="process"
                                        Font-Size="Small"></asp:RequiredFieldValidator>
                                </td>
                            </tr>
                            <tr>
                                <td class="textalignment">
                                    <asp:Label ID="lbltransactionid" runat="server" Font-Bold="True" Text="Transaction ID :"></asp:Label>
                                </td>
                                <td class="auto-style5">
                                    <asp:TextBox ID="txttransactionid" runat="server" CssClass="textbox"></asp:TextBox>
                                </td>
                                <td>
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="txttransactionid"
                                        ErrorMessage="Please Enter TransactionId" ForeColor="#FF3300" ValidationGroup="process"
                                        Font-Size="Small"></asp:RequiredFieldValidator>
                                </td>
                            </tr>
                            <tr>
                                <td class="textalignment">
                                    <asp:Label ID="lblrechargedate" runat="server" Font-Bold="True" Text="Recharge Date :"></asp:Label>
                                </td>
                                <td class="auto-style5">
                                    <asp:TextBox ID="txtrechargedate" runat="server" CssClass="textbox"></asp:TextBox>
                                    <cc1:TextBoxWatermarkExtender ID="txtrechargedate_TextBoxWatermarkExtender" runat="server" TargetControlID="txtrechargedate"   WatermarkText="MM/DD/YYYY" WatermarkCssClass="watermark">
                                    </cc1:TextBoxWatermarkExtender>
                                    <cc1:FilteredTextBoxExtender ID="txtrechargedate_FilteredTextBoxExtender" runat="server"
                                        FilterType="Custom,Numbers" TargetControlID="txtrechargedate" ValidChars="/">
                                    </cc1:FilteredTextBoxExtender>
                                    <cc1:CalendarExtender ID="txtrechargedate_CalendarExtender" runat="server" Enabled="True"
                                        TargetControlID="txtrechargedate" PopupPosition="BottomLeft">
                                    </cc1:CalendarExtender>
                                    <td class="tablealignment">
                                        <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" ControlToValidate="txtrechargedate"
                                            ErrorMessage="*" Font-Size="Small" ForeColor="#FF3300" ValidationGroup="process"></asp:RequiredFieldValidator>
                                        <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ErrorMessage="Please Enter Date In (MM/DD/YYYY) format"
                                            ControlToValidate="txtrechargedate" ForeColor="#FF3300" ValidationExpression="^((((0[13578])|([13578])|(1[02]))[\/](([1-9])|([0-2][0-9])|(3[01])))|(((0[469])|([469])|(11))[\/](([1-9])|([0-2][0-9])|(30)))|((2|02)[\/](([1-9])|([0-2][0-9]))))[\/]\d{4}$|^\d{4}$"
                                            ValidationGroup="process" Font-Size="Small"></asp:RegularExpressionValidator>
                                    </td>
                            </tr>
                            <tr>
                                <td class="tablevalidation">
                                    &nbsp;
                                </td>
                                <td class="auto-style5">
                                    <asp:Button ID="btnpopsubmit" runat="server" CssClass="buttonsubmit" Font-Size="Medium"
                                        Height="40px" OnClick="btnpopsubmit_Click" Text="Submit" ValidationGroup="process"
                                        Width="100px" />
                                </td>
                                <td>
                                </td>
                            </tr>
                        </table>
                    </ContentTemplate>
                </asp:UpdatePanel>
            </div>
            <%-- </div>--%>
        </asp:Panel>

I have tried all sorts of z-index but nothing seem to have worked i have changed z-index from 0 to 99999999

and nothing have changed and so i resorted to required field validators and watermark but pls help me to show that on top of modal popup and pls tell me if i am doing anything wrong

I have also tried this script but didint worked:

<script language="javascript" type="text/javascript">
         function onCalendarShown(sender,args)
         {  
             alert(sender._popupBehavior._element.style.tostring());
             sender._popupBehavior._element.style.zIndex=9999999;
             
         }
         </script>

pls help!!

Css not working after putting code inside TabPanel in TabContainer

$
0
0

I have a aspx page with c# codebehind that references a Css that uses # tags to identify <div>'s on the page and position them and apply style elements to them.  I downloaded the ajax toolkit and got it working (love it) and am using a TabContainer containing TabPanels containing ContentTemplates to organize the page navigation.  Unhappily when the <div>'s with the content (gridviews, detailviews, buttons and labels) are displayed within the TabPanels they show up in the order they are arranged in on the aspx page rather than where the Css should be positioning them.

Can someone kindly explain what's going on and how I can make it work?  Any help much appreciated, Thanks Tonnes, Roscoe


Asp.net controls after UpdateProgress - sometimes works, sometimes not

$
0
0

Hi there,

I meet the issue that  Asp.net controls which should show after the updateprogress finished are sometimes shown, some times not!
Asp.net 4.5.1 / c# / IIS 7.5 / IE10

Flow:

- The user is filling a form and submitting the data via a lablebutton.
- An UpdateProgress is shown
-- Some c# code is launched to handle things in backround
-- A logfile is updated
- A table within a (<p> tag, which is hidden on startup) displays the result of the c# operations ( -- that does not work always -- )

Frontend:

  ...<p></p><h2>Last step:</h2><p></p><p>                 <span class="labelcnt"><asp:LinkButton ID="lbtnCreateUser" runat="server" ClientIDMode="Static" EnableViewState="False" CausesValidation="True" OnClick="lbtnCreateUser_Click">&rsaquo;&rsaquo;&nbsp;Create User.</asp:LinkButton></span>                               </p>           <p runat="server" id="AppFeedbackUI" visible="false"> <h2>Result:</h2><br /><asp:Label ID="lblAppFeedback" runat="server"></asp:Label>                                        <span class="labelcnt" title="Click to emtpy the fields and create a new user."><asp:LinkButton ID="lbtnRestartApp" runat="server" ClientIDMode="Static" EnableViewState="False" CausesValidation="false" OnClick="lbtnRestartApp_Click">&rsaquo;&rsaquo;&nbsp;Restart.</asp:LinkButton></span>                        </p></ContentTemplate></asp:UpdatePanel><asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="UpdatePanelusr"><ProgressTemplate><div class="PleaseWait">
                Working, one moment ...</div></ProgressTemplate></asp:UpdateProgress>      </asp:Content>

 

-------------------------------------------------------------------------------------------------------------------------------------------------------------------
Update on 2015-01-23 (11:00 AM, GMT+8)

As testing purpose I have replaced the

<p runat="server" id="AppFeedbackUI" visible="false"> 

against

<asp:Panel runat="server" id="AppFeedbackUI" visible="false" ClientIDMode="Static" EnableViewState="False">

The result is the same - sometimes it works, sometimes not.
-------------------------------------------------------------------------------------------------------------------------------------------------------------------

 


Backend:

            UpdateLog(adobj, retvalad, objContentMsgad);                      
            AppFeedbackUI.Visible = true;
            string appfeedback = "";

            foreach (var pair in AppFeedback)                            
                appfeedback += "<tr><td>" + pair.Key + "</td><td>" + pair.Value + "</td></tr>";

            string tblcss = "rslttablegood";
            if (appfeedback.Contains("not") || appfeedback.Contains("Not"))            
                tblcss = "rslttablesoso";
            if (appfeedback.Contains("xception") || appfeedback.Contains("code line"))            
                tblcss = "rslttablebad";                            
            lblAppFeedback.Text = "<table class=" + tblcss + ">" + appfeedback + "</table>";         

Many thanks for your suggestions!!

Ruben

Ajax with multiple panels

$
0
0

 Hello:

For example: I have a Students.aspx page using Ajax with 3 different panels like below and each panel contains different code. I have a main page that have links to Students.aspx page and I have set the property Visible=True to panel 1. My question is How do I make so that when clicked on Student 1 from the Main.aspx, it will call panel1 and when clicked on Student 2 from the Main.aspx, it will call panel2...etc...Thank you.

Students.aspx

<ajax:Update Panel ID="studentUpdatePanel" runat="server" UpdateMode="Conditional">  

<ContentTemplate>

      <asp:Panel ID="panel1" runat="server" Visible="true">Code for student 1</asp:panel>    

     <asp:Panel ID="panel2" runat="server" Visible="false">Code for student 2</asp:panel>    

     <asp:Panel ID="panel3" runat="server" Visible="false">Code for student 3</asp:panel>

 </ContentTemplate>

</ajax:UpdatePanel>

--------------------------------------------------------------

Main.aspx

<a href="Students.aspx">Student 1</a>

<a href="Students.aspx">Student 2</a>

<a href="Students.aspx">Student 3</a>

Could not load file or assembly 'AjaxControlToolkit' or one of its dependencies. The parameter is incorrect.

$
0
0

The problem occurred after I had to restart my computer because it froze

So far I did Disc cleanup, but didn't help.

This is the stack trace:

[FileLoadException: Could not load file or assembly 'AjaxControlToolkit' or one of its dependencies. The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))]

[FileLoadException: Could not load file or assembly 'AjaxControlToolkit, Version=4.1.7.1213, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e' or one of its dependencies. The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))]
   System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +0
   System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +34
   System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +152
   System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean forIntrospection) +77
   System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +16
   System.Reflection.Assembly.Load(String assemblyString) +28
   System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +38

[ConfigurationErrorsException: Could not load file or assembly 'AjaxControlToolkit, Version=4.1.7.1213, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e' or one of its dependencies. The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))]
   System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +736
   System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +217
   System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai) +130
   System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +170
   System.Web.Compilation.BuildManager.GetPreStartInitMethodsFromReferencedAssemblies() +91
   System.Web.Compilation.BuildManager.CallPreStartInitMethods(String preStartInitListPath, Boolean& isRefAssemblyLoaded) +284
   System.Web.Compilation.BuildManager.ExecutePreAppStart() +153
   System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +521

[HttpException (0x80004005): Could not load file or assembly 'AjaxControlToolkit, Version=4.1.7.1213, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e' or one of its dependencies. The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))]
   System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +9955652
   System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +101
   System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +254

ASP.Net 4.5 Validation Controls not working with AJAX ToolkitScriptManager1

$
0
0

All,

I have a project in which I am using the 'unobtrusive.....' validation so it includes the references to all the JScript libraries in the global.asax. I also have pages that utilize the ASP.Net Validation controls and summary. For some reason I cannot get the validation controls to work correctly. Below is a summary of my challengers:

1. The first time the page loads, on the client side, when tabbing out of a field that has a required field validator attached to it, the "text" assigned to the validator does not display

2. If I click the submit button, the "text" associated with the required field validator now displays but I don't get the pop-up window from my validation summary.

3. If I then enter text in the text boxes that have required field validators assigned, the "text" assigned will not disappear until I click on the submit button.

My ASPX page code is below and I have nothing in my code behind.  I have also tried with the script manager inside and outside the update panel.  Any assistance would be greatly appreciated.  

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="test1.aspx.vb" Inherits="test1" %><%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %><!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml"><head runat="server"><title></title></head><body><form id="form1" runat="server"><asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server" ></asp:ToolkitScriptManager><asp:UpdatePanel ID="UpdatePanel1" runat="server"><ContentTemplate><div><asp:Label ID="Label1" runat="server" Text="Label"></asp:Label><asp:TextBox ID="TextBox1" runat="server"></asp:TextBox><asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="TextBox1" ErrorMessage="RequiredFieldValidator" ValidationGroup="contentgroup">*</asp:RequiredFieldValidator><br /><asp:Label ID="Label2" runat="server" Text="Label"></asp:Label><asp:TextBox ID="TextBox2" runat="server"></asp:TextBox><asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="TextBox2" ErrorMessage="RequiredFieldValidator"  ValidationGroup="contentgroup">*</asp:RequiredFieldValidator><br /><asp:Button ID="Button1" runat="server" Text="Button" ValidationGroup="contentgroup" /><asp:ValidationSummary ID="ValidationSummary1" runat="server" ValidationGroup="contentgroup" ShowMessageBox="True" ShowSummary="False" /></div></ContentTemplate></asp:UpdatePanel></form></body></html>

For some reason, when I create a webmethod, it doesn't run initially. If I just let the computer sit and then try it an hour later it works. What is going on?

$
0
0

I have WebMethods that work, but not initially. I have to let the computer just sit for a couple of hours, and then they work. I have cleared out the cache in temporary files, and at a total loss as to what to do. Any ideas?

Viewing all 5678 articles
Browse latest View live




Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>
<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596344.js" async> </script>