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

JavaScript runtime error: "The data necessary to complete this operation is not yet available" and "No digits"

$
0
0

Exception was thrown at line 165, column 29 in http://localhost:30922/ScriptResource.axd?d=FHnC7y678QIZTuGLFowVOYb9WXj38cpJ_9S8zhqugNkFm8ttAnrl08J5YogLpq60qNGEZhIuyqpLZdp5s4iztG8JMGUbiFhjJy2PuxjKSlQ2i_PujcO3yCXcoPh5Ez5cZugeFw2&t=ffffffff886f56f4

0x8000000a - JavaScript runtime error: The data necessary to complete this operation is not yet available.

Hi there,

Hopefully this an easy one - something to do with DLL versions or something?!?

NOTE: In our environment I'm unable to use packagemanager (something to do with proxy/firewall stuff)

This doesn't APPEAR to be causing any issues (yet) and we don't think it was happening in vs2010 but now we are using vs2012 and when debugging we see lots of these messages every pageload in the OUTPUT window.... any thoughts/info is appreciated.

 

 

Exception was thrown at line 3, column 7032 in http://localhost:30922/ProductCategory.aspx?_TSM_HiddenField_=ctl00_ctl00_smMinteShop_HiddenField&_TSM_CombinedScripts_=;;AjaxControlToolkit,+Version=3.5.7.607,+Culture=neutral,+PublicKeyToken=28f01b0e84b6d53e:en-US:e96eec5b-f5fc-47c8-9cba-2a4f2f4c43f0:de1feab2:f9cec9bc:35576c48:f2c8e708:720a52bf:589eaa30:698129cf:e148b24b:8ad18101:7311d143

0x800a139e - JavaScript runtime error: No digits


How can i change span's class in C# ?

$
0
0

the following code is under gridview1, can't get the span's ID directly so i use findcontrol instead

<asp:TemplateField HeaderText="Reply">
<ItemTemplate>
<span id="convertsantionCount" class="label label-success"><%# Portal.Message.getConversationCount(Eval("ID").ToString())%></span>
</ItemTemplate>
</asp:TemplateField>

System.Web.UI.HtmlControls.HtmlGenericControl control = (System.Web.UI.HtmlControls.HtmlGenericControl) GridView1.FindControl("convertsantionCount");
control.Attributes["class"] = "badge badge-warning";

it says the control.Attributes["class"] Object reference not set to an instance of an object.

anyone would tell me how can i mannually change the class of the span. any way would do much thanks.

JavaScriptSerializer - Invalid JSON primitive: object.

$
0
0
function tableToJson(activeTab) {
            var data = [];

            // first row needs to be headers
            var headers = [];
            var header_length = $('#grd_'+(activeTab+1)+' tbody th').length;
            for (var i = 0; i < header_length; i++) {
                var header_name = $('#grd_' + (activeTab + 1) + ' tbody th')[i].innerHTML;
                switch (header_name) {
                    case "Your Type":
                        headers[i] = "YourType";
                        break;
                    case "Code":
                        headers[i] = "YourCode";
                        break;
                    case "Your Type":
                        headers[i] = "YourType";
                        break;
                    case "Your life":
                        headers[i] = "YourLife";
                        break;
                    case "Period":
                        headers[i] = "YourPeriod";
                        break;
                    case "Qualifying Cost":
                        headers[i] = "OriginalCost";
                        break;
                    case "B/F Cost":
                        headers[i] = "Cost";
                        break;
                    case "Rate%":
                        headers[i] = "Rate%";
                        break;
                    case "Your Amount":
                        headers[i] = "YourRate";
                        break;
                    case "Your Amount":
                        headers[i] = "YourAmount";
                        break;
                    case "Your Carrying Amount":
                        headers[i] = "YourCarryingAmount";
                        break;
                    case "Last Date":
                        headers[i] = "YourGeneratedDate";
                        break;
                    default:
                    break;
                 }
            }

            // go through cells
            var totalRowData_length = $('#grd_' + (activeTab + 1) + ' tbody tr').length;
            for (var i = 1; i < totalRowData_length; i++) {

                var tableRow = $('#grd_' + (activeTab + 1) + ' tbody tr')[i]
                var tableRow_length = $('#grd_' + (activeTab + 1) + ' tbody tr')[i].cells.length;
                var rowData = {};

                for (var j = 0; j < tableRow_length; j++)
                {
                    var dt = $('#grd_' + (activeTab + 1) + ' tbody tr')[i].cells[j].innerHTML;
                    if (dt.indexOf('INPUT') != -1) {
                        var mypattern = "value=\'?[0-9]*\.?[0-9]*\'?";
                        var myRegExp = new RegExp('(' + mypattern + ')', "g");
                        var result = dt.match(myRegExp);
                        var length = result.length;
                        if (result.length > 0)
                            dt = result[0].replace("value=", "");
                        else
                            dt = "0.00";
                    }
                    rowData[headers[j]] = dt;
                }

                data.push(rowData);
            }

            return data;
        }

Is above valid Json ? How do I check whether it is valid? 

After converted tables to Json array over clientside script, I got Invalid Json primitive error when passing the following code. 

JavaScriptSerializer serializer = new JavaScriptSerializer();
List<ABC> lstABC = serializer.Deserialize<List<ABC>>("{"+((TextBox)Master.FindControl("txtABCString")).Text+"}");

What are the possible matter that can cause this problem. I had changed the header name to be exacted with ABC class. I am not sure what else could be the cause. There are date field in the class. Should I convert the date field to DateTime? But I do the conversion over client side.. 

After adding the "{" "}" I got the error below instead. What is it about really? what is the member name regarding to?  

Invalid object passed in, member name expected. (1): {[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]}

Button event not fired inside of user control when validation is enabled.

$
0
0

Hello,

I have used a user control in a Tabpanel of Tabconatiner as below:


<ajaxtoolkit:TabContainer ID="TabContainer1" runat="server" ActiveTabIndex="0"  AutoPostBack="true" OnActiveTabChanged="Tabs_ActiveTabChanged">
        <ajaxtoolkit:TabPanel runat="server" HeaderText="Week-2" ID="TabPanel1"  >
            <ContentTemplate>
                 <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
                 <ContentTemplate>
                    <uc1:Assessment_Input ID ="InputContainer1" runat="server" /> 
                 </ContentTemplate>
                 </asp:UpdatePanel>          
            </ContentTemplate>
        </ajaxtoolkit:TabPanel>
........

The usercontrol inturn has a tabcontainer with a TabPanel like below:

....
<ajaxtoolkit:TabPanel ID="TabPanel2" runat="server" HeaderText="Tab2">
        <ContentTemplate>
            X : <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="TextBox1"
           CssClass="failureNotification" ErrorMessage="Please Select Value"
           ValidationGroup="tab2"></asp:RequiredFieldValidator>
            y: <asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
            <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="TextBox2"
           CssClass="failureNotification" ErrorMessage="Please Select Value"
           ValidationGroup="tab2"></asp:RequiredFieldValidator>
            <asp:Button ID="Button1" runat="server" Text="Button" OnClick="Button1_Click" ValidationGroup="tab2" />
        </ContentTemplate>
    </ajaxtoolkit:TabPanel>

...

Button1_click doesn't get fired when validationgroup is set, but if I disable by adding Causesvalidation=false, the event gets fired.

Any inputs on this will be really helpful.







Could not load file or assembly 'AjaxControlToolkit, Version=3.5.11119.20050, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference

$
0
0
Hi guys.
I have Visual Studio 2010 installed and running with .net framework 3.5, all was fine until I installed Visual Studio 2012.
First, all the projects coded in VS2010 has issue on the aspx pages, I had solved it.
Now I have Ajax dll issue on VS2010 projects and below is the error message.

Reference.svcmap: Could not load file or assembly 'AjaxControlToolkit, Version=3.5.11119.20050, 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)

Here are the steps that I did but the error is still there.
1. http://ajaxcontroltoolkit.codeplex.com/releases/view/112805 download ToolKit for 3.5 and add the dll in the Bin folder.
2. Remove the <runtime> section in the web.config file.

Here is the Web.config.
<?xml version="1.0"?>
<!--
Note: As an alternative to hand editing this file you can use the
web admin tool to configure settings for your application. Use
the Website->Asp.Net Configuration option in Visual Studio.
A full list of settings and comments can be found in
machine.config.comments usually located in
\Windows\Microsoft.Net\Framework\v2.x\Config
-->
<configuration>
<configSections>
<sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
<sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere"/>
<section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
<section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
<section name="roleService" type="System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
</sectionGroup>
</sectionGroup>
</sectionGroup>
</configSections>

<system.web>
<!--
Set compilation debug="true" to insert debugging
symbols into the compiled page. Because this
affects performance, set this value to true only
during development.
-->
<compilation debug="true">
<assemblies>
<add assembly="System.Web, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
<add assembly="System.Data.Services, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Data.Entity, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Data.Services.Client, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Security, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System.Data.Entity.Design, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Web.Entity, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Web.Extensions.Design, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.DirectoryServices, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System.Data.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Data.OracleClient, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
</assemblies>
<buildProviders>
<add extension=".edmx" type="System.Data.Entity.Design.AspNet.EntityDesignerBuildProvider"/>
</buildProviders>
</compilation>
<!--
The <authentication> section enables configuration
of the security authentication mode used by
ASP.NET to identify an incoming user.
-->
<authentication mode="Windows"/>
<!--
The <customErrors> section enables configuration
of what to do if/when an unhandled error occurs
during the execution of a request. Specifically,
it enables developers to configure html error pages
to be displayed in place of a error stack trace.

<customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
<error statusCode="403" redirect="NoAccess.htm" />
<error statusCode="404" redirect="FileNotFound.htm" />
</customErrors>
-->
<customErrors mode="Off"/>
<pages>
<controls>
<add tagPrefix="asp" namespace="AjaxControlToolkit" assembly="AjaxControlToolkit"/>
<add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</controls>
</pages>
<httpRuntime maxRequestLength="102400"/>
<profile defaultProvider="AspNetSqlMembershipProvider">
<providers>
<add name="AspNetSqlMembershipProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="SqlProfileString"/>
</providers>
</profile>
<httpHandlers>
<remove verb="*" path="*.asmx"/>
<add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add verb="GET,HEAD" path="ScriptResource.axd" validate="false" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</httpHandlers>
<httpModules>
<add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</httpModules>
</system.web>
<!--
The system.webServer section is required for running ASP.NET AJAX under Internet
Information Services 7.0. It is not necessary for previous version of IIS.
-->
<system.codedom>
<compilers>
<compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" warningLevel="4">
<providerOption name="CompilerVersion" value="v3.5"/>
<providerOption name="WarnAsError" value="false"/>
</compiler>
<compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" type="Microsoft.VisualBasic.VBCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" warningLevel="4">
<providerOption name="CompilerVersion" value="v3.5"/>
<providerOption name="OptionInfer" value="true"/>
<providerOption name="WarnAsError" value="false"/>
</compiler>
</compilers>
</system.codedom>
<system.webServer>
<validation validateIntegratedModeConfiguration="false"/>
<modules>
<remove name="ScriptModule"/>
<add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</modules>
<handlers>
<remove name="WebServiceHandlerFactory-Integrated"/>
<remove name="ScriptHandlerFactory"/>
<remove name="ScriptHandlerFactoryAppServices"/>
<remove name="ScriptResource"/>
<add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add name="ScriptResource" verb="GET,HEAD" path="ScriptResource.axd" preCondition="integratedMode" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</handlers>
</system.webServer>
<runtime>
<assemblyBinding appliesTo="v2.0.50727" xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35"/>
<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Extensions.Design" publicKeyToken="31bf3856ad364e35"/>
<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

Please help me.

Microsoft JScript runtime error: Sys.ArgumentNullException: Value cannot be null

$
0
0

Hi,

I have the below code which runs fine until I click on Edit, then I get:
Microsoft JScript runtime error: Sys.ArgumentNullException: Value cannot be null.
Parameter name: elements

Any idea why I am getting the JScript or work around?

Thank you!

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<%@ 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">
    
    <div style="display:None">
<cc1:Editor ID="Editor1" runat="server"  />
</div>
    <div>
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
    </div>


<asp:GridView ID="list" runat="server" DataKeyNames="ID" AutoGenerateColumns="False"
            Width="600px" Height="350px" BackColor="White" BorderColor="#CCCCCC" BorderStyle="None"
            BorderWidth="1px" CellPadding="3" OnRowDeleting="list_RowDeleting" OnRowUpdating="list_RowUpdating"
            OnRowCancelingEdit="list_RowCancelingEdit"
        OnRowEditing="list_RowEditing"
        onselectedindexchanged="list_SelectedIndexChanged">
            <RowStyle ForeColor="#000066" />
            <Columns>
                <asp:TemplateField HeaderText="ID">
                    <ItemTemplate>
                        <%# Eval("ID") %>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Date Created">
                    <ItemTemplate>
                        <%# Eval("Edited_By")%>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Comments">
                    <EditItemTemplate>
                        <cc1:Editor ID="editor1" runat="server" Width="500px" Height="250px"/>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <%# Eval("Manager") %>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:CommandField ShowEditButton="True" />
                <asp:ButtonField CommandName="Delete" Text="Delete" />
            </Columns>
            <FooterStyle BackColor="White" ForeColor="#000066" />
            <PagerStyle BackColor="White" ForeColor="#000066" HorizontalAlign="Left" />
            <SelectedRowStyle BackColor="#669999" Font-Bold="True" ForeColor="White" />
            <HeaderStyle BackColor="#006699" Font-Bold="True" ForeColor="White" />
        </asp:GridView>
    <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>



    </form>
</body>
</html>

using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using AjaxControlToolkit;


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


    private string cnstr = ConfigurationManager.ConnectionStrings["Database1ConnectionST"].ConnectionString;
    private string sql;

    protected void Page_Load(object sender, EventArgs e)
    {


        if (!IsPostBack)
        {
            FillGridview1();

 AjaxControlToolkit.HTMLEditor.Editor edit = new AjaxControlToolkit.HTMLEditor.Editor();
        //edit = (AjaxControlToolkit.HTMLEditor.Editor)row.FindControl("Editor1") as AjaxControlToolkit.HTMLEditor.Editor;

        }
       
    }

    public DataTable FetchTypeEditedBy()
    {
        string sql = "Select ID, Edited_By, Manager From mydb";
        SqlDataAdapter da = new SqlDataAdapter(sql, cnstr);
        DataTable dt = new DataTable();
        da.Fill(dt);
        return dt;
    }

    private void FillGridview1()
    {
        DataTable dtProjects = FetchTypeEditedBy();

        if (dtProjects.Rows.Count > 0)
        {
            list.DataSource = dtProjects;
            list.DataBind();
        }
        else
        {
            dtProjects.Rows.Add(dtProjects.NewRow());
            list.DataSource = dtProjects;
            list.DataBind();

            int TotalColumns = list.Rows[0].Cells.Count;
            list.Rows[0].Cells.Clear();
            list.Rows[0].Cells.Add(new TableCell());
            list.Rows[0].Cells[0].ColumnSpan = TotalColumns;
            list.Rows[0].Cells[0].Text = "No Record Found";
        }
    }

    protected void list_RowUpdating(object sender, GridViewUpdateEventArgs e)
    {
        
        //retrive the updated data
        string Id = list.DataKeys[e.RowIndex].Value.ToString();
        int index = list.EditIndex;
        GridViewRow row = list.Rows[index];
        AjaxControlToolkit.HTMLEditor.Editor edit = (AjaxControlToolkit.HTMLEditor.Editor)row.FindControl("Editor1") as AjaxControlToolkit.HTMLEditor.Editor;
        string EditorContent = edit.Content;
        //Execute the update stored procedure
        //bool success = ReviewAccess.EditReview(reviewId, review);
        // Cancel edit mode
        list.EditIndex = -1;
        //Display status message
        Label1.Text ="Update successful Update failed";
        //Reload the grid
       // BindGrid();
    }
    protected void list_RowCancelingEdit(object sender, GridViewCancelEditEventArgs e)
    {

    }
    protected void list_RowDeleting(object sender, GridViewDeleteEventArgs e)
    {

    }
    protected void list_RowEditing(object sender, GridViewEditEventArgs e)
    {
        list.EditIndex = e.NewEditIndex;
        FillGridview1();
    }



    protected void list_SelectedIndexChanged(object sender, EventArgs e)
    {

    }
}

Cannot Get AJAX Control Toolkit's Accordion to Work

$
0
0

Hey guys.

I've practically spent seven or eight hours trying to get the ASP.NET AJAX Accordion to work and it simply will not cooperate.  I have been to every imaginable corner of the web thanks to Bing and Google, read post after post on this forum, and done any other thing I could possibly think of to get this to work, yet I still hit this wall.

Here's the code I've been using to get this to work:

<%@ Page Language="VB" %><%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><script runat="server"></script><html xmlns="http://www.w3.org/1999/xhtml"><head runat="server"><title></title></head><body><form id="form1" runat="server"><div><cc1:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server"></cc1:ToolkitScriptManager><cc1:Accordion ID="AccordionStates" runat="server"
            ContentCssClass="AccordionContent" FramesPerSecond="40"
            HeaderCssClass="AccordionHeader" SelectedIndex="0"
            HeaderSelectedCssClass="AccordionHeaderSelected" FadeTransitions="true" RequireOpenedPane="false"><Panes runat="server"><cc1:AccordionPane ID="Pane_AK" runat="server"><Header>Arkansas Header</Header><Content>Arkansas Content<br />will go<br />here</Content></cc1:AccordionPane><cc1:AccordionPane ID="Pane_MA" runat="server"><Header>Massachusetts Header</Header><Content>Massachusetts Content<br />will go<br />here</Content></cc1:AccordionPane></Panes></cc1:Accordion></div></form></body></html>


As for the Massachusetts/Arkansas bit, I found that on some other forum that said that coding would work (it didn't for me).  I'm hosting this failed attempt athttp://pudgle.com/test/development/index/Default.aspx.  I do have the Bin folder in the project, so that's not the issue.

missing something on CollapsiblePanelExtender

$
0
0

by refering for foother uniquo(copyright homework) i implement using ajax CollapsiblePanelExtender i not sure that correct or not when i put a label inside and curosr focus to the mouse, the CollapsiblePanelExtender will close @@ my code look like. how to make it when cursor inside a panal, the panal will not close.

<asp:UpdatePanel ID="UpdatePanel1" runat="server"><ContentTemplate><asp:Panel ID="pHeader" runat="server" CssClass="cpHeader"><asp:Label ID="lblText" runat="server" CssClass="lblText" /><asp:Image ID="ImgArrow" runat="server" CssClass="imgHeader"/></asp:Panel><asp:Panel ID="pBody" runat="server" CssClass="cpBody"><asp:Label ID="Label1" runat="server" Text="Label" style=" color:White;"></asp:Label><asp:Label ID="Label2" runat="server" Text="Label" style=" color:White;"></asp:Label> <asp:Label ID="Label3" runat="server" Text="Label" style=" color:White;"></asp:Label> <asp:Label ID="Label4" runat="server" Text="Label" style=" color:White;"></asp:Label><br /><br /><br /><br /><br /></asp:Panel><asp:CollapsiblePanelExtender ID="CollapsiblePanelExtender1" AutoCollapse="True" AutoExpand="True"
            TargetControlID="pBody" CollapseControlID="pHeader" ExpandControlID="pHeader"
            Collapsed="true" CollapsedSize="0" runat="server" TextLabelID="lblText"
                CollapsedText="+ &nbsp;&nbsp;&nbsp;&nbsp; ABOUT DONKEY SKIN " ExpandedText="- &nbsp;&nbsp;&nbsp;&nbsp; ABOUT DONKEY SKIN" CollapsedImage="~/Image/Icon/arrow.png" ImageControlID="ImgArrow"></asp:CollapsiblePanelExtender></ContentTemplate></asp:UpdatePanel>

Ajax postback always always choose first value from the dropdown

$
0
0

I have page with couple of dropdowns and excel download button, on download button click ajax postback dropdownlist always choose first value as selected item.

But the selected item was 3. Can anyone help me to fix this.

Thanks,

Paps

Resizing picture

$
0
0

In my web page I have an upload file comntrol.

I need to upload a picture, but save it in resized form, for ex: 640 X 480, not larger.

Thanks

Vulnerabilities in MicrosoftAjax

$
0
0

Hi, 

We use Ajax Control Toolkit 4.1 in our application and when we run the HPFortify tool on our application it came up with the following vulnerabilities.

Code Injection - MicrosoftAjax.js _ensureHistory()

XSS DOM - MicrosoftAjax.js _setState()

Code Injection  - MicrosoftAjax.js setTimeout(0)

Could you suggest some ways to resolve these issues. 

Thanks.

Why The tab container ActiveTabChanged event fired by the internal control changed events?

$
0
0

Sir,

The below is my design:

<asp:TabContainer ID="Tabcontainer" runat="server" AutoPostBack="true" ForeColor="Gray" CssClass="ajax__tab_custom" Height="100%" Width="100%" OnActiveTabChanged="Tabcontainer_ActiveTabChanged" >

<asp:TabPanel ID="Tabpnlplasma" runat="server" >
<HeaderTemplate>Tab1</HeaderTemplate>

<ContentTemplate>

<asp:DropDownList ID="d1" runat="server" AutoPostBack="true" OnSelectedIndexChanged="d1_SelectedIndexChanged" >
<asp:ListItem></asp:ListItem>
<asp:ListItem>1</asp:ListItem>

<asp:ListItem>2</asp:ListItem>
</asp:DropDownList><br />
<asp:ListBox ID="l1" runat="server" AutoPostBack="true" OnSelectedIndexChanged="l1_SelectedIndexChanged">
<asp:ListItem>1</asp:ListItem>
<asp:ListItem>2</asp:ListItem>
<asp:ListItem>3</asp:ListItem>
</asp:ListBox>
</ContentTemplate>
</asp:TabPanel>

<asp:TabPanel ID="TabPanel1" runat="server">
<HeaderTemplate>Tab2</HeaderTemplate>

<ContentTemplate>

<asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="true" OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged">
<asp:ListItem></asp:ListItem>
<asp:ListItem>1</asp:ListItem>

<asp:ListItem>2</asp:ListItem>
</asp:DropDownList><br />
<asp:ListBox ID="ListBox1" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ListBox1_SelectedIndexChanged">
<asp:ListItem>1</asp:ListItem>
<asp:ListItem>2</asp:ListItem>
<asp:ListItem>3</asp:ListItem>
</asp:ListBox>
</ContentTemplate>
</asp:TabPanel>
</asp:TabContainer>

Here my problem is when i select the Tab1 dropdown or listbox two events are fire one is dropdown or listbox and another is ' tabcontainer active tab changed event'.

When i repeat this same process in tab2 the Tab container event not fired. Why this tab container event fired . please help me sir.

TabContainer - Retain or Access data in server side code

$
0
0

Hi,

I am not sure what a problem. My data all gone after postback. I dynamically generated tabs and table over client side. After clicking btn save. Whatever was generated was gone. Any idea that I can retain the data? 

Thanks

Issues with using User Control in TabPanel of TabConatiner - Button event not fired and Load Tabpanel on pageload

$
0
0

Hello,

I am trying to add Ajax Tabcontainer to my webpage, and stuck in mid way with some issues during implementation.


Here is what is done so far:
1. I have a webapage with Tabcontainer1 with 4 tab panels(lets say TabPanel 1-4).
2. Since Tabpanel need to list same kind of form template, I have created a user Control(uc1) which is in turn has a TabContainer2 with 4 tabpanels(lets say TabPanel 5-8).
3.  Now I use this uc1 in each of the tabpanels in my TabContainer1.


<asp:ScriptManager runat="server"></asp:ScriptManager>
    <ajaxtoolkit:TabContainer ID="TabContainer1" runat="server" ActiveTabIndex="0"  AutoPostBack="true" OnActiveTabChanged="Tabs_ActiveTabChanged">
        <ajaxtoolkit:TabPanel runat="server" HeaderText="Week-2" ID="TabPanel1"  >
            <ContentTemplate>
            <uc1:Assessment_View ID ="ViewContainer1" runat="server"  />            
            </ContentTemplate>
        </ajaxtoolkit:TabPanel>
        <ajaxtoolkit:TabPanel ID="TabPanel2" runat="server" HeaderText="Week0">
            <ContentTemplate>
            <uc1:Assessment_View ID ="ViewContainer2" runat="server" />     
            </ContentTemplate>
        </ajaxtoolkit:TabPanel>
        <ajaxtoolkit:TabPanel ID="TabPanel3" runat="server" HeaderText="Week3">
            <ContentTemplate>
             <uc1:Assessment_View ID ="ViewContainer3" runat="server"  />
            </ContentTemplate>
        </ajaxtoolkit:TabPanel>
        <ajaxtoolkit:TabPanel ID="TabPanel4" runat="server" HeaderText="Week6">
            <ContentTemplate>
            <uc1:Assessment_View ID ="ViewContainer4" runat="server"  />     
            </ContentTemplate>
        </ajaxtoolkit:TabPanel>
    </ajaxtoolkit:TabContainer>

Issues :
1. TabPanel 5(View Data form) in uc1 has to load the data from Db depending on the week Selected in TabContainer1(WeekNo), but doesn't load data on pageload, but once I click on some other tab(6-8) and come back to tabPanel5, the data gets loaded as expected as I have the TabChanged event to take care of it.

Solutions tried:
I tried to load the data in page load event of uc1, depending on the Tab selected in tabContainer1, but i see that the pageload of uc1  gets hit first and then the TabChangedevent of TabContainer1, where as I am setting the weekNo in TabChangedevent of Tabcontainer1.Hence it doesnt bind the correct week data.

2. Button event in TabPanel 6(Its like a form with text boxes with Submit button) in  uc1 does not get fired.

Solution tried:
If I disable the validation by setting the CausesValidation as false for the button, event gets fired.

Please help me solve both of these issues.

Thanks for looking into this.


 

Value cant pass using Ajax

$
0
0

Hi,

When i give value for textbox--  Naveen'''' cant pass value to post method

<input class="span3" id="txt_Title" type="text" runat="server" />

$('#btnSubmit').on('click', function () {
$.ajax({
type: 'POST',
contentType: "application/json; charset=utf-8",
url: 'ProductMaster.aspx/InsertMethod',
data: "{'Title':'" + $('#<%=txt_Title.ClientID%>').val() + "'}",--How to pass value  with single Quote--   m passing'welcome' can't pass webmethod
async: false,
success: function (response) {

if (response.d="Save") {

window.location.href = "ProductMasterView.aspx";

}});

Thanks


Rows look like Detail view and columns look like Grid View

$
0
0

Hi ,

I build Project that have load Multiple data ,in project number of heading are at least 60, the grid view load but it look like train but i want to use Detail view the number of Heading come like row and columns are increase  is there any way where Detail view support multiple columns  or an other alternet .

thanks Samiullah

element validatorcalloutextender is not a known element

$
0
0

Hi all,

I am having trouble finding out why the ValidatorCallOutExtender is not in my toolbox.  I am using Visual Studio 2012.  I installed the Ajax Control Toolkit (version 7.1005) through Nuget.

I have other Ajax controls in the toolbox, but I cannot find this one, nor can I find any reason as to why this is not showing.

Any help would be greatly appreciated.

Thank you.

can javascript from outside an update panel update a video within it?

$
0
0

I have a video in an iframe, and the iframe is within an updatepanel.

As far as I know, the only purpose of an update panel is to allow refresh of just part of a webpage, rather than reloading the entire page.

However, I noticed that after I put in the update panel, I had javascript that failed.  It no longer was able to make the video seek, when it was loaded.

This is 99% a bug on my part, but I just want to be sure - an update panel should not interfere with any javascript in the 'head' section from updating a video within the update panel.

Thanks

Slideshowextender Button

$
0
0

How do you run an onclick codebehind function for an asp.net button (btnNext).  When the button is setup for a slideshowextender, the onclick event does not work.

ListSearchExtender problems with Chrome

$
0
0

Hi - new to the Ajax Control Toolkit. I've added a ListSearchExtender control to a dropdown and find its not working with Chrome browser (v31.0.1650.63). Testing the sample here,

http://www.asp.net/AjaxLibrary/AjaxControlToolkitSampleSite/ListSearch/ListSearch.aspx

It also doesn't work for the dropdown when using Chrome. The prompt text shows when the dropdown gets focus but the keyboard input doesn't appear to be correctly captured. All works as expected with Firefox and IE.

Anyone else seeing this issue?

Thanks.

Viewing all 5678 articles
Browse latest View live


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