Last post Mar 18, 2011 10:56 PM by tarikub
Feb 02, 2009 02:13 PM|sparklem|LINK
Feb 02, 2009 02:44 PM|Luis Abreu|LINK
anything wrong with calling window.open and passing an url which points to your controller/action url?
Feb 02, 2009 02:52 PM|sparklem|LINK
Feb 02, 2009 03:23 PM|Luis Abreu|LINK
Here's a quick example:
<input type="button" value="bt" onclick="window.open( '<%= Url.Action( "About", "Home" ) %>' );"
Not really pretty, I know. but the alternative is setting up a function and putting this url info into a global js variable. since this was dmeo code, I've just put here the quickest solution I've found.
Feb 02, 2009 03:32 PM|sparklem|LINK
Feb 02, 2009 06:29 PM|Luis Abreu|LINK
hum...I'm not following...if it currently is rendered through RenderPartial method then you need to change your code so that you have a controller method that returns that partial view. Even better, why don't you add a view wich only renders that partial
view and then add a method to your controller which returns that new view? I believe that would be a good option for this scenario because the partial view won't render a complete HTML page...
Feb 02, 2009 06:59 PM|subdigital|LINK
Feb 02, 2009 07:10 PM|Luis Abreu|LINK
Yep, that will do it, though the a.href will only work if you're using an anchor...
Feb 03, 2009 10:35 AM|sparklem|LINK
Feb 03, 2009 10:48 AM|Luis Abreu|LINK
hum...whatt kind of data are we talking about? data that exists on the page that is currentyl displayed to the user? data that exists in the server? if it's on the page displayed to the user then you could send it back to the server and rebuild the object
there before passing it to the partial view...probably through the query string, if it isnt' sensitive information or if it's not too big...
Feb 03, 2009 10:57 AM|sparklem|LINK
Mar 22, 2010 08:14 PM|Mukthesh80|LINK
Hi spark, i dont know the internals of MVC but i have a suggession for you, just think about showing the usercontrol in the div-tag with z-index set to 9 or 9999, by default you will render the user-control as like a user -control in a normal page but you
dont show it on the view-page, whenever button click or anyother event is fired show that content by settings div-tag's disply property to "block". i think this will solve your problem where div-tag is displayed like a popup on top of the view-page but it
will load the user-control when the main-page gets loaded. It might not be a MVC way of dealing this issue. [but this allow you to send the Model object in a normal manner -RenderPartial ]
Nov 23, 2010 03:00 PM|dennismachel|LINK
Can you simplify the code being used here? Not understanding.
Mar 18, 2011 10:56 PM|tarikub|LINK
doing things ideally Thanks!
I was run into the same issue and was able to resolve it by creating a custom HTML Helper. Here are the scripts:
The <%= HTML.PopUP(... ) %> currently takes string, you might want to tweak the jquery code and HTML helper function to use iframe and pass the ~.ascx url.