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

'AjaxControlToolkit.ToolkitScriptManagerConfig' threw an exception

$
0
0

Upgraded to latest Ajax release (Dec2013). My Website works fine on my pc, but when I move it to Godaddy it throws an error. If I use the asp scriptmanager page loads on website fine, but not with the ajax toolkit scriptmanager.a

Have spent two days researching and reading posts and I still cannot figure it out. I have listed the process below along with the error, masterfile, and config file. Can someone please tell me how I can correct this. Thanks, in advance.

Process:

-VS2010 selected create New Website (not project) 
-Installed Nuget Package Manager
-Installed AjaxControllToolkit
-Added ajax Tab to toolbox
-On ajax toolbox tab RightClick choose items and browsed to my website dir bin folder selected ajaxcontroltoolkit.dll
-DragDropd toolkitscriptmanager from toolbox under <form runat="server"> in master page
-F5 (build/run) website comes up just fine on my PC
-Used VS2010 ftp CopyWeb feature to move files to Godaddy
-try to go to website "http://www....
-the error below is what is returned.

[TypeInitializationException: The type initializer for 'AjaxControlToolkit.ToolkitScriptManagerConfig' threw an exception.]
   AjaxControlToolkit.ToolkitScriptManager..ctor() in ToolkitScriptManager.cs:114
   ASP.masterpages_site_master.__BuildControlToolkitScriptManager1() +26
   ASP.masterpages_site_master.__BuildControl__control6() +107
   ASP.masterpages_site_master.__BuildControlTree(masterpages_site_master __ctrl) +181
   ASP.masterpages_site_master.FrameworkInitialize() +22
   System.Web.UI.UserControl.InitializeAsUserControlInternal() +32
   System.Web.UI.MasterPage.CreateMaster(TemplateControl owner, HttpContext context, VirtualPath masterPageFile, IDictionary contentTemplateCollection) +655
   System.Web.UI.Page.get_Master() +54
   System.Web.UI.Page.ApplyMasterPage() +14
   System.Web.UI.Page.PerformPreInit() +45
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +335
                  


Master Page ---------------------------------------------------

<%@ Master Language="C#" AutoEventWireup="true" CodeFile="Site.master.cs" Inherits="SiteMaster" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"><head runat="server"><title></title><link href="~/Styles/Site.css" rel="stylesheet" type="text/css" /><asp:ContentPlaceHolder ID="HeadContent" runat="server"></asp:ContentPlaceHolder></head><body><form runat="server"><ajaxToolkit:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server"></ajaxToolkit:ToolkitScriptManager><div class="page"><div class="header"><div class="title"><h1>
                    My ASP.NET Application</h1></div></div><div class="main"><asp:ContentPlaceHolder ID="MainContent" runat="server"/></div><div class="clear"></div></div></form></body></html>

web.config ---------------------------------------------------  

<?xml version="1.0"?><!--
  For more information on how to configure your ASP.NET application, please visit
  http://go.microsoft.com/fwlink/?LinkId=169433
  --><configuration><connectionStrings><add name="ApplicationServices" connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnetdb.mdf;User Instance=true" providerName="System.Data.SqlClient"/></connectionStrings><system.web><customErrors mode="Off"/><compilation debug="true" targetFramework="4.0"><assemblies><add assembly="System.Data.Services.Client, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/></assemblies></compilation><authentication mode="Forms"><forms loginUrl="~/Account/Login.aspx" timeout="2880"/></authentication><membership><providers><clear/><add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="hidden"      
</providers></membership><profile><providers><clear/><add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="ApplicationServices" applicationName="/"/></providers></profile><roleManager enabled="false"><providers><clear/><add name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider" connectionStringName="ApplicationServices" applicationName="/"/><add name="AspNetWindowsTokenRoleProvider" type="System.Web.Security.WindowsTokenRoleProvider" applicationName="/"/></providers></roleManager><pages><controls><add tagPrefix="ajaxToolkit" assembly="AjaxControlToolkit" namespace="AjaxControlToolkit"/></controls></pages></system.web><system.webServer><modules runAllManagedModulesForAllRequests="true"/></system.webServer><runtime><assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"><dependentAssembly><assemblyIdentity name="Microsoft.WindowsAzure.Storage" publicKeyToken="31bf3856ad364e35" culture="neutral"/><bindingRedirect oldVersion="0.0.0.0-2.1.0.4" newVersion="2.1.0.4"/></dependentAssembly></assemblyBinding></runtime></configuration>


    Update-------

I got tired of trying to figure it out, so took the easy route, and went back to the last ajax version and it worked fine. Would still like to figure out at a later date, but back up and running now.


htmleditorextender not working

$
0
0

Hi , 

when i try to add htmleditor extender to my page i get following error :

The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.Web.HttpException: The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).

although other ajax controls works fine

how i can solve this

thanks

Microsoft JScript runtime error: 'Sys.Extended.UI' is null or not an object

$
0
0

hi dear forums.asp.net members. i am using urlrewritingnet for url rewriting. at one of my page i am using auto complete extender . it works fine for first page weirdly because also that page is getting url rewriting.


now let me explain you


my normal page is


domain/Pokedex.aspx


here what i do for url rewriting



<add name="PokedexPageWrite"  virtualUrl="^~/Pokedex-(.*)"
              rewriteUrlParameter="ExcludeFromClientQueryString"
              destinationUrl="~/Pokedex.aspx?Page=$1"
              rebaseClientPath="false"
              ignoreCase="true"  /><add name="PokedexTurkceRewrite"  virtualUrl="^~/Turkce-(.*)"
            rewriteUrlParameter="ExcludeFromClientQueryString"
            destinationUrl="~/Pokedex.aspx?Language=$1"
            rebaseClientPath="false"
            ignoreCase="true"  /><add name="PokedexTurkceRewritePages"  virtualUrl="^~/Turkce-Pokedex-(.*)"
        rewriteUrlParameter="ExcludeFromClientQueryString"
        destinationUrl="~/Pokedex.aspx?Page=$1"
        rebaseClientPath="false"
        ignoreCase="true"  />



ok now problem does not happen when i type this : domain/Pokedex.aspx


but i when i type this problem occurs : domain/Pokedex-2 which is equal to domain/Pokedex.aspx?page=2


here is the problem screen shot





but when i type this problem does not happen : domain/Pokedex.aspx?page=2


so it is about url rewriting i guess



i really need to solve this problem ty very much


The WEB Pages is scrolling Automatically without User needs

$
0
0

Oh my God I have stuck in an unknown problem and I have posted so many question in different forums but still failed to solve that

Problem is the web pages is scroll UP if I scroll it down and it scroll down when I scroll it UP

the scroller (scroll bar) stucks middle of the page niether it comes down nor UP

I have posted this question in detail and provide full markup Please solve this

http://forums.asp.net/t/1962569.aspx?ASP+NET+PAGE+SCROLLING+automatically+

http://forums.asp.net/t/1952596.aspx?The+aspx+page+is+automatic+scrolling+upward

I have One Master Page while other is content pages

a script Manger in master page with UpdatePannel

while other content pages has also update pannels

Onkey press

$
0
0

Hello everyone i want to search data on key press from a repeater

i tried something like that but it does not work 

i don't know how to bind my sql to repeater

to make the search 

<!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><script src="http://codeorigin.jquery.com/jquery-2.0.3.min.js"></script><script>
        $(document).ready(function () {
            $("#<%=txtSearch.ClientID%>").keypress(function () {
                //-- trigger click event of dummy button
                //-- we will write bind grid function on this click event on server side
                $("#<%=btnDummy.ClientID%>").click();
            });
        });</script></head><body><form id="form1" runat="server"><div><asp:ScriptManager ID="ScriptManager1" runat="server" /><asp:TextBox runat="server" ID="txtSearch" /><asp:UpdatePanel ID="UpdatePanel1" runat="server"><ContentTemplate><asp:Button ID="btnDummy" runat="server" Text="testbutton" style="display:none" OnClick="btnDummy_Click" /><asp:Repeater ID="Repeater1" runat="server"></asp:Repeater></ContentTemplate></asp:UpdatePanel></div></form></body></html>
PrivateSubBindGrid(SearchTermAsString)Using conss AsNewSqlConnection(_start)Dim query AsString="SELECT Item.Name, Item.Quantity, Item.Price, Item.Condition FROM Item INNER JOIN Seller ON Item.SellerID = Seller.SellerID INNER JOIN Member ON Seller.MemberID = Member.MemberID WHERE (Item.Status = 'Available') or (Item.Status = 'Quantity') ORDER By NEWID() "Dim mycommand2 AsNewSqlCommand(query, conss)Dim category AsSqlDataReader
            category = mycommand2.ExecuteReader()'-- I have just written here sample binding.. you may require to write code to connect to db and fetch data to bind grid
            Dim dt As New DataTable()
            dt.Columns.Add(New DataColumn("Name"))
            dt.Columns.Add(New DataColumn("Quantity"))
            dt.Columns.Add(New DataColumn("Price"))
            dt.Columns.Add(New DataColumn("Condition"))

            For i As Integer = 1 To 12
                Dim dr As DataRow = dt.NewRow()
                dr("col1") = i
                dt.Rows.Add(dr)
            Next
            '--useDefaultView to filter the recordsDim dw AsDataView= dt.DefaultView
            dw.RowFilter="Col1 like '%"+ txtSearch.Text.Trim()+"%'"Repeater1.DataSource= dwRepeater1.DataBind()EndUsingEndSub

ModalPopupExtender Panel location is move by the other controls while modalpopup X, Y properties are not working

$
0
0

First Problem:

I am using modalpopupextender to show a message on page_load according to a criteria. I am using a Panel "pnlpopup" to show the message. When the page_load, the panel is shown.

The markup view is as follow:

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="Testing_Default" %><%@ 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"><html xmlns="http://www.w3.org/1999/xhtml"><head runat="server"><title></title><style type="text/css">
    .modalBackground
    {
        background-color:Gray ;
    }
    .modalPopup
    {
        background-color:#00CC66 ;
        border-width: 3px;
        border-style: solid;
        border-color: black;
        width: 300px;
        height: 140px;
    }
    .BtnStyle
    {
        width:100px;
        height:30px;
        margin-top:30px;
        font-family:Sakkal Majalla;
        font-size:18px;
    }
    .LblStyle
    {
        font-family:Sakkal Majalla;
        font-size:20px;
    }</style></head><body><form id="form1" runat="server"><cc1:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server"></cc1:ToolkitScriptManager><script language="javascript" type="text/javascript">
            //Function to Hide ModalPopUp
            function Hidepopup() {
                $find('ModalPopupExtender1').hide();
            }
            //Function to Show ModalPopUp
            function Showpopup() {
                $find('ModalPopupExtender1').show();
            }</script><div><asp:Button ID="btnShowPopup"  runat="server" Style="display:none" /><cc1:ModalPopupExtender ID="ModalPopupExtender1" runat="server" X="900" Y="400"   TargetControlID="btnShowPopup" PopupControlID="Panel1" BackgroundCssClass="modalBackground" ></cc1:ModalPopupExtender><asp:Panel ID="pnlpopup" runat="server" CssClass="modalPopup"  Style="display:none" ><table id="Tbl" runat="server" ><tr><td align="center"><asp:label ID="Lbl" runat="server" CssClass="LblStyle"  Text="You can not forward the letter because the period finished. You can only make replying"></asp:label></td></tr><tr><td align="center"  ><asp:Button ID="btnYes" runat="server" Text="OK" CssClass="BtnStyle"  /></td></tr></table></asp:Panel></div></form></body></html>

The running result page is shown on the link:

 http://postimg.org/image/frh5itvpj/

However, when I add object (image) to the page, the panel is moved by the new object and shifted down, while it is supposed to appear on its same location before the new object is added. The panel should be shown on the very front layer of the page so the user interact directly with it.

The aspx markup view after adding the object (image) - Bolded Code is the extra code to add the image -  to the page:

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="Testing_Default" %><%@ 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"><html xmlns="http://www.w3.org/1999/xhtml"><head runat="server"><title></title><style type="text/css">
    .modalBackground
    {
        background-color:Gray ;
    }
    .modalPopup
    {
        background-color:#00CC66 ;
        border-width: 3px;
        border-style: solid;
        border-color: black;
        width: 300px;
        height: 140px;
    }
    .BtnStyle
    {
        width:100px;
        height:30px; 
        margin-top:30px; 
        font-family:Sakkal Majalla;
        font-size:18px;   
    }
    .LblStyle
    {
        font-family:Sakkal Majalla;
        font-size:20px;
    }   </style></head><body><form id="form1" runat="server"><cc1:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server"></cc1:ToolkitScriptManager>  <script language="javascript" type="text/javascript">
            //Function to Hide ModalPopUp
            function Hidepopup() {$find('ModalPopupExtender1').hide();
            }
            //Function to Show ModalPopUp
            function Showpopup() {$find('ModalPopupExtender1').show();
            }</script><div id="MainFields" runat="server"><table id="MainTable" runat="server" width="100%" ><tr><td><asp:Image ID="Image3" runat="server" Width="275px" Height="125px"   
                        ImageUrl="~/Images/MurasalatLogo.png" /></td></tr></table>  </div> <div><asp:Button ID="btnShowPopup"  runat="server" Style="display:none" /><cc1:ModalPopupExtender ID="ModalPopupExtender1" runat="server" X="900" Y="400"   TargetControlID="btnShowPopup" PopupControlID="Panel1" BackgroundCssClass="modalBackground" ></cc1:ModalPopupExtender> <asp:Panel ID="pnlpopup" runat="server" CssClass="modalPopup"  Style="display:none" ><table id="Tbl" runat="server" ><tr><td align="center"><asp:label ID="Lbl" runat="server" CssClass="LblStyle"  Text="You can not forward the letter because the period finished. You can only make replying"></asp:label></td></tr><tr><td align="center"  ><asp:Button ID="btnYes" runat="server" Text="OK" CssClass="BtnStyle"  /> </td>                         </tr></table>   </asp:Panel></div></form></body></html>

The running result of the page after adding the object is shown on the link:

http://postimg.org/image/evj7cbhcx/

Second Problem: The X and Y properties of the ModalPopupExtender are not working. I tried to changes them three times with much different values, but the position of the pnlpopup are kept the same with no any change.

Third Problem:

When the Background is kept same before the pnlpopup and after appearence of the pnlpopup even that  I set the modalpopupextender BackgroundCssClass property to be grey through assign it to modalbackground which set the background-color to grey as follow

.
.
<style type="text/css">
    .modalBackground
    {
        background-color:Gray ;
    }
.
.
.
<cc1:ModalPopupExtender ID="ModalPopupExtender1" . . . BackgroundCssClass="modalBackground"....>

So Whete is the problem and what are the mistakes I made?

Accordion Tabs are not getting expanded in Firefox, Chrome

$
0
0

Hello All Forum Members,
In my asp.net application, I have used Ajax Toolkit Accordion Control for .net framework v3.5.
I have added it successfully in web page. It works fine in Internet Explorer.
I am using Doctype <!DOCTYPE html>
But, Accordion Tabs are not getting expanded in Firefox, Chrome on accordion header click.
Please Help me.

Hide or Show Div based on media from Ajax.ActionLink

$
0
0

When an audio or video "currentMedia" starts, I want a div ".next" to be hidden, and when the media is done playing, I want the div ".next" to show.

The trick is, "currentMedia" div containing the audio or video media content is replaced on clicking ".next" using @Ajax.ActionLink, so I am trying to figure out how to get jQuery to recognize it and run the function to show ".next" each time media ends, and hide it when the next media is loaded via Ajax.

Here is some of my jQuery - both of these work fine by themselves.

$(document).ready(function () {$(".next").hide();
});$(document).ready(function () {$("#currentMedia").on("ended", function () {$(".next").show();
    });
});

Here is the View code:

<div class="next">
        @Ajax.ActionLink("NEXT >>", "NextPmc", "Home",
        new AjaxOptions
                 {
                     HttpMethod = "GET",
                     InsertionMode = InsertionMode.Replace,
                     UpdateTargetId = "user-component-wrapper",
                 })</div><img src="@Html.DisplayFor(m => m.ComponentUrl1)" /><audio id="currentMedia" autoplay="autoplay"><source src="@Html.DisplayFor(m => m.ComponentUrl2)" /></audio>

"currentMedia" is in a PartialView.

Any help please?


TabContainer and ActiveTabChanged

$
0
0

Hi,

i have a problem with TabContainer.

The ActiveTabChanged server-side event doesn't fire when i click on tab.

Is this a bug?

Can anyone help me?

 Thanks everbody!

Ajax ModalPopup error?

$
0
0

ModalPopUp coding

<asp:RadioButton ID="modalPanel" runat="server" Text="Show Modal"/><asp:ModalPopupExtender ID="ModalPopupExtender1" runat="server" PopupControlID="popUp"
                                     TargetControlID="modalPanel" CancelControlID="modalClose" OkControlID="Button2"  BackgroundCssClass="modalBackground" DynamicServicePath="" Enabled="True"></asp:ModalPopupExtender>

Ok for button2 clicked

protected void Button2_Click(object sender, EventArgs e)
        {
           custName.Text = "Test modal";

        }

Control Property for button2

<asp:Button ID="Button2" runat="server" Text="Ok" />

apparently the custName textbox did not have the text: "Test modal" after clicking the button 2

expandable/collapsible grid using CollapsiblePanelExtender and DynamicPopulateExtender

$
0
0

Like many before me I have been trying to implement a tidy expandable/collapsible gridview where, for example, the grid initially shows a list of writers and on clicking on a suitable 'expand' button in a row the writer's works are dynamically retrieved from the database and displayed. Actually I have managed to get a reasonably tidy version to work using the Ajax Toolkit CollapsiblePanelExtender and DynamicPopulateExtender in combination with minimal additional Javascript. In case it is of any use to anyone, the key elements are as follows:

<asp:GridView runat="server" ID="Writers" DataSourceID="WritersDS" DataKeyNames="PersonID" PageSize='<%$ AppSettings: GridPageSize %>' ><Columns><asp:TemplateField ShowHeader="False" ItemStyle-VerticalAlign="Top"><ItemTemplate><asp:Image ID="ShowWorksButton" runat="server" /><ajaxToolkit:DynamicPopulateExtender ID="DPE" runat="server" PopulateTriggerControlID="ShowWorksButton" CacheDynamicResults="false" ClearContentsDuringUpdate="true" EnableViewState="False"
            ServiceMethod="GetWorks" ContextKey='<%# Eval("PersonID") %>' TargetControlID="WorksPanel" /></ItemTemplate></asp:TemplateField><asp:TemplateField HeaderText="writer" SortExpression="Surname" ItemStyle-Width="200" ItemStyle-VerticalAlign="Top"><ItemTemplate><asp:Label ID="hName" runat="server" Text='<%# Eval("Name")%>' /></ItemTemplate></asp:TemplateField><asp:TemplateField ItemStyle-Width="750"><ItemTemplate><asp:Panel ID="WorksPanel" runat="server" EnableViewState="false" style="height:auto;min-height:36px;max-height:124px;overflow:auto"/><ajaxToolkit:CollapsiblePanelExtender ID="CPE" ClientIDMode="Static" runat="server" TargetControlID="WorksPanel" ExpandControlID="ShowWorksButton" CollapseControlID="ShowWorksButton"
            ImageControlID="ShowWorksButton" CollapsedImage="~/images/expand.png" ExpandedImage="~/images/collapse.png"
            Collapsed="True" CollapsedSize="0" ExpandedSize="124" ScrollContents="True" AutoCollapse="False" AutoExpand="False" /></ItemTemplate></asp:TemplateField></Columns>

And in code behind:

<WebMethod()> _<ScriptMethod()> _
    Public Shared Function GetWorks(ByVal contextKey As String) As String
        Dim dal As New DAL
        Dim personid As Integer = CInt(contextKey)
        Dim html As StringBuilder = New StringBuilder
        html.Append("<table><col width='480px'</col><col width='70px'</col><col width='110px'</col><col width='35px'</col><col width='50px'</col>")
        html.Append("<tr><th style='text-align:left;'>title</th><th style='text-align:left;'>form</th><th style='text-align:left;'>genre</th><th>written</th><th>owned</th></tr>")
        Dim works As List(Of LiteraryWorkInfo) = dal.GetSelectedWorksByWriter(personid)
        Dim owned As String = ""
        For Each work As LiteraryWorkInfo In works
            html.Append("<tr><td><a href='workform.aspx?id=" & work.WorkID.ToString() & "'>" & work.Title & "</a></td><td>" & work.Form & "</td><td>" & work.Genre & "</td><td style='text-align:center'>" & work.Written & "</td><td style='text-align:center'>" & work.Owned & "</td></tr>")
        Next
        html.Append("</table>")
        Return html.ToString()
    End Function

It is also necessary to make the CPE IDs unique (it is probably possible to do this declaratively):

    Protected Sub WireUpWorks(ByVal s As Object, ByVal e As GridViewRowEventArgs) Handles Writers.RowCreated
        If e.Row.RowType = DataControlRowType.DataRow Then
            Dim cpe As CollapsiblePanelExtender = CType(e.Row.FindControl("CPE"), CollapsiblePanelExtender)
            Dim id As String = String.Concat("CPE", e.Row.RowIndex)
            cpe.BehaviorID = id
        End If
    End Sub

And like others I have found it necessary to add some Javascript to smooth the animation (why this could not have been the default or at least easily changeable I do not know) and to provide an accordion-like effect:

function pageLoad(sender, args) {
    for (num = 0; num < 20; num++) {
        var cpe = $find("CPE" + num);
        if (cpe) {
            cpe.add_expanding(accordion);
            cpe._animation._fps = 45;
            cpe._animation._duration = 0.4;
        }
    }
}
function accordion(sender, arg) {
    for (num = 0; num < 20; num++) {
        var cpe = $find("CPE" + num);
        if (cpe) {
            if (sender._expandControlID != cpe._expandControlID)
                cpe.collapsePanel(cpe._expandControlID);
        }
    }
}

All of this works surprisingly well, but there are some irritating aspects which I have not been able to fix. I have limited the maximum height of the works panel in order to prevent the overall height of the grid causing vertical scrolling of the page. But what I would really like is for the CPE ExpandedSize to reflect the actual height of the panel (i.e. equivalent to 'auto'). But this does not appear possible and I have had to set ExpandedSize to the same value as the panel's maximum height (not setting ExpandSize at all has the surprising effect of causing the panel to pop out to the full size of the actual content with no animation, completely ignoring the CSS on the panel itself). As a result, the panel always expands to this height even if there is less actual content. And what is even more irritating is that there is a 'disabled' vertical scrollbar in the panel even if no scrolling is required (and if I remove ScrollContents="True" from the extender then, perhaps less surprisingly, there is no scrolling, despite the panel CSS). What I do not know is whether this is a CSS issue or something to do with the extender. Either way, I would be grateful for any suggestions how to fix this.

Jon

Dynamic UserControl Textchange won't fire inside modal popup

$
0
0

Hi been searching for the whole week to solve my problem but I still haven't fegure it out.

how to Update my user control without closing the modal popup,

I'm loading a user control programmatically from my Master Page/Main Page 

Default.aspx.vb

    Protected Sub img1_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles img1.Click

        Dim u As Control = LoadControl("~/WebUserControl.ascx")
        Dim txt As New TextBox
        txt = CType(u.FindControl("txtName"), TextBox)
        txt.Text = "Michel"

        UcPlaceHolder.Controls.Add(u)
        MPEUC.Show()
    End Sub
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %><%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %><%@ Reference Control="~/WebUserControl.ascx" %><!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>Dynamic User Control</title></head><body><form id="form1" runat="server"><ajaxToolkit:ToolkitScriptManager ID ="AjaxScriptManager" runat ="server" /><asp:HiddenField ID = "hidden" runat="server" /><ajaxToolkit:ModalPopupExtender ID="MPEUC" runat="server" PopupControlID="divPopUp"
            CancelControlID="btnClose2"
            TargetControlID="hidden">            </ajaxToolkit:ModalPopupExtender>   <div id="divPopUp" style="display: none;"><asp:panel runat="server" ID="PanelBg"><fieldset><legend>Update Panel</legend>                <div><asp:Panel id="UcPlaceHolder" runat="server"></asp:Panel>                                     <asp:Button ID="btnClose2" runat="server" Text="Close" />                                </div></fieldset></asp:panel></div>         <asp:ImageButton ID="img1" runat="server" Height="16px" Width="117px" /></form></body></html>


My User Control

WebUserControl.ascx.vb

Partial Class WebUserControl
    Inherits System.Web.UI.UserControl

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

    End Sub


    Protected Sub txtAge_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtAge.TextChanged
        Me.output.Text = String.Format("I`m {0} years old.", Me.txtAge.Text)
    End Sub

    Protected Sub txtName_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtName.TextChanged
        Me.output.Text = String.Format("Hi!, my name is {0}. ", Me.txtName.Text)
    End Sub
End Class

<%@ Control Language="VB" AutoEventWireup="false" CodeFile="WebUserControl.ascx.vb" Inherits="WebUserControl" %><asp:UpdatePanel ID="UpdateBcode" runat="server" UpdateMode="Conditional">    <Triggers>        <asp:AsyncPostBackTrigger ControlID="txtName"  EventName="TextChanged" /><asp:AsyncPostBackTrigger ControlID="txtAge"  EventName="TextChanged" /></Triggers><ContentTemplate><div><label>Name:</label><asp:TextBox ID="txtName"  runat="server" AutoPostBack="true" /><br /><label>Age  :</label><asp:TextBox ID="txtAge" runat="server" AutoPostBack="true" /><br /><br /><asp:Label ID="output" runat="server" Text=""></asp:Label></div></ContentTemplate></asp:UpdatePanel>

Could not load file or assembly 'AjaxControlToolkit' or one of its dependencies. Access is denied.

$
0
0

I just installed AJAX Beta 2 and the updated AjaxControlToolkit. I'm getting this error when I try to access the site. Any Ideas?

 

Stack Trace:

[FileLoadException: Could not load file or assembly 'AjaxControlToolkit' or one of its dependencies. Access is denied.]
System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection) +0
System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +211
System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +141
System.Reflection.Assembly.Load(String assemblyString) +25
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +32

[ConfigurationErrorsException: Could not load file or assembly 'AjaxControlToolkit' or one of its dependencies. Access is denied.]
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +596
System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +3487305
System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai) +46
System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +177
System.Web.Compilation.WebDirectoryBatchCompiler..ctor(VirtualDirectory vdir) +267
System.Web.Compilation.BuildManager.BatchCompileWebDirectoryInternal(VirtualDirectory vdir, Boolean ignoreErrors) +36
System.Web.Compilation.BuildManager.BatchCompileWebDirectory(VirtualDirectory vdir, VirtualPath virtualDir, Boolean ignoreErrors) +429
System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath) +73
System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) +580
System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) +93
System.Web.Compilation.BuildManager.GetVirtualPathObjectFactory(VirtualPath virtualPath, HttpContext context, Boolean allowCrossApp, Boolean noAssert) +111
System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(VirtualPath virtualPath, Type requiredBaseType, HttpContext context, Boolean allowCrossApp, Boolean noAssert) +54
System.Web.UI.PageHandlerFactory.GetHandlerHelper(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath) +31
System.Web.UI.PageHandlerFactory.System.Web.IHttpHandlerFactory2.GetHandler(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath) +40
System.Web.HttpApplication.MapHttpHandler(HttpContext context, String requestType, VirtualPath path, String pathTranslated, Boolean useAppConfig) +139
System.Web.MapHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +120
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155

Only 2 TabPanel Content is displaying

$
0
0

Hi,

I am having TabCotainer with 6 TabPanels, but only first 2 Tabs content is dispalying , when i interchange to second tab content is display

Here is my design

<ajax:TabContainer ID="tcDocDetails" CssClass="Tab" ActiveTabIndex="5" runat="server"
Height="450px" ScrollBars="Auto">
<ajax:TabPanel ID="tabPnlSummary" runat="server" HeaderText="Summary" Visible="false">
<ContentTemplate>
<div class="head_text">
<span class="bigtext">Document Summary</span>
</div>
<div class="clearfix">
<ucDocumentSummary:DocumentSummary ID="ucDocumentSummary" runat="server" />
</div>
</ContentTemplate>
</ajax:TabPanel>
<ajax:TabPanel ID="tabPnlNames" runat="server" HeaderText="Names" Visible="false">
<ContentTemplate>
<asp:UpdatePanel ID="upPnlNames" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="head_text">
<span class="bigtext">Document Names</span>
</div>
<div class="clearfix">
<ucDocumentSummary:DocumentSummary ID="ucDocumentSummaryNames" runat="server" />
</div>
<div id="divBookTypeNoPage" runat="server" class="clearfix" style="">
<div class="grid_5 us form_label">
Book Type / Number /Page:</div>
<div class="grid_7 omega form_label">
<div runat="server" id="divbooktype">
</div>
</div>
</div>
<div class="clearfix" style="height: 10px;" />
<div class="clearfix">
<div class="clearfix mar-5t pad-5" runat="server" id="divdocumentnames" style="max-height: 400px;
overflow-y: auto;">
<asp:GridView ID="gvNames" runat="server" CssClass="normalgrid docdetail_grid" ShowHeader="False"
PageSize="10" OnPreRender="gvNames_PreRender">
</asp:GridView>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</ContentTemplate>
</ajax:TabPanel>
<ajax:TabPanel ID="tabPnlCrossRef" runat="server" HeaderText="Cross Reference" Visible="false">
<ContentTemplate>
<asp:UpdatePanel ID="upPanelCR" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="head_text">
<span class="bigtext">Cross Reference</span>
</div>
<div class="clearfix">
<ucDocumentSummary:DocumentSummary ID="ucDocumentSummaryCR" runat="server" />
</div>
<div class="clearfix" style="height: 10px;" />
<%--<div class="clearfix" style="">
<asp:GridView ID="gvCrossReference" runat="server">
<Columns>
<asp:BoundField ReadOnly="True" HeaderText="Date" DataField="Date" />
<asp:BoundField ReadOnly="True" HeaderText="Document Class" DataField="DocumentClass" />
<asp:BoundField ReadOnly="True" HeaderText="Filing Code" DataField="FilingCode" />
<asp:BoundField ReadOnly="True" HeaderText="Document Number" DataField="DocumentNumber" />
<asp:BoundField ReadOnly="True" HeaderText="Primary Name" DataField="PrimaryName" />
<asp:BoundField ReadOnly="True" HeaderText="Document Status" DataField="DocumentStatus" />
</Columns>
</asp:GridView>
</div>--%>
</ContentTemplate>
</asp:UpdatePanel>
</ContentTemplate>
</ajax:TabPanel>
<ajax:TabPanel ID="tabPnlRelatedDocument" runat="server" HeaderText="Related Document"
Visible="false">
<ContentTemplate>
<asp:UpdatePanel ID="upPnlRD" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="head_text">
<span class="bigtext">Related Document</span>
</div>
<div class="clearfix">
<ucDocumentSummary:DocumentSummary ID="ucDocumentSummaryRD" runat="server" />
</div>
<div class="clearfix" style="height: 10px;" />
<div class="clearfix" style="">
<asp:GridView ID="gvRelatedDocuments" runat="server">
<Columns>
<asp:BoundField ReadOnly="True" HeaderText="Seq#" DataField="Seq#" />
<asp:BoundField ReadOnly="True" HeaderText="Document Date" DataField="DocumentDate" />
<asp:BoundField ReadOnly="True" HeaderText="Filing Code" DataField="FilingCode" />
<%--<asp:BoundField ReadOnly="True" HeaderText="Comment" DataField="Comment" />--%>
</Columns>
</asp:GridView>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</ContentTemplate>
</ajax:TabPanel>
<ajax:TabPanel ID="tabPnlAddInfo" runat="server" HeaderText="Additional Info" Visible="false">
<ContentTemplate>
<asp:UpdatePanel ID="upPnlAI" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="head_text">
<span class="bigtext">Additional Info</span>
</div>
<div class="clearfix">
<ucDocumentSummary:DocumentSummary ID="ucDocumentSummaryAI" runat="server" />
</div>
<div class="clearfix" style="height: 10px;" />
<%--<div class="clearfix" style="">
<asp:GridView ID="gvAdditionalInfo" runat="server">
<Columns>
<asp:BoundField ReadOnly="True" HeaderText="Date" DataField="Date" />
<asp:BoundField ReadOnly="True" HeaderText="Document Class" DataField="DocumentClass" />
<asp:BoundField ReadOnly="True" HeaderText="Filing Code" DataField="FilingCode" />
<asp:BoundField ReadOnly="True" HeaderText="Document Number" DataField="DocumentNumber" />
<asp:BoundField ReadOnly="True" HeaderText="Primary Name" DataField="PrimaryName" />
<asp:BoundField ReadOnly="True" HeaderText="Document Status" DataField="Document Status" />
</Columns>
</asp:GridView>
</div>--%>
</ContentTemplate>
</asp:UpdatePanel>
</ContentTemplate>
</ajax:TabPanel>
<ajax:TabPanel ID="tabPnlJournals" runat="server" HeaderText="Journals" Visible="false">
<ContentTemplate>
<asp:UpdatePanel ID="upPnlJR" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="head_text">
<span class="bigtext">Journals</span>
</div>
<div class="clearfix">
<ucDocumentSummary:DocumentSummary ID="ucDocumentSummaryJR" runat="server" />
</div>
<div class="clearfix" style="height: 10px;" />
<div class="clearfix">
<asp:GridView ID="gvJournals" AutoGenerateColumns="false" runat="server">
<Columns>
<asp:BoundField ReadOnly="True" HeaderText="Seq#" DataField="Seq#" />
<asp:BoundField ReadOnly="True" HeaderText="Journal Expiration" DataField="JournalsExpiredDate" />
<asp:BoundField ReadOnly="True" HeaderText="Box Number" DataField="BoxNumber" />
<asp:BoundField ReadOnly="True" HeaderText="Journals Received" DataField="JournalsReceived" />
<asp:BoundField ReadOnly="True" HeaderText="Number of Envelopes" DataField="EnvelopesCount" />
<asp:BoundField ReadOnly="True" HeaderText="Dates Covered" DataField="DatesCovered" />
<asp:TemplateField HeaderText="Reboxed After Retrieval">
<ItemTemplate>
<asp:Label ID="lblReboxedAfterRetrieval" Text='<%# Convert.ToInt16(Eval("IsReboxedAfterRetrieval"))==1?"Yes":"No" %>'
runat="server" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</ContentTemplate>
</ajax:TabPanel>
<ajax:TabPanel ID="tabPnlSignVerification" runat="server" HeaderText="Signature Verification"
Visible="false">
<ContentTemplate>
<asp:UpdatePanel ID="upPnlSV" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="head_text">
<span class="bigtext">Signature Verification</span>
</div>
<div class="clearfix">
<ucDocumentSummary:DocumentSummary ID="ucDocumentSummarySV" runat="server" />
</div>
<div class="clearfix" style="height: 10px;" />
<div class="clearfix">
<asp:GridView ID="gvSV" runat="server" AutoGenerateColumns="false">
<Columns>
<asp:BoundField ReadOnly="True" HeaderText="Seq#" DataField="Seq#" />
<asp:BoundField ReadOnly="True" HeaderText="Document Name" DataField="DocumentName" />
<asp:BoundField ReadOnly="True" HeaderText="Signed By" DataField="SignedBy" />
<asp:BoundField ReadOnly="True" HeaderText="Acknowledgment Date" DataField="AcknowledgementDate" />
<asp:BoundField ReadOnly="True" HeaderText="Print Quantity" DataField="PrintQuantity" />
</Columns>
</asp:GridView>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</ContentTemplate>
</ajax:TabPanel>
<ajax:TabPanel ID="tabPnlImageViewer" runat="server" HeaderText="Image" Visible="false">
<ContentTemplate>
<%--<asp:UpdatePanel ID="updPnlImage" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<ucimage:imageviewer id="ucImageViewer" runat="server" />
</ContentTemplate>
</asp:UpdatePanel>--%>
</ContentTemplate>
</ajax:TabPanel>
</ajax:TabContainer>

Please help me

Thanks!

Srinivasa Rao Ranga

how to prevent for closing of modalpopupextender due to refresh in asp.net

$
0
0

I have a modalpopup extender from which i am importing excel. But when excel imports the page get postback and my pop up closed. when i again click on the button it open in same state. I want that this pop should not close. Please suggest me.       


How to bind data to repeater without postback

$
0
0

so i have created a repeater, which display duration of each product, now i want that the when a duration finish, it remove the item without postback can someone help please

here are my code

Imports System.Data
Imports System.Data.SqlClient
Imports System.Configuration
Imports System.Net.Mail
Imports System.Web.Configuration
Imports System.Web.Script.Services
Imports System.Web.Services
Partial Class Test
    Inherits System.Web.UI.Page
    Dim con As New SqlConnection(ConfigurationManager.ConnectionStrings("VirgoPlaza").ToString())
    Dim EndDate As DateTime
    Dim auction As Integer

    Private ReadOnly _start As String
    Public Sub New()
        _start = WebConfigurationManager.ConnectionStrings("VirgoPlaza").ConnectionString
    End Sub
    Public Function GenerateURL(ByVal Auction As Object) As String

        'Create URL for each product link
        Dim strProdUrl As String = "Wishlist.aspx?Pid=" & Auction

        Return strProdUrl
    End Function
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Not Page.IsPostBack Then
            BindItems()
        End If

    End Sub
    Protected Sub Timer1_Tick(ByVal sender As Object, ByVal e As EventArgs)
        '--this method will fetch the end date from repeater item label and update the duration
        UpdateDuration()
    End Sub
    Private Sub UpdateDuration()
        For Each item As RepeaterItem In repItems.Items

            Dim hidden = TryCast(item.FindControl("HiddenField1"), HiddenField)

            Dim label2 = TryCast(item.FindControl("lblTimer"), Label)
            'Grab your DateTime object (checking that it exists)'

            'Store your TimeSpan Difference'
            Dim ts = (DateTime.Now - DateTime.Parse(hidden.Value))
            Dim travelTime As New TimeSpan(0, 0, 0, 0)
            Dim result2 As Integer = TimeSpan.Compare(ts, travelTime)
            If result2 <= 0 Then

                'Now you can output your time as you please (excluding any decimal points)'
                label2.Text = String.Format("Time Left: {0:dd\:hh\:mm\:ss}", ts)
                label2.Text = String.Format("{0:dd\:hh\:mm\:ss}", ts)
                label2.Text = Replace(label2.Text, ":", " Days ", , 1)
                label2.Text = Replace(label2.Text, ":", " Hours ", , 1)
                label2.Text = Replace(label2.Text, ":", " Mins ", , 1)
                label2.Text = Replace(label2.Text, ":", " Sec ", , 1)


            Else

                timer1.Enabled = True
                BindItems()
               






            End If
        Next
    End Sub
    Private Sub BindItems()
        Using con1 As New SqlConnection(_start)


            Dim sql1 As String = "[StoredProcedure2]"

            Dim myCommand1 As New SqlCommand(sql1, con1)
            myCommand1.CommandType = CommandType.StoredProcedure
            myCommand1.Parameters.AddWithValue("@endate", DateTime.Now)



            con1.Open()

            Dim category As SqlDataReader
            category = myCommand1.ExecuteReader()

            'binding data from category table to ddlcategory
            repItems.DataSource = category
            repItems.DataBind()

        End Using
<%@ Page Title="" Language="VB" MasterPageFile="~/Part1/MasterPage.master" AutoEventWireup="false" CodeFile="Test.aspx.vb" Inherits="Test" %><asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server"></asp:Content><asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"><asp:ScriptManager ID="ScriptManager1" runat="server" /><asp:repeater id="repItems"  runat="server"><HeaderTemplate><ul></HeaderTemplate><ItemTemplate><li><center> <a href="../ProductDetails/ProductDetailOffline.aspx?ItemID=<%# Eval("ItemID") %>"> <asp:Image id="Image1" runat="server" ImageUrl='<%# Eval("Image")%>' /></a></center><div class="product-info"><h3><asp:Label ID="Label1" runat="server" Text='<%# Eval("Name")%>'></asp:Label> </h3><div class="product-desc"><table width="200px" border="0"><tr><td align="center" style="background-color:#7F7F7F; color:White;">Price</td></tr><tr><td align="center">Rs.&nbsp;<asp:Label ID="Label4" Text='<%#String.Format("{0:###,###.00}", Eval("CurrencyValuePost"))%>' runat="server" Font-Bold="true" /></td></tr><tr><td align="center"  style="background-color:#7F7F7F; color:White;">
                            Time Left</td></tr><tr><td align="center"><asp:UpdatePanel id="updPnl" runat="server" UpdateMode="Conditional"><ContentTemplate><asp:Label ID="lblTimer"   runat="server"></asp:Label></ContentTemplate><triggers><asp:asyncpostbacktrigger ControlID="timer1" eventname="tick" /></triggers></asp:UpdatePanel></td></tr></table><asp:Label ID="lblauction" Visible="false" Text='<%#Eval("AuctionID")%>' runat="server" /><asp:Label ID="lblEndDate" Visible="false" Text='<%#Eval("EndDate")%>' runat="server" /><asp:HiddenField ID="HiddenField1" Value='<%#Eval("EndDate")%>' runat="server" /><a href='<%#GenerateURL(Eval("AuctionID"))%>' style="border: 0 none white"><br/> <p></a></li></ItemTemplate><FooterTemplate></ul></FooterTemplate></asp:repeater><asp:UpdatePanel ID="UpdatePanel1" runat="server"><ContentTemplate><asp:Timer ID="timer1" Interval="1000" Enabled="true" OnTick="timer1_tick" runat ="server"></asp:Timer></ContentTemplate></asp:UpdatePanel></asp:Content><asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder2" Runat="Server"></asp:Content>



Sys is undefined error Ajax 1.0

$
0
0

Hi

We have an old website on .NET framework 2.0 with Ajax 1.0 (AjaxControlToolkit.DLL version 1.0.11119.0). It used to run fine for few years, We recently moved this website to a new Windows 2008 server (.NET framework 4.0). The website works fine but whereever Ajax was used it shows up a message 'Sys' is undefined. I found numerous info on web about this error, but none worked for me. I certainly am missing something.

I checked the bin folder for the AjaxControlToolkit.dll and web.config for the required entries.(infact everything just copied from old machine win 2000 server)

One observation is, when i run the website from IDE (Press F5) (using localhost:3508/Website/Webpage.aspx) the Ajax works perfect, but when i run it via IIS it does not work and shows the error.

Please someone suggest what is missed and what needs checking.

Thanks

John

clear/reset xmlhttprequest and form data

$
0
0

Hi,

i use XMLHttpRequest to upload files. Below is all the code i use to upload from a modal window. 

<span><a href="#" id="modchart-d">Insert chart</a></span><script type="text/javascript">$(document).ready(function ()
    {

// modal charts //
(function (hpeduinvest, $, undefined) {$(function () {$('#modchart-d').bind('click', function () {$('#chart-d').css({
                'min-height': '500px',
                'left': '0px',
                'right': '0px',
                'top': '0px',
                'margin-left': 'auto',
                'margin-right': 'auto',
                'display': 'block'
            }).show();
        });
    });
}(window.hpeduinvest = window.hpeduinvest || {}, jQuery));
// end modal charts //

    // upload file

    function fileSelected()
    {
        var file = document.getElementById('fileToUpload').files[0];
        if (file && file.type == "image/png")
        {
            var fileSize = 0;
            if (file.size > 1024 * 1024)
                fileSize = (Math.round(file.size * 100 / (1024 * 1024)) / 100).toString() + 'MB';
            else
                fileSize = (Math.round(file.size * 100 / 1024) / 100).toString() + 'KB';
            document.getElementById('message').innerHTML = 'File name: ' + file.name + '<br>' + 'File size: ' + fileSize;
        }
        else
        {
            document.getElementById('message').innerHTML = "Please select .png files";
        }
    }

    function uploadFile()
    {
        var file = document.getElementById('fileToUpload').files[0];
        if (file && file.type == "image/png")
        {
            var fd = new FormData();
            fd.append("fileToUpload", file);
            var xhr = new XMLHttpRequest();
            xhr.upload.addEventListener("progress", uploadProgress, false);
            xhr.addEventListener("load", uploadComplete, false);
            xhr.addEventListener("error", uploadFailed, false);
            xhr.addEventListener("abort", uploadCanceled, false);
            xhr.open("POST", "/pages/ajax/upload");
            xhr.send(fd);
        }
    }

    function uploadProgress(evt)
    {
        if (evt.lengthComputable)
        {
            var percentComplete = Math.round(evt.loaded * 100 / evt.total);
            document.getElementById('progressNumber').innerHTML = percentComplete.toString() + '%';
            document.getElementById('progressn').value = percentComplete;
        }
        else
        {
            document.getElementById('progressNumber').innerHTML = 'unable to compute';
        }
    }

    function uploadComplete(evt)
    {

        $('#updata')[0].reset();$('#insertchart').show();$('#insertchart').click(function ()
        {
            var txt = $('#Content').val();
            var cur_pos = $('#Content').getCursorPosition();
            var htmlString = '<img src=\"/charts/' + evt.target.responseText.replace(/\r?\n|\r/g, "") + '\" alt="Chart">';
            if (cur_pos != 0)
            {$('#Content').val(txt.substring(0, cur_pos) + " " + htmlString + " " + txt.substring(cur_pos));
            }
            else
            {$('#Content').val(htmlString + " " + txt);
            }$('#chartname').val(evt.target.responseText.replace(/\r?\n|\r/g, ""));
            return false;
        });
    }

    function uploadFailed(evt)
    {
        alert("There was an error attempting to upload the file.");
    }
    function uploadCanceled(evt)
    {
        alert("The upload has been canceled by the user or the browser dropped the connection.");
    }</script><div id="chart-d">
        Upload chart <form enctype="multipart/form-data" method="post" action="" id="updata"><input type="file" id="fileToUpload" accept="image/png" onchange="fileSelected();"><a href="#" onclick="uploadFile()">Confirm upload</a></form><span id="progressNumber"></span><progress id="progressn" max="100" value="0"></progress> <div id="message"></div><a href="#" id="insertchart" onclick="$('#chart-d').hide();" style="display: none">Insert chart</a><a href="#" onclick="$('#chart-d').hide();">Exit</a></div>

I'm looking for a function to reset or clear the entire data (reset XMLHttpRequest) or open the new window as the page was first loaded if this links are clicked:

<a href="#" id="insertchart" onclick="$('#chart-d').hide();" style="display: none">Insert chart</a> 
<a href="#" onclick="$('#chart-d').hide();">Exit</a>

Autocomplete Demonstration Issue- Not replacing full text

$
0
0

Hi

I have used Autocomplete extender to search records in my ecommerce website.

When I select a record from recommended list of results, it does not replaces complete text in search bar. It only replaces the last word.

For Example : if i type Dell Vostro and i choose a result from recommended list of results (Dell Vostro 520), it replaces only "Vostro" and gives Dell Dell Vostro 520.

How to replace full text. I am using the same code as provided in the sample toolkit.

textbox

Viewing all 5678 articles
Browse latest View live


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