Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > MVC WEBFORM INTEGRATION

Reply
Thread Tools

MVC WEBFORM INTEGRATION

 
 
Zesus
Guest
Posts: n/a
 
      09-14-2009
I have an MVC website and some webform pages what I would like to do
is when a button is clicked on a webform page, in the onclick event of
the button, call the MVC controller action that will launch the mvc
page in the same browser window. What is the best way to implement
this.

Thanks in advance.
 
Reply With Quote
 
 
 
 
Gregory A. Beamer
Guest
Posts: n/a
 
      09-15-2009
Zesus <(E-Mail Removed)> wrote in news:cbd2ecd9-fb62-44e0-a427-
http://www.velocityreviews.com/forums/(E-Mail Removed):

> I have an MVC website and some webform pages what I would like to do
> is when a button is clicked on a webform page, in the onclick event of
> the button, call the MVC controller action that will launch the mvc
> page in the same browser window. What is the best way to implement
> this.



You really don't want to do what you think you want to do, as you are
making things very difficult on yourself trying to mix systems. ASPX and
MVC working together is designed more for those who are migrating. you
are best to have functionality moved to libs and then call hte libs from
either an ASPX or an MVC page.

One potential exception would be to show a particular item on an MVC
page from form submit on an ASPX, although I am still not convinced this
is a proper way to do things.

To do this, you handle the form submit and the forward the request to
the MVC with the proper argument(s). The controller will naturally take
over, as the route is set up for MVC.

You can have an ASPX list that has MVC links rather easily, as well. you
wimply format the links properly for the hyperlinks using a filter on
the GridView (as an example).

Submitting a form to an MVC page, however, is a time consuming operation
that does not buy you much.

If you are migrating from ASPX to MVC, do it one bit of functionality at
a time (one page at a time, if your app is set up that way). You will
find this provides fewer headaches.

Now, you may have discovered a beautiful blending of ASP.NET and MVC. If
so, post more of what you are trying to accomplish (from a business
standpoint, not a technical standpoint) and we can examine it further.

Peace and Grace,


--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

Twitter: @gbworld
Blog: http://gregorybeamer.spaces.live.com

My vacation and childhood cancer awareness site:
http://www.crazycancertour.com

*******************************************
| Think outside the box! |
*******************************************
 
Reply With Quote
 
 
 
Reply

Thread Tools

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can we user webform usercontrols or server controls in MVC? Allan2010 ASP .Net 3 05-06-2010 08:03 AM
No MVC Project Template after installing ASP.NET MVC 1.0 Crazy Cat ASP .Net 1 09-03-2009 08:02 PM
running webform page inside MVC framework Guoqi Zheng ASP .Net 1 06-09-2009 12:10 PM
WebForms X MVC? Why MVC? Give me reasons to migrate my web apps to it please. Pros x Cons! Thanks! Paulo ASP .Net 3 12-04-2008 03:00 AM
differences between Spring WebFlow,Spring MVC,and String Portlet MVC? rmn190 Java 2 01-10-2008 02:27 AM



Advertisments