Showing posts with label tools. Show all posts
Showing posts with label tools. Show all posts

Wednesday, March 28, 2012

Ajax tools not work in IE6

im using AccordionPanel in my web when i start my web on firfox its

ok and work

but when i run my site in IE6 Ajax tools not work

what is the problem

Sorry if this is a little basic, but is JS enabled on your IE6 browser? If so, are you getting any javascript errors? Possibly "Sys is undefined"?

i haven't any problem with js


To help with your issue, you'll need to post any error messages and code samples of what is being done.

i have this same problem with the message "Sys is undefined"

but... my web.config file is ok!

can you help me?!

thank's

Monday, March 26, 2012

Ajax Toolkit Page Vs Iframe problem

Hi Everybody,

I have created an aspx page that uses Ajax tools for validation and filtrations . I finished the page deploy it and test it and every thing is perfect. The problem Arise when integrate the page into Iframe in another website. It gives a javascript error in the browser when you first interact with any control that uses AjaxToolkit and here are its details

Sys.ArgumentOutOfRangeException: Value must be an integer.

Parameter Name: x

Actual Value was NaN

The thing that makes things strange that if access the page Url that iframe is pointing at the page will work fine.

By the way both websites are in the same machine

Thank You

T tried to do another way to discover the source of the problem. So I create a test page at the same project. The page contains an identical copy of the original page and an iframe that points the original page. The result that I got is that every thing outside the iframe is working fine but in the iframe it is giving the same previous error.

Please Help


Dear All

At the end I figured out the problem is caused by one of the Iframe properties called frameborder when this property is set to yes or no the frame border is working fine but the script is not working properly but when I changed it to 0 or 1 the problem disappeared and every thing is fine. by the way the border property was added by the dotnetnuke iframe editior.

Thank you


Thank you for this response. I wasted hours trying to figure out if it was the script combiner or my web config settings when the issue was the iFrame all along. Thanks again!

Wednesday, March 21, 2012

Ajax SlideShow Help

Can Someon help me to convert C# to Vb this web service code from SlideShow example? I already tried conversion tools and it gives me some errors. Thank You All.

<

scriptrunat="Server"type="text/C#">

[System.Web.Services.

WebMethod]

[System.Web.Script.Services.

ScriptMethod]publicstatic AjaxControlToolkit.Slide[] GetSlides()

{

returnnew AjaxControlToolkit.Slide[] {new AjaxControlToolkit.Slide("images/Blue hills.jpg","Blue Hills","Go Blue"),new AjaxControlToolkit.Slide("images/Sunset.jpg","Sunset","Setting sun"),new AjaxControlToolkit.Slide("images/Winter.jpg","Winter","Wintery..."),new AjaxControlToolkit.Slide("images/Water lilies.jpg","Water lillies","Lillies in the water"),new AjaxControlToolkit.Slide("images/VerticalPicture.jpg","Sedona","Portrait style picture")};

}

</script>

<System.Web.Services.WebMethod()> _

<System.Web.Script.Services.ScriptMethod()> _

PublicSharedFunction GetPictures()As AjaxControlToolkit.Slide()ReturnNew AjaxControlToolkit.Slide() { _New AjaxControlToolkit.Slide("images/Blue hills.jpg","Blue Hills","Go Blue"), _New AjaxControlToolkit.Slide("images/Sunset.jpg","Sunset","Setting sun"), _New AjaxControlToolkit.Slide("images/Winter.jpg","Winter","Wintery..."), _New AjaxControlToolkit.Slide("images/Water lilies.jpg","Water lillies","Lillies in the water"), _New AjaxControlToolkit.Slide("images/VerticalPicture.jpg","Sedona","Portrait style picture")}

End

Function

Ken Tucker:

<System.Web.Services.WebMethod()> _

<System.Web.Script.Services.ScriptMethod()> _

PublicSharedFunction GetPictures()As AjaxControlToolkit.Slide()

ReturnNew AjaxControlToolkit.Slide() { _

New AjaxControlToolkit.Slide("images/Blue hills.jpg","Blue Hills","Go Blue"), _

New AjaxControlToolkit.Slide("images/Sunset.jpg","Sunset","Setting sun"), _

New AjaxControlToolkit.Slide("images/Winter.jpg","Winter","Wintery..."), _

New AjaxControlToolkit.Slide("images/Water lilies.jpg","Water lillies","Lillies in the water"), _

New AjaxControlToolkit.Slide("images/VerticalPicture.jpg","Sedona","Portrait style picture")}

EndFunction

Thank You Ken.


Ken Tucker:

<System.Web.Services.WebMethod()> _

<System.Web.Script.Services.ScriptMethod()> _

PublicSharedFunction GetPictures()As AjaxControlToolkit.Slide()ReturnNew AjaxControlToolkit.Slide() { _New AjaxControlToolkit.Slide("images/Blue hills.jpg","Blue Hills","Go Blue"), _New AjaxControlToolkit.Slide("images/Sunset.jpg","Sunset","Setting sun"), _New AjaxControlToolkit.Slide("images/Winter.jpg","Winter","Wintery..."), _New AjaxControlToolkit.Slide("images/Water lilies.jpg","Water lillies","Lillies in the water"), _New AjaxControlToolkit.Slide("images/VerticalPicture.jpg","Sedona","Portrait style picture")}

End

Function

How can I populate this array dynamically? For example, Read some folder with images and create an array?

ForEach sIn Directory.GetFiles(Server.MapPath("my_vacation"),"*.jpg")

Response.write ( Path.GetFileName(s) )

Next


I saw that you answered the dynamic file issue with

ForEach sIn Directory.GetFiles(Server.MapPath("my_vacation"),"*.jpg")

Response.write ( Path.GetFileName(s) )

Next

But how do I get it to dynamically use a value from an SQL table field.

My images have names such as R12345.jpg, R12345_2.jpg, R12345_3.jpg etc...

The listing_id field value is R12345 which would need to replace the "my_vacation" above.

How can I get this to work?

Thanks for your help!

Mike


Imports System.IO
Partial Class _Default
Inherits System.Web.UI.Page

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
MyData.ImagePath = Server.MapPath("~/Images")
Dim strUrl As String = Request.Url.ToString

MyData.Url = strUrl.Substring(0, strUrl.LastIndexOf("/")) & "/Images/"
End Sub


<System.Web.Services.WebMethod()> _
<System.Web.Script.Services.ScriptMethod()> _
Public Shared Function GetPictures() As AjaxControlToolkit.Slide()
Dim di As New DirectoryInfo(MyData.ImagePath)
Dim s(di.GetFiles.Length - 1) As AjaxControlToolkit.Slide
Dim x As Integer = 0
For Each fi As FileInfo In di.GetFiles()
s(x) = New AjaxControlToolkit.Slide(MyData.Url & fi.Name, "", Path.GetFileNameWithoutExtension(fi.Name))
x += 1
Next
Return s
End Function
End Class

Public Class MyData
Private Shared _Path As String
Private Shared _Url As String

Public Shared Property ImagePath() As String
Get
Return _Path
End Get
Set(ByVal value As String)
_Path = value
End Set
End Property

Public Shared Property Url() As String
Get
Return _Url
End Get
Set(ByVal value As String)
_Url = value
End Set
End Property
End Class


AWESOME!

How can I get it to retrieve images at a url other that mine, such as:

http://www.xyz.com/images

Thanks,

Mike


If you have ftp access to the images you can try something like this.

<System.Web.Services.WebMethod()> _
<System.Web.Script.Services.ScriptMethod()> _
Public Shared Function GetFtpPictures() As AjaxControlToolkit.Slide()
Dim ftp As FtpWebRequest = WebRequest.Create("ftp://ftp.xyz.com/images")
ftp.Credentials = New NetworkCredential("YourUserName", "YourPassword")
ftp.Method = WebRequestMethods.Ftp.ListDirectory
Dim wr As WebResponse =ftp.GetResponse
Dim sr As New StreamReader(wr.GetResponseStream)
Dim lst As New List(Of String)
Do While sr.Peek > 0
Dim strOut As String
strOut = sr.ReadLine
lst.Add(strOut)
Loop
Dim s(lst.Count - 1) As AjaxControlToolkit.Slide
Dim x As Integer = 0
For Each str As String In lst
Dim i As Integer = str.IndexOf("."c)
s(x) = New AjaxControlToolkit.Slide("http://www.xyz.com/images/" & str, "", str.Substring(0, i))
x += 1
Next
Return s
End Function

Article on how to use photos stored in Flickr in a slide show

http://www.onteorasoftware.com/blog.aspx?BlogID=75


pashaKasim this site may help you. You may already know about it, but there might be someone out there who hasnt run across this tool yet.

http://www.developerfusion.co.uk/utilities/convertcsharptovb.aspx

J


Really usefull piece of code.I would like to use a slider control to move across page.For that to be implemented i need to move to the Nth image.Is there a method / way to move to the Nth image.ThanksRain Man Alex