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

June 2013 AjaxControlToolKit Issue with MaskedEditExtender

$
0
0

I just recently downloaded the June 2013 version of the toolkit. Now validation of any field that uses a MaskedEditExtender no longer works in my application.  This would be specifically for zip and phone number masks.   The code worked fine with a previous version of the toolkit v 3.5.50927.0 that we were utilizing.   I have tried using both dlls 4.1.7.607 and 3.5.7.0607 for the most recent release and get the same result.   I'm using VS 2010.   I have also tried using the MaskedEditValidator instead of the regular expression and get the same result.  Using zip code as an example for discussion,  I always receive the error message from the reg expression validator regardless of whether or not the data entered is valid.   99999 zip entry now fails as well as 99999-9999.   I am seeing the same type result for my phone number validation using masked edit  "999-999-9999" where valid values are failing.  When I remove the MaskedEditExtender from my page, the validation works.

Has anyone else encountered this issue and what was the workaround?   Is there something different I need to do to get the code to work correctly with the newer version of the toolkit?   This version has fixed another issue i was having with AsyncFileUpload.  

As an example, my code for Zip code that no longer works with the newer version:

<asp:TextBoxID="txtZip"runat="server"CssClass="FormField"Width="75px"></asp:TextBox>

<asp:RequiredFieldValidatorID="rfvZip"runat="server"SetFocusOnError="true"ControlToValidate="txtZip"ErrorMessage="Zip is required"ValidationGroup="ValidateInstitution"></asp:RequiredFieldValidator>

<ajax:MaskedEditExtenderID="meeZip"runat="server"Mask="99999-9999"TargetControlID="txtZip"MessageValidatorTip="true"MaskType="None"ClearMaskOnLostFocus="true"/>

<asp:RegularExpressionValidatorID="revZip"runat="server"ControlToValidate="txtZip"SetFocusOnError="true"ErrorMessage="Please enter a valid zip."ValidationExpression="^[0-9]{5}([- /]?[0-9]{4})?$" ValidationGroup="ValidateInstitution"></asp:RegularExpressionValidator>

 


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>

Htmleditor breaks some characters

$
0
0

Hello,

Can anyone tell me how to fix the following "feature" of Htmleditor:

1. Go to Htmleditor demo http://www.asp.net/ajax/ajaxcontroltoolkit/samples/htmleditor/htmleditor.aspx
2. Type "æøåąčęėįšųūžвьпаджфк" or something more or less weird there
3. Press Submit button
Result: First free letters (danish) are replaced with question marks, all other letters (lithuanian and russian) remains as they should.

What's wrong with danish letters and can it be fixed without replacing such letters with html escape sequences?

AutoCompleteExtender: Need to use the connection string in Web.config to populate data for GetCompletionList

$
0
0

Hey guys,

I've got a project with several text boxes for searching client names from a database. I want to use the AutoCompleteExtender control to populate search guess as the user types.

I have the script manager in place as well as my AutoCompleteExtender. I have also set a page method, as to configure data for the results list. I am stuck here. I have set an SQL query to get data from a table and a colum within the table. Somehow, I dont think I should be using the System.Data.SqlClient; namespace. I am using Sql compact edition and I already have a ConnectionString in my Web.config file.

How can I utilize my existing connection string(web.config), rather than using System.Data.SqlClient;? Or if I use a connection manager, how can I set it to look at my compact edition database?

ASP:

<ajaxToolkit:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server"></ajaxToolkit:ToolkitScriptManager>
        Remote Administration</h1><strong><p>Client Search:</p></strong><asp:TextBox ID="ClientSearch" runat="Server" Width="227px"></asp:TextBox><ajaxToolkit:AutoCompleteExtender ID="AutoCompleteExtender1" TargetControlID="ClientSearch" runat="server" ServiceMethod="GetCompletionList" UseContextKey="True"></ajaxToolkit:AutoCompleteExtender><asp:Button ID="SearchSubmit" runat="Server" Text="Search" />

Code Behind (C#):

using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }

    [System.Web.Services.WebMethodAttribute(), System.Web.Script.Services.ScriptMethodAttribute()]
    public static string[] GetCompletionList(string prefixText, int count, string contextKey)
    {
        string connectionString = ConfigurationManager.ConnectionStrings["TestConnection"].ConnectionString; 
        SqlConnection conn = new SqlConnection(connectionString); 
        SqlCommand cmd = new SqlCommand("SELECT TOP " + count + " columnname FROM tablename WHERE columnname LIKE '" + prefixText + "%'", conn); 
        SqlDataReader oReader; conn.Open(); 
        List<string> CompletionSet = new List<string>(); 
        oReader = cmd.ExecuteReader(CommandBehavior.CloseConnection); 
        while (oReader.Read()) CompletionSet.Add(oReader["columnname"].ToString()); 
        return CompletionSet.ToArray();
    }
}

Web.config:

<connectionStrings><add name="ConnectionString" connectionString="Data Source=|DataDirectory|\Clients.sdf" providerName="System.Data.SqlServerCe.4.0" /><add name="ClientsEntities" connectionString="metadata=res://*/App_Code.Model.csdl|res://*/App_Code.Model.ssdl|res://*/App_Code.Model.msl;provider=System.Data.SqlServerCe.4.0;provider connection string=&quot;data source=|DataDirectory|\Clients.sdf&quot;" providerName="System.Data.EntityClient" /></connectionStrings>




UpdateProgress does not hiding

$
0
0

I've a UpdateProgress in a page and a LinkButton in UpdatePanel. Now when I click on LinkButton it UP appears but never hides even postback is done. However its working good in other web pages. Any idea ?

Slider control JavaScript runtime error: Sys.ArgumentOutOfRangeException: Value must be an integer.

$
0
0

Downloaded the Ajax ControlKit version 4.1.5116.0 and added to VS2010 Toolbar. Using MS IE10.

Got a simple control working but when sliding the slider the following error keeps popping up:

JavaScript runtime error: Sys.ArgumentOutOfRangeException: Value must be an integer. Parameter name: y Actual value was 148.04762268066406.

Copied and ran the example from: http://www.asp.net/ajaxlibrary/HOW%20TO%20Use%20the%20Slider%20Control.ashx

Same Result! :-(

I think that it has something to setting the vertical and horizontal handles but I dont know styles and javascript well enough.

I've cheked this forum and can't see an answer.

Please help.

Found a workaround: http://forums.asp.net/t/1884400.aspx/1?IE+10+Issue+SCRIPT5022+Sys+ArgumentOutOfRangeException+Value+must+be+an+integer+Parameter+name+x

From this workaround I inserted

<metahttp-equiv="X-UA-Compatible"content="IE=7"/> in the HeadContent of my aspx page. All the sliders work.

Internal server error in jquery /json webmethod

$
0
0

Here am calling a web method on click event. but am getting the error as inernal server error. here am calling this click event from dynamically created button . here i want to fire any one method.

page method is not firing.but ajax method is returning above error. in this page there r other 2 pagemethods r there. the other pagemethods r firing but this page method is not firing.

 <script type="text/javascript">
       $(document).ready(function () {
           $('#contaner_wrapper').css("height", "100%");
           $(document).on('click', '.fc-button-prev a span', function () {                
            //alert($("#calendar").fullCalendar('getView').start.toString());
               var abc = $("#calendar").fullCalendar('getView').start.toString();
               var ab = $("#calendar").fullCalendar('getView').end.toString();
//               PageMethods.EventDetails('E72', onSucess, onError);
//               PageMethods.Displaymonthevents('E72', onSucess, onError);
               $.ajax({
                   url: '/ViewEvents.aspx/Displaymonthevents',
                   type: 'POST',
                   data: 'hi',
                   contentType: 'application/json; charset=utf-8',
                   dataType: 'json',
                   async: false,
                   success: function (data) {
                       alert(data.d);
                   },
                   error: function (XMLHttpRequest, textStatus, errorThrown) {
                       alert(errorThrown);
                   }
                          });
               function OnSuccess(r) {
                    alert(r);
                   }
               function OnFailure(r) {
                   alert(r._message);
               }    
           });
           $(document).on('click', '.fc-button-next a span', function () {
               // Displaymonthevents();                 
               alert($("#calendar").fullCalendar('getView').start.toString());
               var abc = $("#calendar").fullCalendar('getView').start.toString();
               var ab = $("#calendar").fullCalendar('getView').end.toString();
               jQuery.ajax({
                   url: "ViewEvents.aspx/EventDetails",
                   type: "POST",
                   data: "hi",
                   contentType: "application/json; charset=utf-8",
                   dataType: "json",
                   success: function (data) {
                       alert(data.d);
                   }
               });
           });

           $(".fc-button-prev a span").trigger('click');
           $(".fc-button-next a span").trigger('click');
       });
         
    </script>

c#

 [System.Web.Services.WebMethod(EnableSession = true)]
        public static List<Events> Displaymonthevents(string eventdata1)
        {
            List<Events> events;

            BEvents obj = new BEvents();
            obj.ClubKey = (int)HttpContext.Current.Session["Ckey"];
            DataTable DT = obj.View();
{..........}
            return events;
        }
      

Upgrade to Ajax Toolkit 2013: AjaxControlToolkit' is undefined

$
0
0

I upgraded from an earlier version Ajax toolkit AjaxControlToolkit.dll (3/33/2012 date) to the new Version  dll date 6/15/2012. Most everything in the site seems to run OK except I gte  this error:

Microsoft JScript runtime error: 'AjaxControlToolkit' is undefined on this line

Hero.Common.Controls.ModalPopupBehavior.registerClass('Hero.Common.Controls.ModalPopupBehavior', AjaxControlToolkit.ModalPopupBehavior);

If I put the old version back the error goes away. What did I miss?

Thanks


get return value of ajax and put it into a popup div

$
0
0

hi all..i have a problem and that is. 

in a on clientclick event i send some data to a ajax function .and i get the desire data from webmethod.my code is hear.

//onclick event<asp:TemplateField ItemStyle-CssClass="hr" ><ItemTemplate><asp:LinkButton ID="lnktittle" OnClientClick='<%# string.Format("javascript:return showpopup(\"{0}\")", Eval("PostId")) %>' Text='<%# Eval("Tittle") %>' CssClass="post_tittle" runat="server"></asp:LinkButton></ItemTemplate><HeaderStyle HorizontalAlign="Left" /></asp:TemplateField>

my ajax function:

function showpopup(PostId)
                {
                    alert(PostId);$.ajax({
                        type: "POST",
                        url: "viewprojectdetails.aspx/getdatafromgridview",
                        data: '{PostId: "' + PostId + '" }',
                        contentType: "application/json; charset=utf-8",
                        dataType: "json",
                        success: function (r) { 

                        }

                    }); 
               
                }

my web method:

 [WebMethod]
  public static postpagemass getdatafromgridview(string PostId)
  {
      postpagemass objpost = new postpagemass(conection.ConnectionString);
      objpost.GetRowfrompost(Convert.ToInt32(PostId));


      return objpost;
  }

hear i return a single object ..Now i want to show my data into a popup my popup div is.

<div class="postdiv" id="postbackgroundpopup"><div id="postmanuepopup" class="displaypostdetails"><asp:HiddenField ID="hdid" runat="server" /><div class="postpopupdetailsdiv"><div class="displayparentpostleft"><asp:Label ID="lblshowtittle" runat="server" ></asp:Label><br/>
  Posted By <asp:Label ID="lblshowusername" runat="server"></asp:Label> 
 on<asp:Label ID="lblshowpost_date" runat="server"></asp:Label><br/>
 Discussion are hear:-<asp:Label ID="lblbody" runat="server"></asp:Label></div><div class="displayparentpostright"><a href="#" class="editpost">Edit</a><br/><hr/><a href="#" class="editpost">Delete</a></div></div>

i want to sjow my data in this lable and show the popup div...but i dont know how to write the code in javascript...

thanks to replay...




Linking two Autocompletes

$
0
0

Hi there,

Having a problem with linking two autocompletes, they are ajax controls.

They are designed to look up a surname first and then a forename, depending on the surname.

The first looks like this and works fine (surname):

Imports System.Web.Services
Imports System.Web.Services.Protocols
Imports System.ComponentModel
Imports System.Data.SqlClient
Imports System.Collections.Generic
Imports Oracle.DataAccess.Client<System.Web.Script.Services.ScriptService()> _<System.Web.Services.WebService(Namespace:="http://tempuri.org/")> _<System.Web.Services.WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _<ToolboxItem(False)> _
Public Class autocomp
    Inherits System.Web.Services.WebService<WebMethod()> _
    Public Function SearchCustomers(ByVal prefixText As String, ByVal count As Integer) As List(Of String)
        Dim myOraCon As OracleConnection
        myOraCon = New OracleConnection
        myOraCon.ConnectionString = ConfigurationManager.ConnectionStrings("OracleConnectionString").ConnectionString
        Dim cmd As New OracleCommand
        cmd.Connection = myOraCon
        cmd.CommandType = CommandType.Text
        cmd.CommandText = "SELECT DISTINCT SURNAME FROM table_name WHERE SURNAME LIKE :SearchText || '%'"
        cmd.Parameters.Add(":SearchText", OracleDbType.NVarchar2).Value = prefixText
        myOraCon.Open()
        Dim customers As List(Of String) = New List(Of String)
        Dim sdr As OracleDataReader = cmd.ExecuteReader
        While sdr.Read
            customers.Add(sdr("SURNAME").ToString)
        End While
        myOraCon.Close()
        myOraCon.Dispose()
        Return customers
    End Function
End Class

So as I said the above works and only displays the surname in one text, the users hits fetch and a new textbox is displayed for the forenames to appear. The page is also refreshed and the surname sent as part of a URL query string, i.e ?surname=jones etc

The avaliable forenames should be picked up from the code below using the text from the URL query string. 

Imports System.Web.Services
Imports System.Web.Services.Protocols
Imports System.ComponentModel
Imports System.Data.SqlClient
Imports System.Collections.Generic
Imports Oracle.DataAccess.Client<System.Web.Script.Services.ScriptService()> _<System.Web.Services.WebService(Namespace:="http://tempuri.org/")> _<System.Web.Services.WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _<ToolboxItem(False)> _
Public Class autocomp2
    Inherits System.Web.Services.WebService<WebMethod()> _
    Public Function SearchCustomers2(ByVal prefixText As String, ByVal count As Integer) As List(Of String)
        Dim surname As String

        surname = HttpContext.Current.Request.UrlReferrer.Query

        Dim equals_index = surname.IndexOf("=")

        Dim length_of_surname As Integer = (surname.Length - 1) - equals_index

        surname = surname.Substring(equals_index + 1, length_of_surname)

        Dim myOraCon As OracleConnection
        myOraCon = New OracleConnection
        myOraCon.ConnectionString = ConfigurationManager.ConnectionStrings("OracleConnectionString").ConnectionString
        Dim cmd As New OracleCommand
        cmd.Connection = myOraCon
        cmd.CommandType = CommandType.Text
        'cmd.CommandText = "SELECT FORENAME FROM table_name WHERE SURNAME like 'Cook%' order by 1"
        cmd.CommandText = "SELECT FORENAME FROM table_name WHERE FORENAME LIKE :SearchText || '%' AND SURNAME = :surname || '%'"
        cmd.Parameters.Add(":SearchText", OracleDbType.NVarchar2).Value = prefixText
        cmd.Parameters.Add(":surname", OracleDbType.NVarchar2).Value = surname
        myOraCon.Open()
        Dim customers As List(Of String) = New List(Of String)
        Dim sdr As OracleDataReader = cmd.ExecuteReader
        While sdr.Read
            customers.Add(sdr("FORENAME").ToString)
        End While
        myOraCon.Close()
        myOraCon.Dispose()
        Return customers
    End Function
End Class

I have inspected my code and the sql appears correct, the surname appears there when I look at it. Just not sure why no results are being displayed in the forename box.

Any one got any ideas? . . .





autocomplete extender, not replacing first word

$
0
0

when the user types in two words, every suggestion works correctly...

the problem is when the user begins typing the 2nd word and selects the autocomplete suggestion, then it replaces the 2nd word with the suggestion, but leaves the first word.

for example:

How can I fix this?

Ajax Calender Extender

$
0
0

I add an Ajax Calender Extender on my page, when clicking the next/previous button it works correctly on Chrome an display the next/previous month,but on IE it displays a list of months.

is there any customisation to add to avoid this strange behavior on IE?

thanks.

Why I can't hide the UpdateProgress control

$
0
0

I am trying to turn the UpdateProgress1 control to be invisible but I can't. I need to hide because I want to stop showing theUpdateProgress content which is here a <div id="Div1"> that shows a PleaseWait animate image. My code is as follow

<%@ Page Title="" Language="VB" MasterPageFile="~/MasterPages/MasterPage.master" AutoEventWireup="false" CodeFile="LogonScreen.aspx.vb" Inherits="Logon_LogonScreen" %><asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server"><style type="text/css">
        .style1
        {
            width: 100%;
        }
        .style3
        {
            width: 188px;
        }
        .style4
        {
        }
        .style5
        {
            width: 170px;
        }
        .style6
        {
            height: 31px;
        }
        .ErrorMessage
        {
            color: #0000AE;
            text-align: right;
            margin-top: 19px;
            font-family: "Sakkal Majalla";
            font-style: normal;
            font-size: 24px;
        }
        .style10
        {
            width: 29px;
        }
        .style11
        {
            height: 31px;
            width: 29px;
        }
        .style12
        {
            width: 24px;
        }
        .style13
        {
            height: 31px;
            width: 24px;
        }
        .PleaseWait
        {
            background-position:center;
            background-image: url('../Images/PleaseWait.gif');
            background-repeat: no-repeat;
            height: 54px;
        }</style></asp:Content><asp:Content ID="Content2" ContentPlaceHolderID="CpMainContent" Runat="Server"><asp:UpdatePanel ID="UpdatePanel1" runat="server"><ContentTemplate><table class="style1"><tr><td class="style10">&nbsp;</td><td>&nbsp;</td><td class="style12">&nbsp;</td><td class="style4">&nbsp;</td><td class="style5">&nbsp;</td><td class="style3">&nbsp;</td><td>&nbsp;</td></tr><tr><td class="style10">&nbsp;</td><td>&nbsp;</td><td class="style12">&nbsp;</td><td class="style4">&nbsp;</td><td class="style5">&nbsp;</td><td class="style3">&nbsp;</td><td>&nbsp;</td></tr><tr><td class="style10">&nbsp;</td><td>&nbsp;</td><td class="style12"><asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
                    ControlToValidate="UserName" Display="Dynamic"
                    ErrorMessage="أدخل إسم المستخدم" CssClass="ErrorMessage">*</asp:RequiredFieldValidator></td><td class="style4">&nbsp;</td><td class="style5"><asp:TextBox ID="UserName" runat="server" BorderColor="Black"
                    BorderStyle="Solid" Height="30px" style="margin-top: 0px" Width="162px"></asp:TextBox></td><td class="style3"><asp:Label ID="Label1" runat="server"
                    style="text-align: right; font-size: x-large; font-family: 'Sakkal Majalla'"
                    Text="إسم المستخدم" Width="180px" BackColor="#6262FF"
                    BorderColor="Black" BorderStyle="Solid" BorderWidth="1px"
                    ForeColor="White"></asp:Label></td><td>&nbsp;</td></tr><tr><td class="style10">&nbsp;</td><td>&nbsp;</td><td class="style12"><asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server"
                    ControlToValidate="UPassWord" Display="Dynamic"
                    ErrorMessage="أدخل كلمة المرور" CssClass="ErrorMessage">*</asp:RequiredFieldValidator></td><td class="style4">&nbsp;</td><td class="style5"><asp:TextBox ID="UPassWord" runat="server" BorderColor="Black"
                    BorderStyle="Solid" Height="30px" style="margin-top: 0px" Width="162px"
                    TextMode="Password"></asp:TextBox></td><td class="style3"><asp:Label ID="Label2" runat="server"
                    style="text-align: right; font-size: x-large; font-family: 'Sakkal Majalla'"
                    Text="كلمة السر" Width="180px" BackColor="#6262FF"
                    BorderColor="Black" BorderStyle="Solid" BorderWidth="1px"
                    ForeColor="White"></asp:Label></td><td>&nbsp;</td></tr><tr><td class="style10">&nbsp;</td><td>&nbsp;</td><td class="style12">&nbsp;</td><td class="style4">&nbsp;</td><td class="style5">&nbsp;</td><td class="style3">&nbsp;</td><td>&nbsp;</td></tr><tr><td class="style10">&nbsp;</td><td>&nbsp;</td><td class="style12">&nbsp;</td><td class="style4">&nbsp;</td><td class="style5">&nbsp;</td><td class="style3">&nbsp;</td><td>&nbsp;</td></tr><tr><td class="style10">&nbsp;</td><td>&nbsp;</td><td class="style12">&nbsp;</td><td class="style4">&nbsp;</td><td class="style5"><asp:Button ID="Logining" runat="server" BackColor="#42C1FF"
                    BorderStyle="Solid" Height="33px"
                    style="font-size: x-large; font-family: 'Sakkal Majalla'; margin-left: 12px"
                    Text="دخول" Width="132px" BorderWidth="2px" BorderColor="Black" /></td><td class="style3">&nbsp;</td><td>&nbsp;</td></tr><tr><td class="style10">&nbsp;</td><td>&nbsp;</td><td class="style12">&nbsp;</td><td class="style4" colspan="3" rowspan="2"><asp:ValidationSummary ID="ValidationSummary1" runat="server"
                    CssClass="ErrorMessage" HeaderText="صحح ما يلي" DisplayMode="List" /></td><td>&nbsp;</td></tr><tr><td class="style11">&nbsp;</td><td class="style6"></td><td class="style13"></td><td class="style6"></td></tr><tr><td class="style10">&nbsp;</td><td>&nbsp;</td><td class="style12">&nbsp;</td><td class="style4">&nbsp;</td><td class="style5">&nbsp;</td><td class="style3">&nbsp;</td><td>&nbsp;</td></tr><tr><td class="style10">&nbsp;</td><td>&nbsp;</td><td class="style12">&nbsp;</td><td class="style4">&nbsp;</td><td class="style5">&nbsp;</td><td class="style3">&nbsp;</td><td>&nbsp;</td></tr><tr><td class="style10">&nbsp;</td><td>&nbsp;</td><td class="style12">&nbsp;</td><td class="style4">&nbsp;</td><td class="style5">&nbsp;</td><td class="style3">&nbsp;</td><td>&nbsp;</td></tr></table></ContentTemplate></asp:UpdatePanel><asp:UpdateProgress ID="UpdateProgress1" runat="server"
    AssociatedUpdatePanelID="UpdatePanel1"><ProgressTemplate><div ID="Div1" runat="server" width="129px" class="PleaseWait"  ></div></ProgressTemplate></asp:UpdateProgress></asp:Content>

The aspx.vb code which contains the Logining button click event:

Protected Sub Logining_Click(sender As Object, e As System.EventArgs) Handles Logining.Click
        If Page.IsValid Then

            Dim conString = ConfigurationManager.ConnectionStrings("TrackingConnectionString").ConnectionString
            Dim connection As New SqlConnection(conString)

            If connection.State = ConnectionState.Closed Or connection.State = ConnectionState.Broken Then
                connection.Open()
            End If

            Dim queryString = "SELECT Passcode FROM Employees WHERE (UserName=@UN)"
            Dim LoginUserPwdSelectCommand As New SqlCommand(queryString, connection)
            LoginUserPwdSelectCommand.Parameters.Add("@UN", SqlDbType.NVarChar)
            LoginUserPwdSelectCommand.Parameters("@UN").Value = UserName.Text.Trim()
            Dim LoginUserPwd = LoginUserPwdSelectCommand.ExecuteScalar()
            TDClass.PassCode = LoginUserPwd

            System.Threading.Thread.Sleep(5000)

            If TDClass.PassCode <> UPassWord.Text Then
                UpdateProgress1.Visible = False
                MsgBox("إسم المستخدم و كلمة السر غير موجود ", MsgBoxStyle.Information, "Tracking Desk")
            Else
                Response.Redirect("~\ContentPages\SelecttheOffice.aspx")
            End If



            connection.Close()


        End If

    End Sub

Please assist with thanks

VS2012 cannot detect a control placed inside of an Accordion Content Template

$
0
0

Hi,

I have an ASP.NET Page that has two AJAX Accordion's on the page. Inside of the Accordion Template I have placed a button (or a label or a grid or anything) inside of the Content template.

My problem is that in my code-behind, the designer is not detecting the changes and regenerating my designer file.  I can place the same control outside of my accordion and the designer re-generates correctly.

Any ideas what is going on here?

<ajax:Accordion ID="accordionSubject" runat="server" SelectedIndex="0"
HeaderCssClass="accordionHeader" HeaderSelectedCssClass="accordionHeaderSelected"
ContentCssClass="accordionContent" FadeTransitions="false" FramesPerSecond="40"
OnItemDataBound="accordionSubject_ItemDataBound"
TransitionDuration="250" AutoSize="Fill" RequireOpenedPane="false" SuppressHeaderPostbacks="true">
<HeaderTemplate><b><%#DataBinder.Eval(Container.DataItem, "Name")%></b></HeaderTemplate>
<ContentTemplate>
<asp:Button ID="btnTest" runat="server" Text="Button" />
<br />
<table style="width:100%">
<tr>
<td>
<asp:GridView ID="gvSubjects" runat="server"
AutoGenerateColumns="True"
GridLines="None" Width="80%" CellPadding="5">

</asp:GridView>
</td>
</tr>
</table>
</ContentTemplate>
</ajax:Accordion>

Thanks - Greg.

Modal popup extender

$
0
0

I've never used the popup extender and I'm not sure how to set it up.

I have a timer and that can start, stop, and reset. I want to have a popup after 10 consecutive seconds have passed (or however long I want), where it will stop the timer and say: Continue timer?

<asp:UpdatePanel ID="UpdatePanel1" runat="server"><Triggers><asp:AsyncPostBackTrigger controlid="tm1" EventName="Tick"/></Triggers><ContentTemplate><asp:Timer ID="tm1" runat="server" Interval="1000" OnTick="tm1_Tick"></asp:Timer><div id="timer">&nbsp;&nbsp;&nbsp;<asp:Label ID="lblTimer" runat="server" Text="00 : 00" Font-Size="XX-Large" BackColor="#003399"></asp:Label><br /><br /><asp:Button ID="btnStart" runat="server" OnClick="btnStart_Click" Text="Start" /><br /><br /><asp:Button ID="btnReset" runat="server" OnClick="btnReset_Click" Text="Reset" /></div></ContentTemplate></asp:UpdatePanel>
    protected void tm1_Tick(object sender, EventArgs e)
    {
        long sec = sw.Elapsed.Seconds;
        long min = sw.Elapsed.Minutes;
        long hrs = sw.Elapsed.Hours;



            if (hrs < 10)
                lblTimer.Text = "0" + hrs;
            else
                lblTimer.Text = hrs.ToString();

            lblTimer.Text += " : ";

        
            if (min < 60)
            {
                if (min < 10)
                    lblTimer.Text = "0" + min;
                else
                    lblTimer.Text = min.ToString();

                lblTimer.Text += " : ";

                if (sec < 10)
                    lblTimer.Text += "0" + sec;
                else
                    lblTimer.Text += sec.ToString();
        }
        else
        {
            sw.Stop();
        }

    }





Ajax tab container in user control appears Error Rendering Control!

$
0
0

When using other ajax controls like accordian, editor in the user control(ascx), I'm able to to drag  the user control to a form to display the ajax control EXCEPT for tab container. i have included the script manager in the masterpage. i wonder why i get error rendering control?

ta

 

Image Disappear inside update panel when listview data is changed

$
0
0

Hello,

I am having web application in which I am usign a master inharited page containing Updatepanel, Inside this update panel I am showing a listview containing Image and other details. Whenever I delete or add new entry I am binding listview to show updated data. At this time all images reload again and gives a disappear appearence .

How Can I add or delete data to listiview without making any effect to Complete listview. The best example I seen is on gmail or facebook when you add new post or delete an post ,all previous data doesn't go for any type of disappearence . How can I get this effect.

how to add extra font-names and font sizes in html editor extender ?

$
0
0

Hi,

by default htlml editor extender shows only 8 fonts names inf font selector control, i want to add  "Segoe UI" font name and sizes in the dropdown. could any one tell me how can i achive this ?. is there any other way to do it.

Thanks,

Saravanan

How I can make to search in data of gridview?

$
0
0

Hi, 
I want to make search engine for my website. I added this codes. It is searching but if there isn't a data , it doesn't see any warring. Please look at the following codes: 

<input type="submit" value="SEARCH" />
<asp:TextBox type="search" runat="server" ID="text1" AutoCompleteType="Disabled" placeholder="Arama" value=""/></asp:textbox>
&nbsp;&nbsp;&nbsp;
<asp:RequiredFieldValidator
ID="RequiredFieldValidator1" runat="server"
ErrorMessage="ERROR !" BackColor="White"
ControlToValidate="text1" Font-Size="14px" ForeColor="Red"></asp:RequiredFieldValidator></form>
<asp:GridView ID="GridView1" AllowPaging="true" PageSize="20" runat="server"
onpageindexchanging="GridView1_PageIndexChanging">
</asp:GridView>


How i can provide to give a warring?

Regards... 

 

HtmlEditorExtender image upload error

$
0
0

hi

i'm using an ajax control toolkit HtmlEditorExtender for providing html dynamic page

but when i try to upload image in it upload erro occures

here is code

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %><%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="AjaxControlToolkit" %><%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit.HTMLEditor" TagPrefix="cc1" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head runat="server"><title></title></head><body><form id="form1" runat="server"><asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager><asp:TextBox ID="replyBody" runat="server" TextMode="MultiLine" Rows="10" Columns="30"/><AjaxToolkit:HtmlEditorExtender ID="replyBody_HtmlEditorExtender" TargetControlID="replyBody"
        DisplaySourceTab="true" OnImageUploadComplete="replyBody_HtmlEditorExtender_ImageUploadComplete"
        ClientIDMode="AutoID" EnableSanitization="true" runat="server"><Toolbar><AjaxToolkit:Undo /><AjaxToolkit:Redo /><AjaxToolkit:Bold /><AjaxToolkit:Italic /><AjaxToolkit:Underline /><AjaxToolkit:StrikeThrough /><AjaxToolkit:Subscript /><AjaxToolkit:Superscript /><AjaxToolkit:JustifyLeft /><AjaxToolkit:JustifyCenter /><AjaxToolkit:JustifyRight /><AjaxToolkit:JustifyFull /><AjaxToolkit:InsertOrderedList /><AjaxToolkit:InsertUnorderedList /><AjaxToolkit:CreateLink /><AjaxToolkit:UnLink /><AjaxToolkit:RemoveFormat /><AjaxToolkit:SelectAll /><AjaxToolkit:UnSelect /><AjaxToolkit:Delete /><AjaxToolkit:Cut /><AjaxToolkit:Copy /><AjaxToolkit:Paste /><AjaxToolkit:BackgroundColorSelector /><AjaxToolkit:ForeColorSelector /><AjaxToolkit:FontNameSelector /><AjaxToolkit:FontSizeSelector /><AjaxToolkit:Indent /><AjaxToolkit:Outdent /><AjaxToolkit:InsertHorizontalRule /><AjaxToolkit:HorizontalSeparator /><AjaxToolkit:InsertImage /></Toolbar></AjaxToolkit:HtmlEditorExtender></form></body></html>

and this is the code behind

using System;
using AjaxControlToolkit;


public partial class Default2 : System.Web.UI.Page
{
    protected void replyBody_HtmlEditorExtender_ImageUploadComplete(object sender, AjaxFileUploadEventArgs e)
    {
        string fullPath = "~/Images/Upload_test/" + e.FileName;
        replyBody_HtmlEditorExtender.AjaxFileUpload.SaveAs(Server.MapPath(fullPath));
        e.PostedUrl = fullPath;

    }
    protected void Page_Load(object sender, EventArgs e)
    {
       replyBody_HtmlEditorExtender.AjaxFileUpload.AllowedFileTypes = "jpg,jpeg";
    }
}

when i want to uload an image, this error occures

error

please help me

Viewing all 5678 articles
Browse latest View live


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