The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.
|
 |
|
Dev Shed Forums
> Programming Languages - More
> ASP Programming
|
SlideShowExtender doesn't work when I'm using Routes and a Handler
Discuss SlideShowExtender doesn't work when I'm using Routes and a Handler in the ASP Programming forum on Dev Shed. SlideShowExtender doesn't work when I'm using Routes and a Handler ASP Programming forum discussing Active Server Pages coding techniques and problem solving methods. Use VBScript or Jscript to make dynamic web applications.
|
|
 |
|
|
|
|

Dev Shed Forums Sponsor:
|
|
|

October 14th, 2012, 09:43 AM
|
|
Registered User
|
|
Join Date: Oct 2012
Posts: 4
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
|

November 19th, 2012, 02:06 AM
|
|
Registered User
|
|
Join Date: Oct 2012
Posts: 4
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
|

November 19th, 2012, 06:52 PM
|
|
|
|
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
|

December 6th, 2012, 04:06 PM
|
|
Registered User
|
|
Join Date: Dec 2012
Posts: 3
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!
|

December 10th, 2012, 09:02 AM
|
|
Registered User
|
|
Join Date: Oct 2012
Posts: 4
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.
|

December 10th, 2012, 09:29 AM
|
|
Registered User
|
|
Join Date: Dec 2012
Posts: 3
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. |
|

December 10th, 2012, 09:34 AM
|
|
Registered User
|
|
Join Date: Oct 2012
Posts: 4
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
|

December 10th, 2012, 09:51 AM
|
|
Registered User
|
|
Join Date: Dec 2012
Posts: 3
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 |
|

December 20th, 2012, 01:38 AM
|
|
Registered User
|
|
Join Date: Dec 2012
Posts: 4
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
|
Developer Shed Advertisers and Affiliates
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|