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

autocomplete extender not working

$
0
0

Hello,

I m trying to add autocomplete extender in code without using webservice i get the list but it not displaying in final result

My code is as Following

.aspx code----

<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Script_Master.aspx.cs" Inherits="ISHM.Admin.Script_Master" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<asp:ToolkitScriptManager ID="ToolkitScriptManager1" EnablePartialRendering="true"  EnablePageMethods="true"   runat="server">
</asp:ToolkitScriptManager>
<asp:TextBox ID="Txtsearch" runat="server" ></asp:TextBox>
    <asp:AutoCompleteExtender ID="Txtsearch_AutoCompleteExtender" runat="server"
        DelimiterCharacters="" Enabled="True"  MinimumPrefixLength="1" EnableCaching="true" CompletionSetCount="1" CompletionInterval="1000"
        TargetControlID="Txtsearch" ServiceMethod="getDetail"   UseContextKey="True">
    </asp:AutoCompleteExtender>
    <br />

   
</asp:Content>

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

aspx.cs code as------------

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

namespace ISHM.Admin
{
    public partial class Script_Master : System.Web.UI.Page
    {
        Query objQry1 = new Query();
        [System.Web.Services.WebMethod]
        [System.Web.Script.Services.ScriptMethod]
        //[System.Web.Script.Services.ScriptMethod()]
        //[System.Web.Services.WebMethod]
        public static List<string> getDetail(string prefixText, int count)
        
        {
            Query objQry = new Query();
            List<string> DetailList = new List<string>();
            DataTable Dt =objQry.GetScriptdetail();
            //DataView dv = new DataView();
            //dv = Dt.DefaultView;
            //dv.RowFilter = "ISINCODE like '%" + prefixText + "%' OR NSECODE like'%" + prefixText + "%' OR NAME like'%" + prefixText + "%'";
            //DataTable DT1 = dv.ToTable();
            for (int i = 0; i < Dt.Rows.Count; i++)
            {   
                DetailList.Add(Dt.Rows[i]["name"].ToString());
            }
            return DetailList;
        }
        protected void Page_Load(object sender, EventArgs e)
        {

        }


    }
}

please help me where is that problem..


Double-Click required to set focus to UserControl(s)

$
0
0

I have a form that has selectable tabs on the left, and a panel to the right that contains user controls.  The user controls are basically just forms.  The tab on the left basically controls which user control is visible at any time.  When I first log into the application, if I click a tab, it sets focus to the set of tabs then another click will select one.  I want the tabs to automatically have the ability to be clicked without first setting focus so the dynamic content works without this glitch.

In a nutshell, after logging into the application, I can see the correct panel on the right and the tab on the left for the first panel is active, however, the application requires a double-click to activate other tabs.  Once this is done the first time, the tabs work perfectly no matter what I do.

There appears to be some kind of activation or focus problem but I'm not sure what's going on.

Any ideas?

Thanks,

-D

UpdatePanel does not update when triggered by GridView

$
0
0

Hi,

I have a gridview in an updatepanel.  The updatepanel's updatemode is set to conditional.  I have a routine called GridView1_RowCommand that I associated with the gridview with the attribute OnRowCommand="GridView1_RowCommand."  In that command, I make a change to the datasource, rebind the gridview and call the updatepanel's update method to refresh that part of the page.

Nothing happens.  ChildrenAsTriggers is set to true.  I've stepped through the code and know that it is being executed from the edit command.

As a thought experiment, I created another button and pasted my code from the GridView1_RowCommand into it.  It triggers the update without any trouble.

I've tried specifying some triggers:

<Triggers>
                <asp:AsyncPostBackTrigger ControlID="GridView1" EventName="GridView1_RowCommand" />
</Triggers>

But the gridview still didn't update the panel.

The workaround I'm thinking of doing now is to create an invisible button with a click event and call that click event from within the routine associated with the GridView.  But this seems unnecessarily messy.  Is there something I'm overlooking here?

Thanks,

Ron

hover menu extender not showing up where it is supposed to be

$
0
0

Situation: I have made a navigation menu using div's and asp:LinkButtons. I would like to use the ajax toolkit to make a hover menu extender showing a panel underneath each div.

Problem: My hover menu works find when experementing but when I applied it to my div navigation menu it could only pop up outside the main div, floating on the right side. I tried applying the other forum posts but I think my problem might be CSS related, I'm not sure.

Question/profile: as my knowledge of ASP is purely from web tutorials I'd like to request to be pointed in to the right direction. Also if possible, it would be nice if somebody could show me with code how I can achieve my goal?

Ressources: !watchout I only included my master page because the default.aspx is empty for now

<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Site1.master.cs" Inherits="RafanovaWeb.Site1" %><%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %><!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml"><head runat="server"><title>Rafanova</title><link href="CSS/CssReset.css" rel="stylesheet" /><style type="text/css">
        body {
            text-align: center;
        }

        #wrapper {
            min-width: 1010px;
        }

        #main {
            width: 1000px;
            margin-left: auto;
            margin-right: auto;
            clear: both;
        }

        #top {
            clear: both;
        }

        #navigation {
            position: relative;
            clear: both;
        }
            #navigation p {
            color: #000 ;
            margin-left: 3px;
            margin-top: 20px;
            text-decoration: none;
        }

            .navButton {
            width: 160px;
            height: 53px;
            float: left;
            font-family: "myriad pro";
            text-align: left;
            position: relative;
        }
            .navFiller {
                width: 120px;
                height: 53px;
                float: left;
            }

        #middle {
            text-align: left;
            clear:both;
        }

        #footer {
            clear:both;
        }

        /* TEXT CONTROLER */
        p {
            font-family: 'Trebuchet MS';
        }

        h1 {
            font-family: 'Trebuchet MS';
        }

        /* EXTRA QUICK CLASSES*/

        .hyper {
            text-decoration: none;
        }

        /* Menu Css*/
        .navPanel {
            position: absolute;
            top: 0px;
            left: 0px;
            display: block;
            visibility: hidden;
            z-index: 1000;
        }
        .absolute {
            position:absolute;
        }
        #HoverMenuExtender1 {
            z-index: 1001;
        }

    </style><asp:ContentPlaceHolder ID="head" runat="server"></asp:ContentPlaceHolder></head><body><form id="form1" runat="server"><asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager><div id="wrapper"><div id="main"><div id="top"><div><p style="font-family: 'Edwardian Script ITC'; font-size: 80px; color: #72625A; text-align: left; margin-top: 15px;">Rafanova</p><hr /></div><div id="navigation"><asp:LinkButton runat="server" id="btnHome" href="default.aspx"><div class="navButton"><p>Home</p><hr /></div></asp:LinkButton><div class="navFiller"></div><asp:LinkButton runat="server" id="btnRapports" href="#"><div class="navButton"><p>Rapports</p><hr /></div></asp:LinkButton><div class="navFiller"></div><asp:LinkButton runat="server" id="btnData" href="#"><div class="navButton"><p>Data</p><hr /></div></asp:LinkButton><asp:HoverMenuExtender ID="HoverMenuExtender1" runat="server" TargetControlID="btnData" PopupControlID="PanelData" OffsetX="6" PopDelay="250" HoverCssClass=""  /><asp:Panel ID="PanelData" runat="server" CssClass="navPanel">
                        panel achieved</asp:Panel><div class="navFiller"></div><asp:LinkButton runat="server" id="btnInfo" href="#"><div class="navButton"><p>Info</p><hr /></div></asp:LinkButton></div><%-- stop top --%><div id="middle"><asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server"></asp:ContentPlaceHolder></div><%-- stop middle --%><div id="footer"></div><%-- stop footer --%></div><%-- stop Main --%></div><%-- stop wrapper --%></form></body></html>

!using visual studio 2012

Ajax AutoCompleteExtender .. Need to collect data from my SQL compact database.

$
0
0

Hello,

I've got an Ajax AutoCompleteExtender that I seem to be having trouble with. I followed a basic implementation tutorial..http://www.asp.net/ajaxlibrary/act_AutoComplete_Simple.ashx .. and I was able to populate the static string data from the code behind. I know the function is working properly. I just cannot seem to call the data from a database correctly.

I've got sqlDataSource controls on the same page I work with and they work to populate GridView controls. I just cannot seem to query my SQL compact database from the code behind. The syntax seems to be correct, according to intellisence but it simply does nothing when I start typing a search in target control.

Any Suggestions?

The control is registered in the Web.config file for all pages.

ASP for ToolkitScriptManager:

<ajaxToolkit:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server"></ajaxToolkit:ToolkitScriptManager>

ASP for AutoCompleteExtender:

<asp:TextBox ID="ClientSearch" runat="Server" Width="227px"></asp:TextBox><ajaxToolkit:AutoCompleteExtender
        CompletionListCssClass="AutoExtender"
        CompletionListItemCssClass="AutoExtenderListItem"
        CompletionListHighlightedItemCssClass="AutoExtenderItemHighlighted"
        ID="AutoCompleteExtender1"
        TargetControlID="ClientSearch"
        runat="server" 
        ServiceMethod="GetCompletionList" 
        MinimumPrefixLength="1"
        UseContextKey="True"></ajaxToolkit:AutoCompleteExtender><asp:Button ID="SearchSubmit" runat="Server" Text="Search" />

Below is were I'm stuck..I cannot seem to find a good method here to call the data from my SQL compact database...I do have a ConnectionString on the Web.config and I am able to get that same data with an SQLdatasource control..I just cannot get it with any of the code-behind methods I have tried from any tutorial..

Here is the page Code Behind (C#)

using System.Data;
using System.Data.SqlClient;
using System.Collections.Generic;
using System.Configuration;
using System;


public partial class _Default : System.Web.UI.Page

{
    protected void Page_Load(object sender, EventArgs e)
    {

    }

    [System.Web.Script.Services.ScriptMethod()]
    [System.Web.Services.WebMethod]
    public static List<string> GetCompletionList(string prefixText)
    {
        SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ToString());
        con.Open();
        SqlCommand cmd = new SqlCommand("select * from Current where Name like @Name+'%'", con);
        cmd.Parameters.AddWithValue("@Name", prefixText);
        SqlDataAdapter da = new SqlDataAdapter(cmd);
        DataTable dt = new DataTable();
        da.Fill(dt);
        List<string> Names = new List<string>();
        for (int i = 0; i < dt.Rows.Count; i++)
        {
            Names.Add(dt.Rows[i][1].ToString());
        }
        return Names;
    }


} 


Here is are my Connection Strings in the 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>

What am I doing wrong? I'm open to criticism. I'm a roast, baste me..



how do I insert an image thats on my site already into editor control

$
0
0

I am using the editor control, and I find that I can paste articles in, with images.  For instance, if I paste an article in from the "New York Post", the images appear, and the underlying link is to the Post photo, even if the article is now saved in my database (a sql server database) for future viewing on another webpage.

The problem is this - maybe one day the Post will take down the photo.  So its better to save the photo to my server, and refer to that version of the photo.  

But how do I do that?  I don't seem to be able to put a IMG SRC tag into the Editor.

Thanks,

P.S. (in reality I would not be posting proprietary articles from the Post, but I would be getting articles from various sources).

Updating slider position

$
0
0

The following snippet demonstrates a slider extender and link button I have that I want to work together:

<asp:ScriptManager ID="smTestSlider" runat="server"></asp:ScriptManager>

<script type="text/javascript">
var totalNumChapters = 100;

function navNextChapter() {
var txtChapter = document.getElementById("<%=txtChapter.ClientID%>");
var chKey = parseInt(txtChapter.value);

if (chKey < totalNumChapters) {
txtChapter.value = (chKey + 1).toString();
}

return false;
}
</script>

<asp:TextBox ID="txtChapter" runat="server" />
<ajaxToolkit:SliderExtender ID="seChapter" runat="server" EnableHandleAnimation="true" Length="280" Maximum="100" Minimum="1" RaiseChangeOnlyOnMouseUp="false" TargetControlID="txtChapter" />

<asp:LinkButton ID="lnkNextChapter" runat="server">
<asp:Image ID="imgNextChapter" runat="server" AlternateText="Next chapter" ToolTip="Next chapter" />
</asp:LinkButton>


Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load

Dim CurrScriptMgr As ScriptManager = ScriptManager.GetCurrent(Me.Page)
CurrScriptMgr.RegisterAsyncPostBackControl(txtChapter)

lnkNextChapter.Attributes.Add("onclick", "return navNextChapter();")

txtChapter.Text = "1"

End Sub

It's working as I wish except that the position of the slider is not updated or changed when I click on the link button. The value of txtChapter is changed properly by the JavaScript function, but the slider remains unchanged. How do I update the position of the slider when the text value changes? I thought it should happen automatically.

Using Editor to support Spanish characters?

$
0
0

I recently switched from freetextbox to the built in Ajax editor because of issues ftb had with update panels.  The Ajax editor works great except for one problem, it messes up my spanish characters.  For instance, it will replace ñ with ? and post the ? to my database.  Is there anyway to not make it do this and leave it as the actual ñ ?  if the same characters is placed in a standard textbox it will submit with no problem.


Thanks for your time!



Improving the Performance of an ASP.NET page

$
0
0

Hi everyone,

I need your suggesstions and idea's to improve the performance of an asp.net webpage(.aspx). 

That page have list of below controls and etc.,

1. Gridview controls.

2. User controls.

3. Modal popup views.

4. Client side validation scripts and server side validations.

Whether i have use some other controls to achieve the same result instead of using the above list of controls ?

Please help ..

preload CheckedImageUrl for ToggleButtonExtender?

$
0
0

hello

how can i preload the checked image, CheckedImageUrl, for a ToggleButtonExtender connected to a asp:CheckBox control when the page is first served to the client so that when the user clicks on the checkbox it doesnt flicker. i can see in fiddler that the flicker occurs the first time the checked image is requested. any ideas?

  

<asp:CheckBox ID="RememberMe" runat="server" Text="Remember Me" CssClass="login_chkRememberMe" /><cc1:ToggleButtonExtender ID="RememberMe_ToggleButtonExtender" runat="server" CheckedImageUrl="~/Images/chkbox_checked.png" Enabled="True" TargetControlID="RememberMe" UncheckedImageUrl="~/Images/chkbox_unchecked.png" ImageHeight="17" ImageWidth="18"></cc1:ToggleButtonExtender>
 

 

thanks

zaint [:)]

Hide UpdateProgress using C# code behind

$
0
0

I have 3 UpdateProgress with one Update Panel. And I want to call everyone on spefic condition only.

So how to hide remaining 2 ProgressBar when 1 is already there.

I tried UpdateProgress.Visible = false; but It dint work.

inject script for add_populated of the Cascading DropDown

$
0
0

I have a user control in which the cascadind dropdowns are created dynamically. I want to associate the add_populated of the cascading dropdown to a clientside method. I am not able to initialize it on the StartupScript. How can this be done when the Cacading dropdown is created in the server side code.

appreciate any help. 

 

Thanks

Cascading dropdown with gridview

$
0
0

A little background:  there is an issue within the gridview control that prevents you from binding the second control when creating a cascading dropdownlist without the ajax toolkit.  It is somewhat complicated to work around this limitation and I've struggled with it.

I'm wondering if the cascading dropdownlist in the toolkit would be a good fit to work around this problem?  I've never used this particular tool nor have I ever built a service but it doesn't seem overly complicated.  I've spent innumerable hours trying to work around the gridview/binding issue and I'm wondering if anyone has had any success with the toolkit solution within a gridview?  

Note that my solution requires 3 cascading lists and within the gridview, the users will edit data rows (thus I need bind, not eval).

UpdatePanelAnimationExtender - how do I trigger than animation from C# (or JavaScript if need be) ?

$
0
0

I need the animation to run, depending on other conditions not relevent here, without physically pressing the CallButton (which does make the animation run). I've tried hitting the other buttons (TriggerButton) .Click event in javascript, but that doesn't do anything. I've Googled this to death, but I can't find a solution that works.

This is my code:

<asp:Button ID="CallButton" runat="server" Height="38" onclick="MakeCall_Click" Text="Make Call" Font-Bold="true" ForeColor=Indigo Font-Size="Medium" Width="125" />
.
.
.<asp:UpdatePanel ID="MessageNotificationLabelPanel" runat="server" ChildrenAsTriggers="true" UpdateMode="Conditional"><ContentTemplate><div id="background" style="text-align: center; vertical-align: middle; line-height: 25px; padding: 10px; height: 25px; color: #efefef;"><asp:Label ID="MessageUpdate" runat="server" Style="padding: 0px; font-weight: bold;" Visible="True" Width="100%"></asp:Label></div></ContentTemplate><Triggers><asp:AsyncPostBackTrigger ControlID="CallButton" EventName="Click" /><asp:AsyncPostBackTrigger ControlID="TriggerButton" EventName="Click" /></Triggers></asp:UpdatePanel><ajaxToolkit:UpdatePanelAnimationExtender ID="UpdatePanelAnimationExtender1" BehaviorID="animation" runat="server" TargetControlID="MessageNotificationLabelPanel" AlwaysFinishOnUpdatingAnimation="true"><Animations><OnUpdating><Sequence><FadeOut Duration="4.5" Fps="24" /><StyleAction AnimationTarget="MessageUpdate" Attribute="visibility" Value="hidden" /></Sequence></OnUpdating><OnUpdated><Parallel duration="0"><ScriptAction Script="onPanelUpdated();" /></Parallel></OnUpdated></Animations></ajaxToolkit:UpdatePanelAnimationExtender></td></tr></table></asp:Panel><div style="display:none"><asp:button id="TriggerButton" runat="server" Visible="false" onclick="TriggerButton_Click" /></div>

Ideally I'd like to make the UpdatePanelAnimationExtender animation run when I want from the C# code-behind, but I'd settle for a JavaScript mechanism that makes it run too...

Thanks in advance,

Barry

mutltiple cascading dropdownlists default values

$
0
0

 This cant be THAT hard:

I have 3 cascading dropdownlists, A, B and C.

I have saved the data correctly to my DB, value for A=4, value for B=3 and value for C=3

Now when I load my page, I want to set these values,

So list A must show all items and option 4 is selected.
list B must show all items and option 3 is selected.
list C must show all items and option 3 is selected.

However, since the dropdownlists are cascaded lists B and C do not contain any items yet as no choice has been made in A.

Here are two dropdowns to begin with:

    <asp:DropDownList cssclass="textbox" ID="ddlCatlevel1E" OnDataBound="ddlCatlevel1E_DataBound" runat="server"/>
    <cc1:CascadingDropDown ID="CascadingDropDown1" runat="server" TargetControlID="ddlCatlevel1E" Category="Catlevel1"
    prompttext="Select maincategory" ServicePath="/categories.asmx" ServiceMethod="GetCatlevel1">
        </cc1:CascadingDropDown>


    <asp:DropDownList cssclass="textbox" ID="ddlCatlevel2" runat="server"/>

<cc1:CascadingDropDown ID="CascadingDropDown2" runat="server"
        TargetControlID="ddlCatlevel2" ParentControlID="ddlCatlevel1E"   
 Category="Catlevel2" prompttext="Select subcategory" UseContextKey="true" ContextKey="ddlCatlevel1E"
        ServicePath="/categories.asmx" ServiceMethod="GetCatlevel2"
        LoadingText="loading...">
</cc1:CascadingDropDown>


categories.vb


    <WebMethod()> _
        Public Function GetCatlevel1(ByVal knownCategoryValues As String, ByVal category As String) As CascadingDropDownNameValue()
        Dim catlevel1Adapter As categoryTableAdapters.Catlevel1TableAdapter = New categoryTableAdapters.Catlevel1TableAdapter
        Dim cat1levels As category.Catlevel1DataTable = catlevel1Adapter.GetDataByCatlevel1
        Dim values As New List(Of CascadingDropDownNameValue)
        For Each dr As DataRow In cat1levels
            Dim title As String = CType(dr("title"), String)
            Dim id As Integer = CType(dr("id"), Integer)
            values.Add(New CascadingDropDownNameValue(title, id.ToString))
        Next
        Return values.ToArray
    End Function

    <WebMethod()> _
     Public Function GetCatlevel2(ByVal knownCategoryValues As String, ByVal category As String, ByVal contextKey As String) As CascadingDropDownNameValue()
        Dim kv As StringDictionary = CascadingDropDown.ParseKnownCategoryValuesString(knownCategoryValues)
        Dim UpperCatlevelID As Integer '= CInt(category)
        If Not kv.ContainsKey("Catlevel1") OrElse Not Int32.TryParse(kv("Catlevel1"), UpperCatlevelID) Then
            Return Nothing
        End If
        Dim MyConnection As SqlConnection = GetConnection()
        Dim cmd As New SqlCommand("SELECT id,title FROM catlevel2 WHERE catlevel1=@catlevel1id ORDER BY title ASC", MyConnection)
        cmd.Parameters.Add(New SqlParameter("@catlevel1id", UpperCatlevelID))
        Dim values As New List(Of CascadingDropDownNameValue)
        Try
            MyConnection.Open()
            Dim reader As SqlDataReader = cmd.ExecuteReader
            While reader.Read
                values.Add(New CascadingDropDownNameValue(reader("title").ToString, reader("id").ToString))
            End While
        Catch ex As Exception

        Finally
            MyConnection.Close()
        End Try
        Return values.ToArray
    End Function

    
(I know that the first dropdown doesnt necessarily have to be cascading, but for this example its necessary)    
    
Now, how do I set the selectedvalue of the 2nd dropdown based on the default value in the first dropdown? I think I have to do something with the contextkey.
The dropdownlists reside in a detailsview, so I also need to know in which event I need to execute the code for settings the selected dropdownlists values.
Please a code example!


Updatepanel Error in IE

$
0
0

I am using updatepanel in a page.  But it give error "Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerParserErrorException".

There is not Response.Write on page. I have tried by setting validaterequest to false.

I have also tried the following code in javascript

Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);  function EndRequestHandler(sender, args)  {    if (args.get_error() != undefined)     {         else if(args.get_error().name === 'Sys.WebForms.PageRequestManagerTimeoutException')        {              args.set_errorHandled(true);         }         else         {             // not this kind of error so let the default behavior happen.        }     }  }

But using this code postback event for any control on the page does not work

But the same page work in FireFox,Chrome (without above JavaScript code)

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>

 

Including font name and insert image in HTML Editor extender.

$
0
0

I want to add "Segoe UI" font in the HTML editor extender font family dropdown. So I have downloaded the latest source from codeplex http://ajaxcontroltoolkit.codeplex.com/SourceControl/latest#ReadMe.html and added the font in htmleditorextender.pre.js. Its working fine. Also I have to include the image uploader in the editor. 

 

<asp:TextBox runat="server" ID="txtBox2" TextMode="MultiLine" Columns="50" Rows="10"
Text="Hello <b>world!</b>" /><br />
<ajaxToolkit:HtmlEditorExtender ID="htmlEditorExtender2" TargetControlID="txtBox2"
runat="server" DisplaySourceTab="True" OnImageUploadComplete="ajaxFileUpload_OnUploadComplete">
<Toolbar>
<ajaxToolkit:Bold />
<ajaxToolkit:Italic />
<ajaxToolkit:Underline />
<ajaxToolkit:HorizontalSeparator />
<ajaxToolkit:JustifyLeft />
<ajaxToolkit:JustifyCenter />
<ajaxToolkit:JustifyRight />
<ajaxToolkit:JustifyFull />
<ajaxToolkit:CreateLink />
<ajaxToolkit:UnLink />
<ajaxToolkit:InsertImage />

</Toolbar>
</ajaxToolkit:HtmlEditorExtender>

while including the image uploader am getting the following error.

"Microsoft JScript runtime error: Unable to get value of the property 'Control': object is null or undefined" in the below line.

Sys.Application.add_init(function() {
$create(Sys.Extended.UI.AjaxFileUpload.Control, {"allowedFileTypes":"jpg,jpeg,gif,png","clientStateField":$get("SampleContent_htmlEditorExtender2_ajaxFileUpload_ClientState"),"contextKey":"{DA8BEDC8-B952-4d5d-8CC2-59FE922E2923}","postBackUrl":"/AjaxControlToolkitSampleSite/HtmlEditorExtender/HtmlEditorExtender.aspx","serverPollingSupport":true}, {"uploadComplete":ajaxClientUploadComplete}, null, $get("SampleContent_htmlEditorExtender2_ajaxFileUpload"));
});

Can anyone help me to resolve this one? I have already Changed CombineScripts="false" but not resolving the issue.

But if i remove the <ajaxToolkit:InsertImage />  editor is working fine.

<asp:TextBox runat="server" ID="txtBox2" TextMode="MultiLine" Columns="50" Rows="10"
Text="Hello <b>world!</b>" /><br />
<ajaxToolkit:HtmlEditorExtender ID="htmlEditorExtender2" TargetControlID="txtBox2"
runat="server" DisplaySourceTab="True" OnImageUploadComplete="ajaxFileUpload_OnUploadComplete">
<Toolbar> 
<ajaxToolkit:Bold />
<ajaxToolkit:Italic />
<ajaxToolkit:Underline />
<ajaxToolkit:HorizontalSeparator />
<ajaxToolkit:JustifyLeft />
<ajaxToolkit:JustifyCenter />
<ajaxToolkit:JustifyRight />
<ajaxToolkit:JustifyFull />
<ajaxToolkit:CreateLink />
<ajaxToolkit:UnLink />
</Toolbar>
</ajaxToolkit:HtmlEditorExtender>

Thanks,

Suresh.

Arrange Images Position in Asp.net

$
0
0

i have developed an application in which the gallery of each model is shown. for example http://modelspk.com/ainy-jaffri-model21 currently the images are being shown on the right side hence leaving the white space below the main image. my aspx looks like this

<tr><td align="left" style="padding-left: 5px;"><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr><td valign="top"><img id="Imgmain" src='<%= MainImage %>' width="350" height="450" alt="" /></td><td valign="top" style="background-color: #FFFFFF;"><asp:DataList ID="dlGallery" runat="server" Width="100%" RepeatDirection="Horizontal"  RepeatColumns="3">                                     <ItemTemplate><a href='/images2_New/GalleryModels/<%#Eval("Image") %>' rel="gallery" class="pirobox_gall"
title=""><img width="80" height="70" src='/images2_New/GalleryModels/<%#Eval("Image") %>' alt="" /></a></ItemTemplate></asp:DataList></td></tr></table></td></tr>

what i want to do is that if the images increase, they should display under the main image ..

Regards:

Mudassir

Cannot find button inside an accordion which is inside an update panel

$
0
0

I have a button inside an accordion which in turn is inside an update panel.

I have a file upload control inside this pane.

  <cc1:AccordionPane ID="pane9" runat="server" Visible="false">
                <Header>
                    Material Number Creation</Header>
                <Content>

                              <asp:FileUpload ID="FileUpload1" runat="server" />
                                
                      <asp:Button ID="btnUpload" runat="server" Text="Submit" CssClass="submit" OnClick="btnUpload_Click"   />  

       </Content>
            </cc1:AccordionPane>

        </Panes>
    </cc1:Accordion>

    </ContentTemplate>
            <Triggers>
                <asp:PostBackTrigger ControlID="btnUpload"  />
                        </Triggers>
     
    </asp:UpdatePanel>

I am getting the following error :

A control with ID 'btnUpload' could not be found for the trigger in UpdatePanel 'UpdatePanel1'.

Viewing all 5678 articles
Browse latest View live




Latest Images