Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / March 2008

Tip: Looking for answers? Try searching our database.

Challenging question regarding AJAX Toolkit AutoCompleteExtender and     URL rewriting

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
mazdotnet - 19 Mar 2008 20:11 GMT
Hi guys,

I'm running into an issue where my AutoCompleteExtender stops working
as soon as I make changes to my global.asax file for URL rewriting. I
just want to take a URL http://www.sample.com/file1234.aspx and pass
it to asp.net engine as http://www.sample.com/parse.aspx?id=1234 which
works great. Except some components of AJAX Toolkit stopped working
ex. AutoCompleteExtender as soon as I do the URL rewrite.

This is what I have in my global.asax

HttpContext incoming = HttpContext.Current;
string oldPath = incoming.Request.Path.ToLower();
string newPath = string.Empty;

I check the oldPath and parse the information that I need and assign
it to newPath and post for processing

incoming.RewritePath(newPath);

As soon as I remove global.asax from the site, my AutoCompleteExtender
starts working again. Any idea?

Thank you
Maz
mazdotnet - 20 Mar 2008 00:54 GMT
> Hi guys,
>
[quoted text clipped - 21 lines]
> Thank you
> Maz

BTW, all you have to do to make AutoCompleteExtender stop working is
to add

protected void Application_BeginRequest(object sender, EventArgs e)
   {
       HttpContext incoming = HttpContext.Current;
       string oldPath = incoming.Request.Path;
       incoming.RewritePath(oldPath);
   }
to Global.asax file. Anyone knows why?

Thx
George Ter-Saakov - 20 Mar 2008 13:27 GMT
If you URL has query parameters then Request.Path will strip then,
so in url http://www.myserver.com/mypage.aspx?q1=aaa
the Request.Path is /mypage.aspx

So when you rewrite it you loosing the query parameters.

Might be the case....

try something like
ctx.RewritePath(oldPath, "", Request.Url.Query);

PS: You might need to strip out question mark since as far as I recall
Request.Url.Query comes back like "?q1=aaa"

George.

>"mazdotnet" <maflatoun@gmail.com> wrote in message
>news:94e3b28e-3c4a-479d-a88f->af10d627db1a@s19g2000prg.googlegroups.com...

>BTW, all you have to do to make AutoCompleteExtender stop working is
>to add

>protected void Application_BeginRequest(object sender, EventArgs e)
>    {
[quoted text clipped - 3 lines]
>    }
>to Global.asax file. Anyone knows why?

>Thx

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.