Click here to Skip to main content
15,892,005 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello.

I'm trying to redirect from web forms button to mvc page:

this.btnBar.ButtonCustom1.NavigateUrl = this.ResolveUrl( @"~/Profile/Info/Edit" )


It goes to the index...How can i change it to send it to the index with parameter name
ActionResult Index( string name )
or go directly to
ActionResult Edit()


Thanks

What I have tried:

Already tried different kinds of redirect going to the 500 error.

Thanks for reply...but already tried the url...problem is that due to mvc process it always goes to index first with name parameter null...so instead of going to @"~/Profile/Info/Edit" it always goes to @"~/Profile/Info/Info"...
Posted
Updated 15-Mar-18 2:52am
v2
Comments
F-ES Sitecore 15-Mar-18 9:08am    
Sounds like there is something in your mvc solution doing that redirect, you need to find out what it is and how to get around it.

1 solution

WebForms doesn't understand MVC url conventions so I'm afraid you're just going to have to know the url to redirect to and construct it yourself.

this.btnBar.ButtonCustom1.NavigateUrl = @"/Profile/Info/Edit?name=" + HttpUtility.UrlEncode(nameParam);
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900