MVC :: ActionResult To Appear In New Window?

Sep 17, 2010

our implementation of an mvc site is being done in a very weird way but none the less it is still mvc.

I have an issue that on a certain page, when you click a button to download a document, it retrieves from a web service a byte array of a document. This is not an issue as i pass this byte array into the view data to allow me to access it in our controller.

This is the code in the controller.

[Code]....

Now this all works ok but as expected the result is rendered out into the current window. Is there anyway at all i can trigger a new window to render out the document?

View 2 Replies


Similar Messages:

MVC :: How To Get The One Actionresult Data To In To Other Actionresult

May 21, 2010

this is the first controler which is calling my applciation I am getting all my studentinfo for updating studnetcan i call this et in updateresult Action result?

public ActionResult getresult(StduentInfo et)
{
return PartialView("Student", et);
public ActionResult updateresult(Stdentinfo et)
[code]...

View 1 Replies

How To Pass A Parameter To The Child Window From Parent Window Using Window.open

Oct 18, 2010

i have an aspx page in which a link in the grid view opens a popup page . the data in the grid view would be dynamic and i need to send the id of the row of grid while calling the child window. i get the id using sender.id, but how would i send this using window .open()?

View 2 Replies

MVC :: Sending Value To ActionResult?

Jun 15, 2010

I have a dropdown with several items (hardcoded) and next to it I have a submit button - which invokes an Action in the controller. I can successfully identify the submit button in the controll using the name and value attributes of the submit button, but how can I send the selected value of the dropdown control to the controller?

[Code]....

Then inside the controller I can identify that the submitButton with value of "Start Task ..." has been clicked, but I do not know how to know which value in the dropdown was selected?

[Code]....

View 5 Replies

C# - MVC ActionResult View() Not Changing Url?

Feb 6, 2011

I have a method...

[HttpPost]
public ActionResult Start(SomeViewModel someViewModel) { ... }

that based on some conditions returns things like return View("Invalid"), View("NotFound"), View("Run", anotherViewModel), etc. The problem is that no matter what view I present, the URL does not change to reflect the new controller/action. This poses a problem when my View wants to post to a different action. How can I fix this?

View 2 Replies

MVC :: Custom Routes For 5 Different ActionResult()?

Apr 6, 2010

I'm creating a new ASP.NET MVC 2.0 web application that will have 5 main pages:


- Home
- Services
- Contact Us
- Terms & Conditions
- Priva

View 2 Replies

MVC :: Two ActionResult In A Single View?

Aug 19, 2010

Shall i able to create two actionresult in a single page?

I m using two Html.BeginForm() in a single page? These two forms has different data as like

BeginFrom1() - dropdownlist

<% using (Html.BeginForm("ViewByStatus", "NewsLetterAdmin", FormMethod.Post))
{ %>
<div>
Filter:
<%=Html.DropDownList("statusName",new SelectList(new[]{"#firstname#","#lastname#","#emailid#","#date#"}))%>
<input type="submit" value="?" />
</div>
<%} %>

BeginForm2() - textbox , freetextbox
<% using (Html.BeginForm("ddown", "NewsLetterAdmin", FormMethod.Post))
{%>
<fieldset>
<legend>Fields</legend>
<div>
<%= Html.LabelFor(model => model.TemplateName) %>
</div>........

When i select a dropdownlist and submit , dropdown selected value comes to textbox and freetextbox. Its working well

Again i m adding contents to freetextbox

Again i select a dropdownlist and submit , dropdown selected value comes to textbox and freetextbox. The newly selected value only comes to textbox and freetextbox, but my old contents are not exists in freetextbox.

I need old contents and dropdown selected value comes to freetextbox.

View 3 Replies

MVC :: Testing ActionResult.ExecuteResult?

Jan 15, 2010

I have the following action result class that looks for a content type of "application/json" in the request and executes a jsonresult or the default result. My problem is that I don't know how to test the ExecuteResult method.This is the method in question:

[Code]....

View 1 Replies

MVC :: ActionResult Not Called From Input?

Jan 1, 2010

to make sure, that my problem is not made by myself i create a new mvc solution and added following code into Views/Home/Index.aspx:

[Code]....

The corresponding HomeController was added by following Code:

[AcceptVerbs(HttpVerbs.Post)]
public ActionResult SendMail(string username, string email, string subject, string message)
{
ViewData["Message"] = "Mail was sended....";
return View();
}

The ActionResult was not called - what do i have to do else? What do i forget?

I made a look to the Orange-Template where i found to do it in that way and in that Template it works.

View 13 Replies

MVC :: Authorize ActionResult By User?

Mar 25, 2011

I know i can authorize an action result for named users

[Code]....

but how do i do it for an unknown username? so i have the username stored in the database

View 4 Replies

MVC :: Action Returning More Than One ActionResult?

Feb 25, 2010

I have an action that returns a file path as ActionResult, I want that action to return a file path and change the View. Is there a way I can make an action return more than one ActionResult?

View 10 Replies

MVC :: Send ActionResult View As EmailTemplate

Jul 10, 2010

I am trying to implement a way to send email templates in my application and would like to populate an ActionResult view with data and then output the view HTML as a string to use as the body of my email. I found the following

blog post but have not been able to get it to work correctly in my app and was wondering if anyone had been able to implement something similar. The issue that I am running into is that I have created one controller, EmailController, to handle all generation and returning of the the view strings. So for instance if I am in my home controller and I have a contact form whose action is Contact when the user submits the contact form I want to call the email controller to get the correct action result for the email template and upon successful send of the email redirect the user to a success action on the home controller.

View 1 Replies

MVC :: Pass Parameter To ActionResult Method?

Mar 17, 2011

I have an ActionResult Method defined as following;

[Code]....

I am using JQuery and would like to know how I call this method passing a parameter. I have the following which does not work;

[Code]....

View 1 Replies

How To Change Default Controller Actionresult

Jan 8, 2010

By default ASP.NET MVC uses ContentResult for controller method that return result not inherited from actionresult type. That is why if we will return some poco entity it will be only its type name.Could I overload something in controller to make it return jsonresult by default.Example:// return json product representation instead of product typename

public MyController: Controller
{
public Product MyAction()
{
return new Product { Name = "Foo", ID = 1 };
[code]...

View 1 Replies

C# - How To Reduce The Number Of Parameters In An ActionResult In MVC

Feb 15, 2011

[Code]....

Is there any other way to make this more efficient?

View 2 Replies

AJAX :: Posting JSon To MVC ActionResult?

Feb 14, 2011

I am lost, I am posing a jSon result to an MVC ActionResult and I cannot get it done. What I have is on the View:

[Code]....

With Firebug I can see that I am posting a jSon result with the result I selected. This result is comming from a select list(UnAssignedPages) as the items selected.

Now I want to iterate over that list in the controller and I cannot find an example of how to do it? I found a jSon value provider from Phil Haack [URL] but I was specifically told not to use the Futures Library. Is there any example of how to accept a jSon result in an ActionResult?

View 3 Replies

Altering The MVC 2 ActionResult On HTTP Post?

May 2, 2010

I want to do some processing on a attribute before returning the view. If I set the appModel.Markup returned in the HttpPost ActionResult method below to "modified" it still says "original" on the form. Why cant I modify my attribute in a HttpGet ActionResult method?

[HttpGet]
public ActionResult Index()
{
return View(new MyModel
{
Markup = "original"
});
}
[HttpPost]
public ActionResult Index(MyModel appModel)
{
return View(new MyModel
{
Markup = "modified"
});
}

View 1 Replies

MVC :: Call A Javascript Function From ActionResult?

Mar 23, 2010

I need to call a javascript function from ActionResult code behind file.

On ASP.net i used ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", "alertMe();", true); , but on mvc is not working anymore.

View 4 Replies

MVC :: ActionResult Subclass Sending A POST?

Apr 1, 2010

Calling aContext.Response.Redirect(...) from an ActionResult subclass' ExecuteResult method results in an HTTP GET being sent to the specified URL.

Does someone know how to get the redirect to send an HTTP POST instead? This is necessary for passing control to PayPal's payment page.

View 6 Replies

MVC :: Calling An Asmx Webservice From ActionResult?

Feb 11, 2011

I have an old legacy webservice that I need to call from a controller ActionResult and I have no idea how to do it.

View 5 Replies

MVC :: Creating A Custom Actionresult In 2 To Generate JSONP

Jan 3, 2011

i have a need to generate JSONP using MVC 2 for a 3rd party App...It seems there is no actionresult for this OOTB in MVC 2 so i need to create a custom one..i found the following article on such here; [URL] My first question is...Where do i put the custom actionresult code? Secondly...How can i use this to new JSONP actionresult to return data from my data model? Currently , my current JSON actionresult (remember..i need JSONP) looks like this;

[Code]....

How can i use the new JSONP Actionresult to return db.GetTopGainers()?

View 2 Replies

MVC :: How To Manually Execute ActionResult Of Child-action

Mar 26, 2011

Normally, we render a child-action by this code:

[Code]....

But child-action can not return a redirect-action-result, because this code is excuted when server is rendering HTML to client.

Now, I want to invoke an action by code in Controller, it returns an ActionResult. Then, if it's a redirect-result, I returns it. Otherwise, in Razor code, I renders this ActionResult. For example:

In controller:

[Code]....

In view:

[Code]....

View 4 Replies

MVC :: What View Is Used When Calling A Controller Method Without ActionResult

Jan 9, 2010

I have just started using MVC. I created the MVC application and was playing around with it.When you call the http://localhost/home/Index/ on the sample MVC application the Index method of the controller home gets invoked and the view Index.aspx is displayed and similarly when we call http://localhost/home/About/ then the About method of the Home controller is invoked and the About.aspx page is displayed

View 2 Replies

.NET MVC Controller FileContent ActionResult Called From JQuery?

Feb 10, 2010

I have a controller method "SaveFile" that attempts to download a binary stream to client's PC using the FileContentResult. If I make the call as a post from the controller corresponding view everything works OK. I want to call the same controller method "SaveFile" from a jquery function via an .ajax call, when I do the function returns an error and the responseText is the contents of the file to be written. What would I have to do to get the same behavior from a jQuery function as if the MVC framework handled the call via the submit button? Or an alternate solution would be to determine how can I catch the browser's download dialog close event.

View 1 Replies

MVC :: Bind ActionResult IEnumerable Property In Model?

Nov 23, 2010

How I can bind in my ActionResult IEnumerable property in Model.

Objects:

public class Project
{
public int ProjectID {get;set;}
public IEnumerable<Category> Categories {get;set;}
}

[Code]....

View 15 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved