Showing posts with label toolkit. Show all posts
Showing posts with label toolkit. Show all posts

Wednesday, March 28, 2012

Postback in FF

Hi All,

I have used ajaxcontrol toolkit in my application.
I have also implemented autosuggest list using classic XMLHTTP.
when I type search keyword in textbox it populates list , from list when I select record and hit enter key entire page is postback.

Please help me for same.

Hi Mukseshzala,

Based on your description, I think you should better use AutomComplelte control + WebService. Just like ths. You can get the whole source code from Ajax ControlToolkit Control.

Mukeshzala:

when I type search keyword in textbox it populates list , from list when I select record and hit enter key entire page is postback.

Please add this to your page , the onItemSelected function will be fired when click on the items.

<script type="text/javascript" language="javascript">
function pageLoad(){
$find("AutoCompleteEx").add_itemSelected(onItemSelected);
}
function onItemSelected(sender,eventArgs){
alert(sender.get_element().id);
}
</script>

I hope this help.

Best regards,

Jonathan

Postback issue

In my page, there are a lots of toolkit controls and gridvidw. Sometime when I postpack partially inside a UpdatePanel, I got the following message in a popup message box:

Invaid postback or callback argument. Event validation is enabled using <pages enableEventValidation="true"/> in configuration or <% Page EnableEventValidation="true" %> in page. For security purposes,this fuature verifies that arguments to postbalc or callback events originate from the server control that orginally rendered them. If the data is valid and expected, use the ClientScriptManager.RegiterForEventValidation method in order to register the postback or callback data for validation.

For example, in gridview with paging, when I click on page numnber, sometimes the above message will come out. It comes out randomly. If I refresh the page, it will fix this issue.

How to solve this issue?

The pics you posted are not visible.

A potentially dangerous Request.Form value was detected from the client (ctl00$ctl00$ctl00$ctlToAdd1$ctl00$ctlHeaderFooter$ctl00$txtPageHeader="<p>DO NOT ATTEMPT TH...").

Description: Request Validation has detected a potentially dangerous client input value, and processing of the request has been aborted. This value may indicate an attempt to compromise the security of your application, such as a cross-site scripting attack. You can disable request validation by setting validateRequest=false in the Page directive or in the configuration section. However, it is strongly recommended that your application explicitly check all inputs in this case.

Exception Details:System.Web.HttpRequestValidationException: A potentially dangerous Request.Form value was detected from the client (ctl00$ctl00$ctl00$ctlToAdd1$ctl00$ctlHeaderFooter$ctl00$txtPageHeader="<p>DO NOT ATTEMPT TH...").

Source Error:

[No relevant source lines]


Source File:c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\siteseasytest\b32181f7\172c3a32\App_Web_yzjzpobg.2.cs Line:0

Stack Trace:

[HttpRequestValidationException (0x80004005): A potentially dangerous Request.Form value was detected from the client (ctl00$ctl00$ctl00$ctlToAdd1$ctl00$ctlHeaderFooter$ctl00$txtPageHeader="<p>DO NOT ATTEMPT TH...").]

System.Web.HttpRequest.ValidateString(String s, String valueName, String collectionName) +3219550

System.Web.HttpRequest.ValidateNameValueCollection(NameValueCollection nvc, String collectionName) +108

System.Web.HttpRequest.get_Form() +119

System.Web.HttpRequest.get_HasForm() +57

System.Web.UI.Page.GetCollectionBasedOnMethod(Boolean dontReturnNull) +2025201

System.Web.UI.Page.DeterminePostBackMode() +60

System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +6953

System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +154

System.Web.UI.Page.ProcessRequest() +86

System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) +18

System.Web.UI.Page.ProcessRequest(HttpContext context) +49

ASP.communitydefault_aspx.ProcessRequest(HttpContext context) in c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\siteseasytest\b32181f7\172c3a32\App_Web_yzjzpobg.2.cs:0

System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +154

System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +64


Jason, If you are using code behind to control what gets added to a PlaceHolder for instance...

In ATLAS - we simply issued the

UpdatePanelModal.Update();

Because viewstate would get mucked up. (Article on my blog about this)

In Beta - I find that anytime you issue that command - it causes the error ... I think when mode is conditional - it works but not sure - as I am being forced to use always due to databound controls dissapearing on a modal popup and have not heard any feedback on the issue...

If you are not using code behind to handle - can you post a simple code example that demonstrates the issue?


Jason, I have written down the message text in message box. Forget the pic.


jodywbcb, what's your post for my question?

Saturday, March 24, 2012

Problem adding toolkit to the web.config on my server

I am trying to add the toolkit to my server's web.config so that I do not have to register the toolkit on each page that I use the extenders on. I have added the following config items but am receiving the error listed below when I attempt to use a control. Is there an issue with using the extenders on master pages? Everything works fine from a VWD perspective, intellisense picks up the toolkit controls just fine. The error only occurs on the server. Any help would be greatly apprectiately.

I have added the following to the <compilation><assemblies> section:

<add assembly="AjaxControlToolkit, Version=1.0.10618.0, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e"/>

I have also added the following within the <system.web> section:

<pages>
<controls>
<add namespace="AjaxControlToolkit" assembly="AjaxControlToolkit" tagPrefix="ajaxToolkit" />
</controls>
</pages>

Error text:


Parser Error

Description:An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.

Parser Error Message:Unknown server tag 'ajaxToolkit:TextBoxWatermarkExtender'.

Source Error:

Line 48: ErrorMessage="User Name is required." Display="dynamic" ToolTip="User Name is required." ValidationGroup="ctl00$ctl00$Login1">*</asp:RequiredFieldValidator>Line 49:Line 50: <ajaxToolkit:TextBoxWatermarkExtender id="wm1" runat="server" TargetControlID="UserName" WatermarkText="Username" />Line 51: </td>Line 52: </tr>

The problem turned out to be an issue with the AJAX Extension configuration in the web.config. To fix it I just copied the info from the web.config from the Extensions install directory.


I am trying to do this right now too. Could you provide a little more detail about your fix? Where is the Extensions install directory? And what info did you copy from the web.config?

Also, how do I determine what the proper assembly info to use (i.e. version# and public key token...)

Thanks!


The path for the Extensions install directory on my dev machine is:

C:\Program Files\Microsoft ASP.NET\ASP.NET 2.0 AJAX Extensions\v1.0.61025

That should be the default path for the AJAX Extensions installer.

Located in that folder should be a web.config file. All of the info in there needs to be copied into the web.config for your app. You'll have to make sure you aren't duplicating sections if you just paste the whole bit in your config. Posted below is a direct copy of the web.config for your convenience.

As for the issue of knowing which version and public token, I just take those from the samples. In the case of the Extensions, the config below lists the correct info and you shouldn't have to change it. For the case of the toolkit, the version will be the same as the release you are currently using. As for the public token, I'm not entirely sure about that as I have not updated my toolkit to the newest release. If you figure that out post back here to have it documented. (I'll do the same when I upgrade)

I hope this helps solve your issue.

<configuration> <configSections> <sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"> <sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"> <section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication"/> <sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"> <section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="Everywhere" /> <section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication" /> <section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication" /> </sectionGroup> </sectionGroup> </sectionGroup> </configSections> <system.web> <pages> <controls> <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/> </controls> </pages><!-- 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="false"> <assemblies> <add assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/> </assemblies> </compilation> <httpHandlers> <remove verb="*" path="*.asmx"/> <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/> <add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/> <add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/> </httpHandlers> <httpModules> <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/> </httpModules> </system.web> <system.web.extensions> <scripting> <webServices><!-- Uncomment this line to customize maxJsonLength and add a custom converter --> <!-- <jsonSerialization maxJsonLength="500"> <converters> <add name="ConvertMe" type="Acme.SubAcme.ConvertMeTypeConverter"/> </converters> </jsonSerialization> --> <!-- Uncomment this line to enable the authentication service. Include requireSSL="true" if appropriate. --> <!-- <authenticationService enabled="true" requireSSL = "true|false"/> --> <!-- Uncomment these lines to enable the profile service. To allow profile properties to be retrieved and modified in ASP.NET AJAX applications, you need to add each property name to the readAccessProperties and writeAccessProperties attributes. --> <!-- <profileService enabled="true" readAccessProperties="propertyname1,propertyname2" writeAccessProperties="propertyname1,propertyname2" /> --> </webServices><!-- <scriptResourceHandler enableCompression="true" enableCaching="true" /> --> </scripting> </system.web.extensions> <system.webServer> <validation validateIntegratedModeConfiguration="false"/> <modules> <add name="ScriptModule" preCondition="integratedMode" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/> </modules> <handlers> <remove name="WebServiceHandlerFactory-Integrated" /> <add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/> <add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/> <add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /> </handlers> </system.webServer></configuration>

Problem Creating New Control toolkit

I have a problem that I am just about to give up on (so any help might save my sanity)

If I create a completely new Atlas project and use the default names I can create a new control add it to my test project and run it. However, if I right click and add a new item (of type Atlas control) no matter what I do to this (including inspecting the files line by line) I cannot get it to work. It fails with unrecognised tag and then my namespace and control when loading the page in IE. Now clearly it is not too much wrong as I can drag the control from the toolkit and it will check my tags to see if they are allowed. I can also use the properties i have created and they appear as correct extenders on the correct objects. It appears to be just the final link between the control and the browser.

When I debug I come back to the routine

Sys.TypeDescriptor.getType = function(tagPrefix, tagName) {
var type = null;
if (Sys.TypeDescriptor._registeredTags) {
var tagNameTable = Sys.TypeDescriptor._registeredTags[tagPrefix];
if (tagNameTable) {
type = tagNameTable[tagName];
}
}
debug.assert(type, String.format("Unrecognized tag {0}:{1}", tagPrefix, tagName));
return type;
}

The array_registeredTags contains (script, toolkit, atlascontroltoolkit) Should I see my namespace in here too?

I have gone through my code and created several projects and I cant figure it out.

Any help would be appreciated.

Thanks

Geoff

Hi Geoff,

You should check outFAQ Item #5. I'm guessing your script isn't an embedded resource.

Thanks,
Ted

Problem in AJAX Autocomplete

Hi i am using Autocompletion feature in my project for loading cities with matched keys in textbox using AutoCompleteExtender of Ajax Toolkit. Its working fine but when i use the same code in User control (.ascx) file, then i can't work. and also when i use the same code for autocompletion in URL Friendly Urls then the page hang out can any one told me why this happen and how i use AutoCompleteExtender efficiently in my project. My complete coding is shown below.

.aspx page.

<asp:TextBox ID="txt_search_city" Width="130px" runat="server">

<cc1:AutoCompleteExtender ID="AutoCompleteExtender2" runat="server" TargetControlID="txt_search_city"
ServiceMethod="GetCompletionListWithContext" UseContextKey="true" MinimumPrefixLength="2"
EnableCaching="false" CompletionSetCount="20" CompletionInterval="2000" FirstRowSelected="true"
DelimiterCharacters=";," />

Code behind Section:

<System.Web.Services.WebMethod()> _
<System.Web.Script.Services.ScriptMethod()> _
Public Shared Function GetCompletionListWithContext(ByVal prefixText As String, ByVal count As Integer, ByVal contextKey As String) As String()
If Not contextKey = Nothing Then
Return "this is a total of fifteen words that will be returned when we use context".Split(" ")
End If
If count = 0 Then
count = 20
End If
Dim items As New System.Collections.Generic.List(Of String)
'get data from database
Dim _loc As New Locations
Dim str As String
Dim ds As DataSet = _loc.Load_Cities(prefixText, count)
If ds.Tables(0).Rows.Count > 0 Then
Dim i As Integer
For i = 0 To count - 1
str = ds.Tables(0).Rows(i).Item("city").ToString()
If ds.Tables(0).Rows(i).Item("StateProvince").ToString() = "Rentals" Then
str = ds.Tables(0).Rows(i).Item("city").ToString() & " - " & ds.Tables(0).Rows(i).Item("CountryCode").ToString()
Else
str = ds.Tables(0).Rows(i).Item("city").ToString() & " - " & ds.Tables(0).Rows(i).Item("StateProvince").ToString()
End If
items.Add(str)
Next
End If
Return items.ToArray()
End Function

Waiting for some helpful response.

Thanks.

You may need a ScriptManager or a ScriptManagerProxy control in the user control.


Hi thanks for your reply...

I have already place Script manager on page rather than user control. is it not ok, and also when i am using auto complete on User Friendly URL Like http://www.abc.com/categories/232/auto.aspx then complete page is hang out. what will be the possible cause here for autocomplete control.

Thanks.


media_1408:

when i use the same code in User control (.ascx) file, then i can't work.

The code in a user control can't be accessed from client side directly, that's because request for file extension .ascx is blocked.

media_1408:

also when i use the same code for autocompletion in URL Friendly Urls then the page hang out

The ajax extension uses the virtualPath of current page to get an instance of the corresponding object and invoke a method on it with Reflection, and it's likely to fail to work when url rewriting is enabled. Since the a file can't be found with the user friendly URL.

In my opinion, a better idea is to use Web Service rather than a Page Method. And don't apply any rewriting rules to .asmx file extension.


Thanks a lot for your wonderful help, as user control problem is not solved and also it is not big issue, but by using Web Service rather than a Page Method, page hanging problem due to auto completion is also solved on URL Friendly Urls.


Thanks.

Problem In CollapsablePanel Extender

Hi Frnds,

I m new to Ajax, and i m using some toolkit extenders for my application.

When i declared a Label and an Image in the Header Panel of a CollapsablePanelExtender, its displaying controls on separate lines.

but i want to display label on the left side and image on right side.

Is there any tech to do like this since its taking more space and looking bad.

thanks in advance

Regards

Hasan

Hi Hasan,

I think you problem is a CSS related issue. Actually, itemplate header works as a div container but it is not recommended to changes its CSS directly. We suggest that you add another container (div) and add css style to the newly added container. For example,

<div style="width: 100%;">
<asp:Label ID="Label1" runat="server" Text="Label" Style="float: left"></asp:Label>
<asp:Button ID="Button2" runat="server" Text="Button" Style="float: right" /></div>

Another way is using a Table to control its showing position.

Best regards,

Jonathan

Wednesday, March 21, 2012

Problem in uploading ajax toolkit on web server

Respected Sir,

I have used Dropshow simple control in ajax control tool kit,

it's all run on localhost, but it's gave problem on web server which i deployed hall application

The error is as shown below:

It shows thatCould not found Micosoft.Extension.Design.Dll

I can solve that error by copying that dll file on my bin folder in server,

But how can i permanently removed that error ,

can you explain me ?

What ajax version i have to download for that ? pls give me proper guidance.

i m waiting for you response.

Happy Coding !

You can reference the Micosoft.Extension.Design.Dll into your project or add the Micosoft.Extension.Design.Dll into the GAC usint GACUTIL.EXE will install the dll into the gac.Hope this helps

Problem instaling and runing AJAX

Hello,

I am trying to install and use AJAX Toolkit. Is there a website with detailed explanation on how to install and use AJAX Toolkit.

Thanks

Hi,

Look at this page for details

http://www.asp.net/ajax/documentation/live/InstallingASPNETAJAX.aspx


Hi Elyubron,

If we want to use Ajax Control Toolkits in our project , we should first install ASP.NET 2.0 Ajax Extension V1.0 then install the Ajax Control Toolkit template(recommended but not necessary).

Here are some useful urls :

http://www.asp.net/learn/ajax-videos/video-75.aspx Get Started with ASP.NET AJAX

http://www.asp.net/learn/ajax-videos/video-76.aspx Get Started with the ASP.NET AJAX Control Toolkit

Also you can find more tutorials here : http://www.asp.net/learn/ajax-videos/

http://www.asp.net/AJAX/AjaxControlToolkit/Samples/Walkthrough/OtherNeatStuff.aspx Ajax Control Toolkit

I hope this help.

Best regards,

Jonathan

Problem installing the AJAX Control Toolkit

I tried a search and didn't come up with my key words. I downloaded the ASP.NET 2.0 AJAX Extensions 1.0 and installed it without problems. I can start up Visual Web Developer 2005 Express Edition and now I'm able to choose "AJAX enabled website" from the create website menu.

The problem comes along when I try to install the AJAX Control Toolkit. I watched the second video in the AJAX series regarding how to install the toolkit. The guy unzipped the toolkit file and double clicked on the .sln file. When I do that, VWD opens up but throws up an error message ....

The application for project 'C:\Program Files\Microsoft ASP.NET\ASP.NET 2.0 AJAX Extensions\AJAX Control Toolkit\AjaxControlToolkit\AjaxControlToolkit.csproj ' is not installed.
Make sure the application for the project type (.csproj) is installed.

Did anyone come across this issue? I know I can't be the only one.Smile

TIA for your help.Cool

there's no need to install the AjaxControlToolkit. After you unzip the downloaded file, just find the AjaxControlToolkit.dll in their sample folder (Bin) and copy that file to your current Bin folder.


Forgive the ignorance, but what do you mean by the current bin directory? Currently, this is the path on my computer where the website (that I'm developing with VWD Express) resides....

C:\Documents and Settings\Paul\My Documents\Visual Studio 2005\WebSites\Website1\

Under there, there's the App_Data folder, but no bin folder. Do I create a bin folder directly under my folder and just throw in that file? Or would this bin folder that you speak of, somewhere else on the computer? And once I put this file in the right place, the AJAX web controls related to the toolkit will show up in the panel in VWD (I imagine I'd have to restart VWD)?

Thanks in advance.


Never mind, I got the controls to show up on the toolkit panel in VWD Express by adding a tab and adding in the controls referenced by AjaxControlToolkit.dll.Smile They now are accessible in the panel to be used. I will experiment with the new AJAX Controls in a bit.

A question.... when creating a website that I want to incorporate with AJAX, must I choose "ASP.NET AJAX-Enabled Web Site"? Or can I choose either that or the regular "ASP.NET Web Site"? The reason I ask is, all those AJAX related controls are available for me to use regardless of which kind of website I choose at the beginning.

Thanks.

Problem installing the Toolkit

I read the post (http://forums.asp.net/t/1149177.aspx) which pointed to a video to help with the installation.

I downloaded the video and followed the instructions (Create the VSI file in VS 2005; run the VSI) however I am not seeing the toolkit as a template as the video indicates.

I checked the \My Documents\Visual Studio 2005\Templates\ProjectTemplates\Visual C# directory and the AjaxControlExtenderProjectCS.zip file exists within the directory. I am assuming that this should then show up under the 'my templates' section when I click to the web project.

I have checked the options in VS 2005 and for the "Visual Studio user project templates location" it points to the above directory.

It seems like something is simply misconfigured within VS2005 unless there is something else I need to do with the zip file prior to getting this to work.

Thank you in advance.

Hi,

Your configurations are correct.

Please note that the template will be shown in "My Templates" when you select Visual C#, and not listed in any child categories.

Hope this helps.