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

Circular Reference with Complex Type

$
0
0

I have created a webservice that returns a complex type.  This is the xml that is returned from the webservice:

<NinjaRouteEntity xmlns="http://tempuri.org/">
  <Entity NinjaRouteID="1" xmlns="">
    <AlwaysFetchToRegion>False</AlwaysFetchToRegion>
    <TimeFrameReturnsNewIfNotFound>True</TimeFrameReturnsNewIfNotFound>
    <AlwaysFetchFromRegion>False</AlwaysFetchFromRegion>
    <EntityCollectionReference PropertyName="PointCollectionViaNinjaRouteVector">
      <PointCollectionViaNinjaRouteVector>
        <Entities />
        <AllowRemove>False</AllowRemove>
        <AllowEdit>True</AllowEdit>
        <AllowNew>True</AllowNew>
      </PointCollectionViaNinjaRouteVector>
    </EntityCollectionReference>
    <ToRegionReturnsNewIfNotFound>True</ToRegionReturnsNewIfNotFound>
    <EntityReference PropertyName="TimeFrame" />
    <EntityReference PropertyName="FromRegion" />
    <IsNew>False</IsNew>
    <FromRegionReturnsNewIfNotFound>True</FromRegionReturnsNewIfNotFound>
    <AlwaysFetchNinjaRouteVector>False</AlwaysFetchNinjaRouteVector>
    <AlwaysFetchPointCollectionViaNinjaRouteVector>False</AlwaysFetchPointCollectionViaNinjaRouteVector>
    <EntityReference PropertyName="ToRegion" />
    <AlwaysFetchTimeFrame>False</AlwaysFetchTimeFrame>
    <AlwaysFetchSuggestedRouteCollectionViaNinjaSuggestedRoute>False</AlwaysFetchSuggestedRouteCollectionViaNinjaSuggestedRoute>
    <EntityCollectionReference PropertyName="SuggestedRouteCollectionViaNinjaSuggestedRoute">
      <SuggestedRouteCollectionViaNinjaSuggestedRoute>
        <Entities />
        <AllowRemove>False</AllowRemove>
        <AllowEdit>True</AllowEdit>
        <AllowNew>True</AllowNew>
      </SuggestedRouteCollectionViaNinjaSuggestedRoute>
    </EntityCollectionReference>
    <EntityCollectionReference PropertyName="NinjaSuggestedRoute">
      <NinjaSuggestedRoute>
        <Entities />
        <AllowRemove>False</AllowRemove>
        <AllowEdit>True</AllowEdit>
        <AllowNew>True</AllowNew>
      </NinjaSuggestedRoute>
    </EntityCollectionReference>
    <ObjectID>7ba4f8ed-08d5-47cb-9dcc-096725d03d69</ObjectID>
    <EntityCollectionReference PropertyName="NinjaRouteVector">
      <NinjaRouteVector>
        <Entities />
        <AllowRemove>False</AllowRemove>
        <AllowEdit>True</AllowEdit>
        <AllowNew>True</AllowNew>
      </NinjaRouteVector>
    </EntityCollectionReference>
    <AlwaysFetchNinjaSuggestedRoute>False</AlwaysFetchNinjaSuggestedRoute>
    <Fields>
      <NinjaRouteID>
        <CurrentValue>1</CurrentValue>
        <DbValue>1</DbValue>
        <IsChanged>False</IsChanged>
        <IsNull>False</IsNull>
      </NinjaRouteID>
      <Name>
        <CurrentValue>My Awesomer Route</CurrentValue>
        <DbValue>My Awesomer Route</DbValue>
        <IsChanged>False</IsChanged>
        <IsNull>False</IsNull>
      </Name>
      <Description>
        <CurrentValue>Go from here to there.</CurrentValue>
        <DbValue>Go from here to there.</DbValue>
        <IsChanged>False</IsChanged>
        <IsNull>False</IsNull>
      </Description>
      <CreatorID>
        <CurrentValue>4b4a743b-345f-4dd6-905a-bb59708491ed</CurrentValue>
        <DbValue>4b4a743b-345f-4dd6-905a-bb59708491ed</DbValue>
        <IsChanged>False</IsChanged>
        <IsNull>False</IsNull>
      </CreatorID>
      <DateCreated>
        <CurrentValue>2006-01-31T01:45:34.0000000-08:00</CurrentValue>
        <DbValue>2006-01-31T01:45:34.0000000-08:00</DbValue>
        <IsChanged>False</IsChanged>
        <IsNull>False</IsNull>
      </DateCreated>
      <FromRegionID>
        <CurrentValue>1</CurrentValue>
        <DbValue>1</DbValue>
        <IsChanged>False</IsChanged>
        <IsNull>False</IsNull>
      </FromRegionID>
      <ToRegionID>
        <CurrentValue>2</CurrentValue>
        <DbValue>2</DbValue>
        <IsChanged>False</IsChanged>
        <IsNull>False</IsNull>
      </ToRegionID>
      <TimeFrameID>
        <CurrentValue>2</CurrentValue>
        <DbValue>2</DbValue>
        <IsChanged>False</IsChanged>
        <IsNull>False</IsNull>
      </TimeFrameID>
    </Fields>
    <IsDirty>False</IsDirty>
    <EntityState>Fetched</EntityState>
    <SavedFieldSets />
  </Entity>
</NinjaRouteEntity

When I try to call it with Atlas, I see this error via Fiddler:

new Sys.Net.MethodRequestError("A circular reference was detected while serializing an object of type \'FlatlandMedia.NinjaRoutes.Dal.EntityClasses.NinjaRouteEntity\'.","   at Microsoft.Web.Script.Serialization.JavaScriptObjectSerializer.SerializeValueInternal(Object o)\r\n   at Microsoft.Web.Script.Serialization.JavaScriptObjectSerializer.SerializeValue(Object o)\r\n   at Microsoft.Web.Script.Serialization.JavaScriptObjectSerializer.SerializeCustomObject(Object o)\r\n   at Microsoft.Web.Script.Serialization.JavaScriptObjectSerializer.SerializeValueInternal(Object o)\r\n   at Microsoft.Web.Script.Serialization.JavaScriptObjectSerializer.SerializeValue(Object o)\r\n   at Microsoft.Web.Script.Serialization.JavaScriptObjectSerializer.SerializeEnumerable(IEnumerable enumerable)\r\n   at Microsoft.Web.Script.Serialization.JavaScriptObjectSerializer.SerializeValueInternal(Object o)\r\n   at Microsoft.Web.Script.Serialization.JavaScriptObjectSerializer.SerializeValue(Object o)\r\n   at Microsoft.Web.Script.Serialization.JavaScriptObjectSerializer.SerializeCustomObject(Object o)\r\n   at Microsoft.Web.Script.Serialization.JavaScriptObjectSerializer.SerializeValueInternal(Object o)\r\n   at Microsoft.Web.Script.Serialization.JavaScriptObjectSerializer.SerializeValue(Object o)\r\n   at Microsoft.Web.Services.RestHandler.ProcessRequest(HttpContext context)","System.InvalidOperationException")

Any way around this?  Are there any guidelines as to how complex a type can be?

Thanks for any help on this.


Ajax - GoDaddy shared hosting

$
0
0

I have seen a couple old posts on this, but none of them were able to solve my problem.  I am using AJAX 3.5 and have uploaded a web site to my shared GoDaddy hosting account.  I have spoken to their support, but they do not know how to fix the problem.  They did know that AJAX 3.5 was 'installed' on the server (I say it like this because it is included in the framework now).

I have created a basic testing ajax enabled web site.  It works on my development machine, but on GoDaddy's servers it gives the error:  'Could not load file or assembly 'AjaxControlToolkit' or one of its dependencies. The system cannot find the file specified.'  All the pertenant information in web.config is the 3.5.0.0 versions.

Any ideas?  Their support is no help.

Multiple Ajax call on single button click

$
0
0

I have an ASP.NET intranet search application which stores the result of the frequently searched words in the cache(memcached). When the user searches for a word that is available in the cache the application displays it from the cache instantly in a gridview and on the background it should search on the intranet pages if any new match is found on the new pages, if found, it should update the gridview automatically without post back.

How can I perform the search operation on the background and update the  gridview automatically. I have the search logic with me. Performing the operation in the background and updating the gridview automatically is the challenge. Can anyone suggest on this.

 

Please help me coding for logout in asp.net

$
0
0

Please help me coding for logout in asp.net

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

$
0
0

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

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

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

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

Same Result! :-(

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

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

Please help.

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

From this workaround I inserted

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

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

$
0
0

Hi,

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

Thanks,

Saravanan

UpdateProgress message should change on different cells clicked in a gridview

$
0
0

I have a gridview with 7 columns. I have linkbuttons in almost all the columns. This gridview is in a updatePanel and updateprogress control is there on the page. When I click on the first column(linkbutton) it should show message in updateprogres template and for all other click, it should not show that message......like udpateprogress should not be visisble. I tried cetting

Updateprogress.visible = false in rowcommandevent of gridview but it is not working.

Any ideas please???

 

Thanks,

Srijyothi. 

sorting grid view by date

$
0
0

hi ,

 

i have a gridview with date column and some other columns and i want to order it by date,

how i can do it, i searched in google but nothing is clear to me

please i need it step by step as i am new in ajax control

 


Modal doesn't show if child control is not visible

$
0
0

Hi,

I've made a modal using ModalPopupExtender. The modal works normally until I set a asp:panel to visible = false (for c#) or display:null (for css) which causes the whole modal not to display at all.

So basically, it looks like

<parentPanel>
 some other stuff<childPanel Visible="False">
    more stuff</childPanel></parentPanel>

The childPanel is only shown if the user meets a certain criteria which is checked for at codebehind 

HtmlEditorExtender image upload error

$
0
0

hi

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

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

here is code

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

and this is the code behind

using System;
using AjaxControlToolkit;


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

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

when i want to uload an image, this error occures

error

please help me

Mysql Connection...

$
0
0

Hi I get an error connecting to the database server, wonder what is the reason

Web siteaddresshttp://caddeworld.net/

Could not load file or assembly 'MySql.Data, Version=6.6.5.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d' or one of its dependencies. The system cannot find the file specified.

else

Line 11:       <compilation>
Line 12:         <assemblies>Line 13: <add assembly="MySql.Data, Version=6.6.5.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" /> 
Line 14: </assemblies> Line 15: </compilation>

Source File:C:\inetpub\vhosts\caddeworld.net\httpdocs\web.config   Line: 13

updatepanel

$
0
0

hi

i have an updatepanel

when should i set its mode to conditional?when always?

and after set to conditional,when should i write in codebehind

Authentication with old...

$
0
0

Hi..

I encounter this error when connecting to the database;

ERROR:Authentication with old password no longer supported, use 4.1 style passwords.

Web Site Address:   http://www.caddeworld.net

What is the solution?Waiting foryour helpCry

           MySqlConnection conn;
            string myConnectionString;

            myConnectionString = "server=caddeworld.net;uid=******;" + "pwd=******;database=******;";

            try
            {
                conn = new MySqlConnection(myConnectionString);
                conn.Open();
            }
            catch (MySqlException ex)
            {
                Response.Write(ex.Message);
            }

I connect the form of..

How get Cllent Id and Secret key code from pay pro account

$
0
0

Hi,

I am doing asp.net application,in this i am using pay pro payment gateway,i have found some code in google,in this i need to add ClientID and Secrete Key code.Where do i find this code i dont know please help me how to find out this Client ID and Secrete code. I am searching for this from last one week, but i did not find the solution.Please help me.

Thanks.

Code for Direct payment with paypal and Direct payment with credit card using paypal pro payment gateway

$
0
0

Hi,

I am doing website with asp.net,in this am using paypal pro payment gateway.Please  help me code Directpayment With Pay pal and Direct Payment with Credit card option code. and give me details for implementing process.

Thanks in advance.


Ajax slider control able to fill up?

$
0
0

Hey all!

I need a slider that filles with a different color when you slide with the handle. I have added a custom handle and a custom "empty" rail. Can i somehow add a "filled" rail somewhere?

Kind of like this. I already made this filled track, now i just need to add it

Thanks in advance

How to get uploads count in ajax file upload ( multiupload)

$
0
0

The ajax file upload i used from ajax control toolkit is a multiuploader , i want to retrieve the number of files being uploaded . i tried this code here : 

protected void AjaxFileUpload1_UploadComplete(object sender, AjaxControlToolkit.AjaxFileUploadEventArgs e)
        {


            String pathdirectory = (Session["StoryPath"].ToString() + "/"); // selected item.

            EnsureDirectoriesExist(pathdirectory);

            String filepathImage = @"Story/" + pathdirectory;

           HttpFileCollection uploads = HttpContext.Current.Request.Files;
                  

            for (int i = 0; i < uploads.Count ; i++)
            {
                int k = 0;
                int j = 0;

                if (j > 8)
                {
                    j = 0;
                    k += 1;
                }
                string total = k.ToString() + j.ToString();
                AjaxFileUpload1.SaveAs(Server.MapPath(filepathImage + (total+ e.FileName)));
                j++;
            }

Because i want to rename every file which is uploaded like this :  00file.jpg , 01file.jpg , 02file.jpg and so on ... for now , the above code rename every file with 00 infront instead of increment in each file .. i guess i think i need to count the number of files being uploaded and rename them 1 by 1 in a loop but i duno if i am doing this in the correct way ( see  above code ) , i am new to c# and ajax , hope experts here can guide me and provide me some help ! thanks 

NumericUpDownExtender blocking display of validator results

$
0
0

I have a few pages in .Net 4.0 website that use the NumericUpDownExtender. I have some validators on the textbox fields (tried different types of validators), and when there is an error in the field, the cursor jumps to the field, but the validator's error mesage is not displayed, so the user doesn't know what's going on - the form is not submitting, but no error is displayed. The site is asp.net website using a master page with an update panel containing the content of the child pages. When I view the source of the page using Developer Tools in IE, I can see the validator's <span>, but the style="display:none" is there, so it's not being set properly on error. Any ideas?

ScriptManager.RegisterClientScriptBlock Not Working

$
0
0

Well I'm confused about StartupScript and RegisterClientScriptBlock with ScriptManager / ClientScript.

This part of code is not working for me, I mean the Javascript alerts are not showing. I'm using it within UpdatePanel.

Can anyone please help?

//Make From & To Equal for 1 Day
            if (txtTo.Text == "")
                txtTo.Text = txtFrom.Text;

            if (DateTime.Parse(txtTo.Text) >= DateTime.Parse(txtFrom.Text))
            {
                Connection con = new Connection(ConfigurationManager.ConnectionStrings["IPEConStr"].ConnectionString);

                //Get Mobile No Of User
                DataTable dtUser = new DataTable();
                dtUser = con.GetRecordSetByQry("SELECT [Mobile] FROM tblUser WHERE UserID = " + Session["UserID"].ToString()).Tables[0];

                if (CheckLeaveBalance())
                {
                    Leave lv = new Leave();
                    lv.UserID = Session["UserID"].ToString();
                    lv.From_Date = DateTime.Parse(txtFrom.Text);
                    lv.To_Date = DateTime.Parse(txtTo.Text);
                    lv.Leave_Type = ddlLeaveType.SelectedItem.Value;
                    lv.Status = "Pending";

                    if (con.Insert(lv) > 0)
                    {
                        string script = @"alert('Successfully Applied For Leave');";
                        ScriptManager.RegisterClientScriptBlock(UpdatePanel1, UpdatePanel1.GetType(), "SuccessLeave", script, true);

                        //Send SMS
                        string SMSString = "Your application for Casual Leave dated From " + txtFrom.Text + " To " + txtTo.Text + " is placed successfully subject to Approval by your Line Manager.\nRegards,\nIPE Global";
                        SMS sms = new SMS(dtUser.Rows[0]["Mobile"].ToString(), SMSString);
                    }
                }
                else
                {
                    string script = @"alert('You Don't Have Sufficient Leave Balance.');";
                    ScriptManager.RegisterClientScriptBlock(UpdatePanel1, UpdatePanel1.GetType(), "NoLvBal", script, true);
                }
            }
            else
            {
                string script = @"alert('To Date Can't Be Lesser Than From Date');";
                ScriptManager.RegisterClientScriptBlock(UpdatePanel1, UpdatePanel1.GetType(), "NoLvBal", script, true);
            }



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.

Viewing all 5678 articles
Browse latest View live