Showing posts with label visual. Show all posts
Showing posts with label visual. Show all posts

Monday, March 26, 2012

Ajax Toolkit, calendar extender control

I have troubles with calendar control. When I tryed to run site with this control in Visual Studio i see the correct language - russian, but when i tryed to run deployed site using iis, i see english - names of months, days header.

i tryed to write in config files globalisation, ui culture, add charset win-1251, but no differences. i see only english words.

Have you set the EnableScriptGlobalization property to true in the scriptmanager?

yes


Hi

You should specifily its Culture and UICulture. Furture more, you should set ScriptManager's EnableScriptGlobalization and EnableScriptLocalization property to true.

EnableScriptLocalization: http://www.asp.net/AJAX/Documentation/Live/mref/P_System_Web_UI_ScriptManager_EnableScriptLocalization.aspx

EnableScriptGlobalization: http://www.asp.net/AJAX/Documentation/Live/mref/P_System_Web_UI_ScriptManager_EnableScriptGlobalization.aspx

Here is the sample.

<%@. Page Language="C#" Culture="ru-RU" UICulture="ru"%><%@. Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><script runat="server"></script><html xmlns="http://www.w3.org/1999/xhtml"><head id="Head1" runat="server"> <title>Untitled Page</title></head><body> <form id="form1" runat="server"> <asp:ScriptManager ID="ScriptManager1" runat="server" EnableScriptGlobalization="true" EnableScriptLocalization="true" > </asp:ScriptManager> <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox><asp:Button ID="Button2" runat="server" Text="hide" OnClientClick="return hideCalendar()"/> <asp:Button ID="Button1" runat="server" Text="show" OnClientClick="return false;"/> <ajaxToolkit:CalendarExtender ID="CalendarExtender1" runat="server" TargetControlID="TextBox1" PopupButtonID="Button1" > </ajaxToolkit:CalendarExtender> </form></body></html>

I hope this help.

Best regards,

Jonathan

ajax toolkit problem in visual web 2008

Hi,

Hope some one can help with this. I have installed vwd 2008 and am trying to get AJAX tool kit working.

I also ran the cmd script by the way.

Now when I drag a AJAX Toolkit control from the toolbox to the designer I get this...

<soap-env:envelope soap-env:encodingstyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:clr="http://schemas.microsoft.com/soap/encoding/clr/1.0" xmlns:soap-enc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <soap-env:body> <a1:webcontroltoolboxitem id="ref-1" xmlns:a1="http://schemas.microsoft.com/clr/nsassem/System.Web.UI.Design/System.Design%2C%20Version%3D2.0.0.0%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3Db03f5f7f11d50a3a"> <locked>true</locked> <filter href="#ref-5">

What is going on here? And how do i 'fix' it?

Thanks Kal

Same issue here. Haven't seen a fix yet. Anyone?


I guess with the pucker release of 2008 this has been fixed - but im closing this -

Ajax Toolkit issue with web deploy project in Visual Studio 2005

Error 157 Unable to copy file "C:\Program Files\Microsoft ASP.NET\ASP.NET 2.0 AJAX Extensions\AJAX Control ToolKit\SampleWebSite\Bin\zh-CHT\AjaxControlToolkit.resources.dll" to "C:\Documents and Settings\UserName\My Documents\Visual Studio 2005\Projects\TipWebCurrent\TipWeb\Bin\zh-CHT\AjaxControlToolkit.resources.dll". Access to the path 'C:\Documents and Settings\UserName\My Documents\Visual Studio 2005\Projects\TipWebCurrent\TipWeb\Bin\zh-CHT\AjaxControlToolkit.resources.dll' is denied. 1 1 TipWeb_deployProject

I am getting the above problem when I try and build my solution,(web deploy project specifically) is it as simple as changing the properties of the read-only access for each folder to false for each of the folders containing the dll's?


Yes, the directory that you are publishing to or at least the bin should have right access until you are done deploying, then make it read only again.


Yep, that was the main issue... Once I changed the permissions it worked like a charm!

:)

Ajax Toolkit Controls disabled

I downloaded ajasx control toolkit for .net 3.5 and added into separate tab in visual studio 2008 tolbox.

Problem is they are invisible (disabled when pres Show All in toolbox).

Anybody familiar with this issue?

Hi Ekaan,

Someone has met this kind of issue before. Please have a test by followingthis article.

This response contains a reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you. Microsoft does not control these sites and has not tested any software or information found on these sites; therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet.

If it doesn't work, please feel free to let me know.

Best regards,

Jonathan


Thanks but that didn't help.
I can use them trough source (markup or C#) but it slows down my development :-(

I have same issue with Telerik prometheus controls.


Hi Ekaan,

ekaan:

Problem is they are invisible (disabled when pres Show All in toolbox).

Would you please describe your issue more clearly for us?

Best regards,

Jonathan

Ajax toolbox missing in Visual webdeveloper 2005 express

I've just installed the Ajax tool kit but the toolbox is missing from the toolsbox panel. I have the Ajax website in the templates but no toolbox and suspect there is no intellisence either. Does anyone know haw to sort this out Ajax toolbox missing in Visual webdeveloper 2005 express

regards

jim

Hi Jim,

The AJAX Control Toolkit won't show up automatically in the toolbox - you have to add it yourself. Check out theSetup Your Environment walkthrough for details on how to add them. Intellisense also works fine.

Thanks,
Ted

Ajax Toolbox Additions

Just for the record, how many additional items should be added to Visual Studios toolbox? I installed both of the AJAX 1.0 Essential Components...the extensions and the toolkit. I only have 5 new items in my toolbox: Timer, ScriptManager, ScriptManagerProxy, UpdateProgress, UpdatePanel. Am I to assume that if I want to use any of the other new AJAX controls I have to grab the snippet from one of the examples? Or am I missing something??I actually figured it out from watching the install movie. That's pretty helpful. Although, I'm a little disappointed that MS didn't create icons for the new controls. That wouldn't have taken a graphic designer very long really. This is supposed to be a full release, kind of looks unfinished like that.
that's funny -- I didn't even notice the lack of icons...(or that most toolbox items have icons). I guess I'm more of a left brain type guy.
I'm both. I have an art degree but have done web development for nearly a decade. I just find it curious that something so small was left unfinished. I guess it really doesnt matter as long as the controls work.

Saturday, March 24, 2012

Ajax timeout when debugging ASP.Net code

How can I prevent Ajax timeout errors while debugging my ASP.net code using Visual Studio? My page uses the Timer control, so it should be the cause of the problem.Set the page's ScriptManager property:

AsyncPostBackTimeout

="0"

Wednesday, March 21, 2012

AJAX SlideShow Extender error

Hey, I have a SlideShow Extender into a Webform with Visual Basic and this doesn't show the pictures via WebMethod, only the first picture witch I inicializated. I let you know my code:

<asp:Image ID="Image1" runat="server"
Height="200"
Style="border: 1px solid black;width:auto"
ImageUrl="~/images/DSC02489.JPG"
AlternateText="Desfile Sambil Valencia" /> <br />
<asp:Label runat="Server" ID="imageLabel1"/><br />
<asp:ImageButton ID="prevButton" runat="server" ImageUrl="~/images/previous_20_1.gif" />
<asp:ImageButton ID="playButton" runat="server" ImageUrl="~/images/play_30_1.gif" />
<asp:ImageButton ID="nextButton" runat="server" ImageUrl="~/images/next_20_1.gif" />
<ajaxToolkit:SlideShowExtender ID="SlideShowExtender1" runat="server"
TargetControlID="Image1"
SlideShowServiceMethod=GetSlides()
AutoPlay="true"
ImageDescriptionLabelID="imageLabel1"
NextButtonID="nextButton"
PlayButtonText="Play"
StopButtonText="Stop"
PreviousButtonID="prevButton"
PlayButtonID="playButton"
Loop="true" />

and the script...

<script runat="server" type="text/VB">
<System.Web.Services.WebMethod()> _
<System.Web.Script.Services.ScriptMethod()> _
Public Shared Function GetSlides() As AjaxControlToolkit.Slide()
Return New AjaxControlToolkit.Slide() {New AjaxControlToolkit.Slide("~Images/DSC02489.JPG", "Desfile Febrero Sambil", "Desfile Febrero Sambil"), New AjaxControlToolkit.Slide("~Images/DSC02489.JPG", "Desfile Febrero Sambil", "Desfile Febrero Sambil")}
End Function
</script>

and the Internet Explorar error is as follow>

Line: 79

Char: 1

Error: 'this._slides[...].ImagePath' is null or not an object

Please... Can Someone tell me how I doing it a best-use...

Please set the method name as a string

SlideShowServiceMethod="GetSlides"

*not* SlideShowServiceMethod=GetSlides() .

Check out the sample athttp://ajax.asp.net/ajaxtoolkit/SlideShow/SlideShow.aspx.


Ok, it's working like sample now, but I really need to use a webmethod that allow obtain photos from a diferent source. I mean, internally I can to set the webmethod to read a database and locate photo source but my problem is when it's required that WebMethod "knows" what is the data source to query because I can't to pass parameters? or Can I?

Thank you in advance


After hours figthing with this code I found a solution to my need...

I was needing pass a parameter to the WebService to retrieve values (Pictures Names) from a database. At the moment, I couldn't do this (Anyone can to make me a correction). So, I tried to use a Application Variable (Applicationstate) named Id (my Parameter) and my Webservice could read it and this worked to retrieve the specific Pictures Collection taht I wished...

This is the code:

WebService:

1<%@. WebService Language="VB"Class="SlideShowPictures" %>23Imports System.Web4Imports System.Web.Services5Imports System.Web.Services.Protocols6Imports System.Data7Imports System.Data.SqlClient8Imports System.Web.Profile9Imports System.Web.HttpRequest1011<WebService(Namespace:="http://tempuri.org/")> _12<WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _13<Script.Services.ScriptService()> _14Public Class SlideShowPictures15Inherits System.Web.Services.WebService16Public img1As String17 Public img2As String18 Public img3As String19 Public img4As String2021 <System.Web.Script.Services.ScriptMethod()> _22 <System.Web.Services.WebMethod()> _23Public Function GetSlides()As AjaxControlToolkit.Slide()24 ReadPhotoNews()2526Return New AjaxControlToolkit.Slide() {New AjaxControlToolkit.Slide(img1,"News01","Photo01"),New AjaxControlToolkit.Slide(img2,"News2","Photo02"),New AjaxControlToolkit.Slide(img3,"News03","Photo03"),New AjaxControlToolkit.Slide(img4,"News4","Photo04")}2728End Function2930 Public Sub ReadPhotoNews()31Dim idAs Integer =CInt(Me.Context.Application("id"))32Dim rstQueryAs SqlDataReader = MyNameSpace.News.ReadNews(id)33If rstQuery.Read()Then34 img1 = IIf(IsDBNull(rstQuery.GetValue(4)),"", rstQuery.GetValue(4))35 img2 = IIf(IsDBNull(rstQuery.GetValue(5)),"", rstQuery.GetValue(5))36 img3 = IIf(IsDBNull(rstQuery.GetValue(6)),"", rstQuery.GetValue(6))37 img4 = IIf(IsDBNull(rstQuery.GetValue(7)),"", rstQuery.GetValue(7))38End If39 End Sub

ASP.aspx file:

<asp:Image ID="Image1" runat="server"
Height="200"
Style="border: 1px solid black;width:auto" />
<br />
<asp:ImageButton ID="prevButton" runat="server" ImageUrl="images/previous_20_1.gif" />
<asp:ImageButton ID="playButton" runat="server" ImageUrl="images/play_30_1.gif" />
<asp:ImageButton ID="nextButton" runat="server" ImageUrl="images/next_20_1.gif" />
<ajaxToolkit:SlideShowExtender ID="SlideShowExtender1" runat="server"
TargetControlID="Image1"
SlideShowServiceMethod="GetSlides"
SlideShowServicePath="SlideShowPictures.asmx"
AutoPlay="true"
NextButtonID="nextButton"
PlayButtonText="Play"
StopButtonText="Stop"
PreviousButtonID="prevButton"
PlayButtonID="playButton"
Loop="true" />

ASP.aspx.vb File:


Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Application("id") = Request.QueryString("Id")
End Sub



Yes. This is a workaround expected, that you wrap your call inside a method whose signature and param names match up what is passed to the slideshow extender. Although, we would like to improve it. Seebug. All extenders in the toolkit that take in webservice and webmethod as parameters need to be more flexible and we plan to fix that.

Using c#, i am beginning to realize that it is not possible to persist an application variable (or even a session variable) and be able to access it from a static context (from the webmethod GetSlides() that is).

I am hitting my head on the keyboard right now.

Do you perhaps know a workaround in order to be able to pass a variable (originally obtained from "Request" in the same Page's onLoad() ) in the webmethod?


This worked for me

in page load I tack on AlbumID to the SlideShowServiceMethod

protectedvoid Page_Load(object sender,EventArgs e) {

SlideShowExt1.SlideShowServiceMethod ="GetSlides?AlbumID=" + Request.QueryString["AlbumID"];

}

Then in GetSlides() get the string out of the request

[System.Web.Services.WebMethod]
[System.Web.Script.Services.ScriptMethod]
public static AjaxControlToolkit.Slide[] GetSlides()
{
int AlbumID = int.Parse(HttpContext.Current.Request.QueryString["AlbumID"]);

//gel a list of photos from the album
System.Collections.Generic.List<Photo> photos = PhotoManager.GetPhotos(AlbumID);

// copy relevant data to slides array
AjaxControlToolkit.Slide[] slides = new AjaxControlToolkit.Slide[photos.Count];

int i = 0;

foreach (Photo p in photos)
{
AjaxControlToolkit.Slide slide = new AjaxControlToolkit.Slide();

// must be relative path
slide.ImagePath = "images\\" + p.Location;
slide.Name = p.Caption;
slide.Description = p.Caption;

slides[i] = slide;
i++;
}
return slides;
}


We (Ted one of the Toolkit developers made this change yesterday) have added support to now pass additional data to webservices used by AutoComplete, CascadingDropDown, NumericUpDown and SlideShow so you will no longer need this workaround. You can download the latest source code and build the Toolkit dll and try it out. The demo pages have been updated in the Sample Website as well. Take a look at the manual tests added by Ted that demonstrate the usage. This should be part of the next official Toolkit release around end of this month.

Can somebody post the sample code how this additional parameter could be used in this xample with AlbumID? I looked at the source, but it is confusing. The sample is very limited, jsut describes what context key is for. It would be great to have full sample like that..


The AutoComplete example shows how to pass context pretty well (AutoCompleteWithContext.aspx).

But I think you may have discovered an inherent bug in slideshow.

The function_slideShowInitshould be "public" i.e. it should not start with an underscore so that after the contextkey parameter is changed the slideshow reinvokes the xmlhttprequest to get new data. This could also and actually should also be done by a handler when contextkey is updated or other information about the slideshow is updated (I will need to look into this further). Currently the only time slideshow queries the webservice is onload so even setting the contextkey in pageLoad is too late because it is already completely initialized by then.


The error that some people report about the 'webmethod not found' can be avoided by being sure to set the WebMethod used to a static function. The ajax docs example in the Sample Website leaves that out, and it won't work without it.


I have openedWorkItemId=11887 to track this issue.