change url address before issueing server.transfer command


I am would to like to
   build a dynamic url,
   then past this url to the server.transfer,
   and lastly, update the url displayed in the client browser.

Right now, I am relegated to having to issue a response.redirect; I would like to save  a round trip. Is it possible. In the past, I've spent hours trying this solution and never solved it. But, I hadn't remembered to pose this question to this bright community.

this is my response.redirect that I am currently using and would like to substitute this for server.transfer... (and do the additional things i  previously mentioned)

        // redirect (resets both child and parent usercontrols)
        Response.Redirect(Request.Url.ToString().Substring(0, Request.Url.ToString().IndexOf(Request.Path)) + Request.Path + "?page=view&esrchid=" + Request.QueryString["esrchid"].ToString() + "&srchid=14");

Again, my hangup is I am using usrcontrols and would like my individual user controls to act autonomous of each other based on the parameters in the querystring, and also avoid an extra browser round trip when user response.redirect.

below are my botched examples from the past..

        //Server.Transfer("~/admin/employeeview.aspx?page=edit&esrchid=" + Request.QueryString["esrchid"].ToString()+ "&srchid=14");
        //RouteCollection.GetVirtualPath( context, new RouteValueDictionary( {"page", "edit"}, {"esrchid", Request.QueryString["esrchid"].ToString()}, {"srchid", "14"} ) );

        ///System.Web.HttpContext.Current.Server.MapPath("~") + "~/admin/employeeview.aspx?page=edit&esrchid=" + Request.QueryString["esrchid"].ToString() + "&srchid=14";

        // //   Response.AddHeader("Location", "~/admin/employeeview.aspx?page=edit&esrchid=" + Request.QueryString["esrchid"].ToString()+ "&srchid=14");
        //System.Web.HttpContext.Current.RewritePath("~/admin/employeeview.aspx?page=edit&esrchid=" + Request.QueryString["esrchid"].ToString() + "&srchid=14");

Thanks for your insights...
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

It should work.
Use Path.Combine method with Server.MapPath to build the path and once the path is built you can pass it to Server.Transfer
jrwjAuthor Commented:
Thanks. I was successful at building the path. I am not successfully at programmatically updating displayed url, either prior or after issuing the server.transfer. Could you or someone help with this?
Hi! Definitely you will not update the url in your browser since you are using Server.Transfer. Take a look at this

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
jrwj, Sorry for the confusion. I never thought that you wanted to update the url in the address bar of the browser.

Response.Redirect comes back to the client in the process of transferring to another page so it updates the url and Server.Transfer does not update the url as it never comes to the client in the process.

There is no other way to update the url in the address bar of the browser except for Response.Redirect.

Sorry I mistook your problem.
jrwjAuthor Commented:
Thanks for the answer about my specific question. I found the referred article helpful. I am still not satisfied without having new options mentioned suggested.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.