ASP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming Languages - MoreASP Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old October 14th, 2012, 09:43 AM
robinscorner robinscorner is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2012
Posts: 4 robinscorner User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 53 m 19 sec
Reputation Power: 0
SlideShowExtender doesn't work when I'm using Routes and a Handler

Hi there. I have a problem with the SlideShowExtender.
I wanted to load images from a database, using a handler. It works fine when I open the original page, without a Route. The Route also works for all page contents, but not the Slide Show Extender. I tried it, when the handler and the aspx-file were inside the root and when they were both inside the same subfolder. I tried it using hard coded and soft coded picture URLs and also the '../subfolder/myhandler.ashx'.
Could you please have a look at the code and hopefully have a nice idea?

Route:


routes.MapPageRoute("myPictureshow", "myPictureshow-{uniformsqlid}", "~/myfolder/myPictureshow.aspx");

script:
[System.Web.Services.WebMethod]
[System.Web.Script.Services.ScriptMethod]
public static AjaxControlToolkit.Slide[] GetSlides()
{
List<AjaxControlToolkit.Slide> NewSlide = new List<Slide>();
if (PictureContent != null)
for (int PictureNumber = 0; PictureNumber < 8; PictureNumber++)
if (PictureContent[PictureNumber]!=null)
if (PictureContent[PictureNumber].Length > 0)
{
string PictureUrl = "myHandler.ashx?imgid=" + PictureNumber;
// alternative: "../myfolder/myHandler.ashx?imgid=" + PictureNumber;
//or: "localhost:12345/myfolder/myHandler.ashx?imgid=" + PictureNumber;
NewSlide.Add(new AjaxControlToolkit.Slide(PictureUrl, "Bild 1", ""));
};
AjaxControlToolkit.Slide[] returnSlide = new Slide[NewSlide.Count];
for (int PictureNumber = 0; PictureNumber < NewSlide.Count; PictureNumber++)
returnSlide[PictureNumber] = NewSlide[PictureNumber];
return returnSlide;
}

Handler:

public void ProcessRequest(HttpContext context)
{
EinstellKlasse NeueKlasseEinstellen = new EinstellKlasse();
if (context.Request.QueryString["imgid"] != null)
{
string id = context.Request.QueryString["imgid"].ToString();
context.Response.ContentType = "image/jpeg";
int PictureNumber = Convert.ToInt16(id);

Stream stream = new MemoryStream((byte[])myPictureshow.PictureContent[PictureNumber]);

byte[] buffer = new byte[2024];
int byteSeq = stream.Read(buffer, 0, 2024);

while (byteSeq > 0)
{
context.Response.OutputStream.Write(buffer, 0, byteSeq);
byteSeq = stream.Read(buffer, 0, 2024);
}

}

}

Thx robinscorner

Reply With Quote
  #2  
Old November 19th, 2012, 02:06 AM
robinscorner robinscorner is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2012
Posts: 4 robinscorner User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 53 m 19 sec
Reputation Power: 0
I found a solution

If you need to pass a variable to the current page containing the slide show, which does not accept Routes, you could do the following:You do not use a Route, but call the page like this:

"~/MyFolder/examplepage.aspx/whateveryouwanttopass"

Now in the codebehind file, you will find the variables (whateveryouwanttopass) when you enter

this.Page.Request.PathInfo

Hope it helps you too! robinscorner

Reply With Quote
  #3  
Old November 19th, 2012, 06:52 PM
Doug G Doug G is offline
Grumpier Old Moderator
Dev Shed God 19th Plane (14000 - 14499 posts)
 
Join Date: Jun 2003
Posts: 14,235 Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level) 
Time spent in forums: 1 Month 4 Weeks 14 h 27 m 16 sec
Reputation Power: 4445
Thanks for posting your solution.
__________________
======
Doug G
======
It is a truism of American politics that no man who can win an election deserves to. --Trevanian, from the novel Shibumi

Reply With Quote
  #4  
Old December 6th, 2012, 04:06 PM
jonsey10 jonsey10 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2012
Posts: 3 jonsey10 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 19 m 30 sec
Reputation Power: 0
Hi there!

Robin, could you please send me a zip file with the files that you use in this example? Or where can I download?

Because, I have an example of code but it does not work. I can not make it work. Thanks!

Reply With Quote
  #5  
Old December 10th, 2012, 09:02 AM
robinscorner robinscorner is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2012
Posts: 4 robinscorner User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 53 m 19 sec
Reputation Power: 0
Sorry, but I had some more probs like I couln't view several galleries on one page, so I changed everything. I'm using
simplegallery now (Simple Controls Gallery v1.4, I am not allowed to send the link).

Please, if you want to reconstruct my former method, search for generic handlers and images on google, do what ajax toolkit provides in the sample pages and put it together with the stuff I wrote above.

Reply With Quote
  #6  
Old December 10th, 2012, 09:29 AM
jonsey10 jonsey10 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2012
Posts: 3 jonsey10 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 19 m 30 sec
Reputation Power: 0
Thanks! I visited the website of the control, so I think, that you wrote code for the image array to use a SQL DB with java, my problem is the same... I do not do familiar with java.

However, glad to know how to do an array with java and make it work.




Quote:
Originally Posted by robinscorner
Sorry, but I had some more probs like I couln't view several galleries on one page, so I changed everything. I'm using
simplegallery now (Simple Controls Gallery v1.4, I am not allowed to send the link).

Please, if you want to reconstruct my former method, search for generic handlers and images on google, do what ajax toolkit provides in the sample pages and put it together with the stuff I wrote above.

Reply With Quote
  #7  
Old December 10th, 2012, 09:34 AM
robinscorner robinscorner is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2012
Posts: 4 robinscorner User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 53 m 19 sec
Reputation Power: 0
If you have your difficulties, please take a look at this helpful instruction of how to use it with a XML file:

-link is not allowed, but seach for

JQuery Image Gallery with XML

Reply With Quote
  #8  
Old December 10th, 2012, 09:51 AM
jonsey10 jonsey10 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2012
Posts: 3 jonsey10 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 19 m 30 sec
Reputation Power: 0
Ok, this documentation is very useful.
Hope all these hints help me to make that image slider works from a SQL db.

Thanks again!


Quote:
Originally Posted by robinscorner
If you have your difficulties, please take a look at this helpful instruction of how to use it with a XML file:

-link is not allowed, but seach for

JQuery Image Gallery with XML

Reply With Quote
  #9  
Old December 20th, 2012, 01:38 AM
renika renika is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2012
Posts: 4 renika User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 32 m 51 sec
Reputation Power: 0
Quote:
Originally Posted by robinscorner
If you need to pass a variable to the current page containing the slide show, which does not accept Routes, you could do the following:You do not use a Route, but call the page like this:

"~/MyFolder/examplepage.aspx/whateveryouwanttopass"

Now in the codebehind file, you will find the variables (whateveryouwanttopass) when you enter

this.Page.Request.PathInfo

Hope it helps you too! robinscorner

nice sharing thanks

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreASP Programming > SlideShowExtender doesn't work when I'm using Routes and a Handler

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap