Tag Archives: CSS

[RESOLVED]page and ajax

When the page
shows a portion of the content
using
ajax, it
has 2
connection -
to the current page
and the page
requested by ajax?
Likewise with the
iframe? Trying to
optimize your site, but it turns out
that the use of Ajax
only
clog the channel.

It initiates a new connection, but these connections are permanent, they only exist until the content is retrieved.  Use the network section of the browser’s developer tools (f12) and you’ll get to see all the connections your page makes.  It will make a
connection for each image, script file, css file etc too.  If any ajax code runs that will instantiate a connection, as will an Iframe, and any resources (images, script files, css files) used in the iframe will kick off a connection, as will any images etc
referenced by html you return from your ajax call.

[RESOLVED]Can I use the latest version of TinyMce with mvc5?

I guess the subjects says it all but has anyone done this and if so is there a tutorial anywhere?

Cheers,

Mike.

tinymce is strictly  client side. Its works with any server code. see the tutorials on their site. server side it just a textarea.

  @Html.TextArea("nameOfField")

be sure to add [AllowHtml] to the post back model field.

Yes but I need to use @Html.EditorFor to populate the TextArea with the data in an Edit view.

As Bruce mentions, the TinyMCE Editor is purely client-side and has nothing to do with MVC specifically. You should be able to use it as long as you have any fields that generate a <textarea> element.

It should be noted that you don’t have to use an Html.EditorFor() helper to populate your element. You could explicitly use the Html.TextAreaFor() to ensure that an actual <textarea> element is rendered and then apply the appropriate client-side code to
initialize the TinyMCE.

Complete Example

  1. Create an Project that targets MVC 5.
  2. Add the latest TinyMCE Package via NuGet (Right-click Solution > Manage NuGet Packages > Search for "TinyMCE" > Install the first "TinyMCE" package that appears).
  3. Create an Example Controller with a class that will be equivalent to your Model as seen below :
    public class TinyMCEController : Controller
    {
            // An action to display your TinyMCE editor
            public ActionResult Index()
            {
                return View();
            }
    
            // An action that will accept your Html Content
            [HttpPost]
            public ActionResult Index(ExampleClass model)
            {
                return View();
            }
    }
    
    // An example class to store your values
    public class ExampleClass
    {
            // This attributes allows your HTML Content to be sent up
            [AllowHtml]
            public string HtmlContent { get; set; } 
    
            public ExampleClass()
            {
    
            }
    }
  4. Create a View that will wire up your TinyMCE Editor and will contain the necessary code to post your HTML content :
    <!-- This View uses your Model -->
    @model TinyMCE.Controllers.ExampleClass
    <!DOCTYPE html>
    <html>
    <head>
        <meta name="viewport" content="width=device-width" />
        <title>TinyMCE Example</title>
        <!-- TinyMCE Script Reference -->
        <script src="~/scripts/tinymce/tinymce.min.js"></script>
        <!-- Script to wire up your TinyMCE editor -->
        <script type="text/javascript">
            // Initialize your tinyMCE Editor with your preferred options
            tinyMCE.init({
                // General options
                mode: "textareas",
                theme: "modern",
                // Theme options
                theme_advanced_buttons1: "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect,fontselect,fontsizeselect",
                theme_advanced_buttons2: "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
                theme_advanced_buttons3: "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
                theme_advanced_buttons4: "insertlayer,moveforward,movebackward,absolute,|,styleprops,spellchecker,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,blockquote,pagebreak,|,insertfile,insertimage",
                theme_advanced_toolbar_location: "top",
                theme_advanced_toolbar_align: "left",
                theme_advanced_statusbar_location: "bottom",
                theme_advanced_resizing: true,
    
                // Example content CSS (should be your site CSS)
                content_css: "css/example.css",
            });
        </script>
    </head>
    <body>
        <!-- This will automatically post to your Index method (that is decorated with a HttpPost attribute) -->
        @using (Html.BeginForm()) 
        {
            @Html.AntiForgeryToken()
            <div>
                <!-- This will contain your HtmlContent and use the TinyMCE editor-->
                @Html.TextAreaFor(model => model.HtmlContent)
               
                <input type="submit" value="Create" />
            </div>
        }
    </body>
    </html>
  5. Now if you navigate to your Index Action, you should see the following :
  6. And then if you Submit it, you should see your HTML Content available in your Controller :

This should be all you need to wire everything up.

Thanks Rion,

That was easier than installing the MVC version Smile

Cheers,

Mike

[RESOLVED]Strange behavior from Create View

I have an ASP.Net MVC 4 web app.  I  have this one particular controller.  The index view for this controller has three partial views on it.  The first partial view always loads when the view is called.  It uses a renderAction html helper.  The other two
are called as a result of ajax function calls within the create view.

The index view has a JQuery datatables library included which is built using JqueryUI.  There are no JQueryUI components on the Create View.

As the result of a button click, the Create view calls a function which first calls one ajax function to save the data to the database, then another ajax call to the action used by the renderAction to build the first partial view.  This function was devised
months ago and has been running without an issue.   Then suddenly today, the button click would save the data, then open the index view.  This was not the expected behavior.  When I stepped through the code line by line I found that the pratial view was in
fact bveing loaded into the proper location on the create view.  And in fact when doing so the proper window opened in IE.  But then a bunch of additional code in modernizer, Jquery-1.8.2 and jQuery-UI-1.8.24 started running and when it completed it opened
on the Index view.  I have no idea how this happened.  See the code below

First I called an ajax like so

    $(function () {
        var PopulatePRs = function () {
            ////debugger
            var sURL = '@Url.Action("CreatePurchaseRequest", "AJAXFunctions")';
            var goURLid = 0;
            var form = $("#PRCreate");
            var bError = false;
            var sResultMessage = '';

            //alert(options.url);
            $.ajax({
                url: sURL,
                type: 'POST',
                data: form.serialize(),
                cache: false,
                async: false,
                dataType: 'json',
                //contentType: 'application/json; charset=utf-8',
                success: function (data) {
                    debugger
                    if (data != null) {
                        $(data).each(function () {
                            goURLid = data;
                        });
                    }
                    else {
                        debugger
                        returnedInfo = 'An Error has occurred. Your new PR was not saved to the database.';
                        bError = true;
                        goURLid = 0;
                    }
                },
                error: function () {
                    debugger
                    returnedInfo = 'An Error has occurred. Your new PR was not saved to the database.';
                    bError = true;
                    goURLid = 0;
                }
            });

This works fine.   I have verified in the database that the ajax call was successful.  Then the following ajax function is called to call the action that rebuilds the partial view.

           debugger
            //if (!bError) {
            var sURLRepost = '@Url.Action("PurchaseRequestTable", "PR")' + '/' + goURLid;
            var options = {
                url: sURLRepost,
                type: "get",
                async: false
            };
            //alert(options.url);
            $.ajax(options).done(function (data) {
                debugger
                $("#PRtableView").replaceWith(data);
            });

            if (!bError) {
                sResultMessage = "The new Purchase Request has been saved to the database.nClick below to add CLINs and CDRLs.";
                $("#PRCreated").text(sResultMessage).toggle();
            }
            else {
                sResultMessage = returnedInfo;
                $("#PRCreated").text(sResultMessage).toggle();
            }

The action is properly called the ajax call which I was able to verify by putting a breakpoint in the action and stepping through it and I was able to hover over the "data" variable and verify that the proper html was being returned to replace $("#PRtableView"). 
Finally I was able to verify the sResultMessage was replacing the text of $("#PRCreated").  Then I actually saw the window open looking as it is supposed to.

Then the part of modernizer that starts with the below code ran:

window.Modernizr = (function( window, document, undefined ) {


    var version = '2.6.2',


    Modernizr = {},

    /*>>cssclasses*/

    // option for enabling the HTML classes to be added

    enableClasses = true,

    /*>>cssclasses*/

Then in JQuery-1.8.2 the function that starts with this:

(function( window, undefined ) {
var
	// A central reference to the root jQuery(document)
	rootjQuery,

	// The deferred used on DOM ready
	readyList,

	// Use the correct document accordingly with window argument (sandbox)
	document = window.document,
	location = window.location,
	navigator = window.navigator,

	// Map over jQuery in case of overwrite
	_jQuery = window.jQuery,

Then this function

(function( $, undefined ) {


// prevent duplicate loading

// this is only a problem because we proxy existing functions

// and we don't want to double proxy them

$.ui = $.ui || {};

if ( $.ui.version ) {

	return;

}

Then this function

function( $, undefined ) {



// jQuery 1.4+

if ( $.cleanData ) {

	var _cleanData = $.cleanData;

	$.cleanData = function( elems ) {

		for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {

			try {

				$( elem ).triggerHandler( "remove" );

			// http://bugs.jquery.com/ticket/8235

			} catch( e ) {}

		}

		_cleanData( elems );

	};

} else {

	var _remove = $.fn.remove;

	$.fn.remove = function( selector, keepData ) {

		return this.each(function() {

			if ( !keepData ) {

				if ( !selector || $.filter( selector, [ this ] ).length ) {

					$( "*", this ).add( [ this ] ).each(function() {

						try {

							$( this ).triggerHandler( "remove" );

						// http://bugs.jquery.com/ticket/8235

						} catch( e ) {}

					});

				}

			}

			return _remove.call( $(this), selector, keepData );

		});

	};

}

Then in JQuery-ui-1.8.24

(function( $, undefined ) {


var mouseHandled = false;

$( document ).mouseup( function( e ) {

	mouseHandled = false;

});

then

function( $, undefined ) {


$.widget("ui.draggable", $.ui.mouse, {

	widgetEventPrefix: "drag",
...

then

(function( $, undefined ) {


$.widget("ui.droppable", {

	widgetEventPrefix: "drop",

	options: {

		accept: '*',
....

and a few more $.widget methods.

And when all of these finished, then the index view was opened.

Like I said it did not do that from a couple of months ago up to a couple of days ago.  It did not do this when I first ran it this morning.  It just started to do this, this morning at a demonstration for the customer, and has been doing this ever since.

I am baffeled.  If anyone can point me in the right direction I would be most grateful.

Found it.  This page
http://forums.asp.net/p/2010964/5786750.aspx?p=True&t=635478678680887055&pagenum=1
 I was advised to put href = "" in my links to make the syle of a link appear on the page.  I had forgotten that I read somewhere that when no index is passed to the url,
then the user is routed to the index method of the controller.  That is what happened here after I made the change referenced above. 

So I will have to hard code a style just for these elements in the style sheet.

Hi joeller,

If the href attribute is not present, the <a> tag is not a hyperlink. In HTML5, if the <a> tag has no href attribute, it is a placeholder for a hyperlink.

# HTML <a> href Attribute

http://www.w3schools.com/tags/att_a_href.asp

Best Regards

Starain Chen

[RESOLVED]How to get started with ASP.NET MVC ?

I’ve learned ASP.NET 2-3 years ago and I’d made some projects on ASP.NET. Now It feels like I can improve them little bit. As I’ve some 15 days free, So I was thinking to learn something new and use it in my old projects.

Actually there are some areas in my projects where I’ve to design new tools which is not possible with ASP.NET alone. For example I’m having "Virtual Classroom Project" and there is a tool called "White Board" which allow Professor to explain the things
to students. I was going to start learning Silverlight then some of my friends suggested me of ASP.NET MVC.  I’m new to ASP.NET MVC and don’t know anything about it.

How it is different from ASP.NET ?
What features does it offers ?
Whats the future of it ?
How much ASP.NET MVC coding is different from ASP.NET ?
How much time will it take to learn ASP.NET MVC ?

I’d suggest to spend 1 hour of 15 days to google all 5 questions.

Spend an hour or two and walk through this beginner’s tutorial:

http://www.asp.net/mvc/tutorials/mvc-music-store/mvc-music-store-part-1

this tutorial covers most of the basics for MVC.  Please note that this tutorial is slightly dated — I believe it’s more for MVC 3 than 5, however the same principles still apply.

MVC Resources

The Getting Started MVC area on this site is a great place to start as well if you want to start learning MVC outside of a book environment. It will cover just about everything that you would need to build complete applications
and it is written by experts that apply best practices to help you build good habits for future applications.

One of the most well regarded and complete MVC-based tutorials would be the ASP.NET MVC Music Store tutorial, which you can find under the MVC section of this site. However, any
of the tutorials on this site
 should be great stepping stones to get you building your own complete MVC applications in no time.

You can find a few other resources listing off countless other MVC-based tutorials below: 

or the following more architecturally based examples :

I would definately recommend the MVC Music Store Tutorial as well as the other ones available on this site (ASP.NET) and if you are still looking for more information after that, check out some of the other links I provided. If you are still looking
for some additional tutorials or other MVC based projects, you might want to dig around on open-source sites like github and Codeplex and search for a bit more complex sites and projects.

Regarding Your Questions

22990atinesh

How it is different from ASP.NET ?

Technically, ASP.NET is still based on the same framework as Web Forms (which I am assuming that you are referring to in this context). MVC just provides a different pattern and approach to developing your applications. It is patterned after the
web and thus is stateless (so you don’t have a ViewState or any Controls). Due to it’s nature, it lends itself well to separating your concerns (all of your Presentation-related code is within the Views, your business logic will be within your
models and your Controllers will handle your data access
).

22990atinesh

What features does it offers ?

It doesn’t necessarily "offer" any newer features. Some might argue that it can be tested more easily than Web Forms (if you actually are one of the people out there writing tests consistently). I personally find it to be much simpler than Web Forms in a
very "bare-bones" sense.

22990atinesh

Whats the future of it ?

Bright. MVC has really taken off since it’s release and is continuing to gain more and more steam for developing Microsoft Web Applications. Web Forms is still completely relevant and will continue to play a major role, but MVC is certainly catching up.

It’s worth learning.

22990atinesh

How much ASP.NET MVC coding is different from ASP.NET ?

As I mentioned earlier, there are quite a few learning curves associated with it. The lack of "Controls" can be tough for those migrating from Web Forms as can the lack of a state. Since controls don’t exist, it requires developers to be much more comfortable
with using pure HTML and Javascript to accomplish many of the things that their controls did previously. 

22990atinesh

How much time will it take to learn ASP.NET MVC ?

This is something that depends entirely on you and how quickly you can understand the different components of an MVC application and how they work together. The tutorials mentioned earlier should help with this.

22990atinesh

there is a tool called "White Board" which allow Professor to explain the things to students

SignalR is a good fit for your whiteboard application. Please take look at these posts

Online
Whiteboard using HTML5 and
SignalR

A SignalR Whiteboard

22990atinesh

As I’ve some 15 days free, So I was thinking to learn something new and use it in my old projects.

I recommend learning AngularJS. It is getting more traction now-a-days. You can use MVC/WebAPI with AngularJS

Rion Williams

MVC Resources

The Getting Started MVC area on this site is a great place to start as well if you want to start learning MVC outside of a book environment. It will cover just about everything that you would need to build complete applications
and it is written by experts that apply best practices to help you build good habits for future applications.

One of the most well regarded and complete MVC-based tutorials would be the ASP.NET MVC Music Store tutorial, which you can find under the MVC section of this site. However, any
of the tutorials on this site
 should be great stepping stones to get you building your own complete MVC applications in no time.

This is something that depends entirely on you and how quickly you can understand the different components of an MVC application and how they work together. The tutorials mentioned earlier should help with this.

Thanx for help Now I can start learning ASP.NET MVC.

How is ASP.NET Web Pages, Is it better than ASP.NET MVC. Is it possible create tools that I asked for with ASP.NET Web pages. 

ASP.NET Web pages are completely different than MVC.If you are strong with HTML concepts you may be able to learn it quickly.

22990atinesh

How is ASP.NET Web Pages, Is it better than ASP.NET MVC. Is it possible create tools that I asked for with ASP.NET Web pages. 

Neither are necessarily better than the others, they are different patterns / technologies that both can be used to create Web Applications. Web Pages can be thought of as a more entry-level technology (not to say that it cannot be used to build complex
Web Applications
) whereas MVC encompasses a much larger set of libraries and in general more complex (which might be overkill for something as simple as a Web Site).

Both can create Web Applications, which is ultimately what your goal is, so either might be worth exploring as an option.

Rion Williams

22990atinesh

How is ASP.NET Web Pages, Is it better than ASP.NET MVC. Is it possible create tools that I asked for with ASP.NET Web pages. 

Neither are necessarily better than the others, they are different patterns / technologies that both can be used to create Web Applications. Web Pages can be thought of as a more entry-level technology (not to say that it cannot be used to build complex
Web Applications
) whereas MVC encompasses a much larger set of libraries and in general more complex (which might be overkill for something as simple as a Web Site).

Both can create Web Applications, which is ultimately what your goal is, so either might be worth exploring as an option.

I’ve tried ASP.NET MVC, It’s a totally new concept. I’ll learn it in the future. For now I just want to create a "White Board tool" which should be capable of displaying PPT, PDF, have Simple Drawing tool and a chat box. Can I do it with the help of HTML
5 + Jquery + CSS

22990atinesh

I’ve tried ASP.NET MVC, It’s a totally new concept. I’ll learn it in the future. For now I just want to create a "White Board tool" which should be capable of displaying PPT, PDF, have Simple Drawing tool and a chat box. Can I do it with the help of HTML 5
+ Jquery + CSS

You’ll likely need to use some kind of server-side code in order to properly retrieve your various types of files (unless they are explicitly stored in the same directory as your project and you would be accessing them through links). Additionally,
most browsers are not going to be able to "display" files like PowerPoint natively, you’ll need to look into a library as a way to present these within the browser (although there are other
ways to embed a PowerPoint presentation within your web application
).

Finally, a drawing tool shouldn’t be too out of reach as it’s very commonly implemented using the HTML <canvas> element along with a bit of Javascript / jQuery. If you search around for it, you shouldn’t have too much trouble finding a simple HTML5 Drawing
implementation. There are quite a few "it depends" answers related to a project like this and I am sure that you should be able to accomplish something like it using either a pure HTML5 / Javascript implementation or one that leverages ASP.NET (either
Web Pages or MVC
).

zing!

22990atinesh

Can I do it with the help of HTML 5 + Jquery + CSS

Have you looked at my earlier links?

Online
Whiteboard using HTML5 and
SignalR

A SignalR Whiteboard

Let’s see videos to understand about MVC .NET. You can understand some things

http://youtu.be/lG49gPy-hG0

http://youtu.be/ZKYlK4RFa1I

http://youtu.be/-ZdgU8Hngxw

Hi,

Please use below link to know about basic MVC history, basic, business section are same what we had been used in ASP.Net. 

http://www.asp.net/mvc

http://mvc4beginner.com/Tutorial/

http://msdn.microsoft.com/en-us/vs2010trainingcourse_aspnetmvc3razor.aspx

http://20fingers2brains.blogspot.com/2014/01/introduction-to-aspnet-mvc-3.html

http://www.microsoftvirtualacademy.com/training-courses/introduction-to-asp-net-mvc

Please don’t rush to learn short time, please work out what you learn day by day.

Thanks,

Jai.

Rion Williams

22990atinesh

I’ve tried ASP.NET MVC, It’s a totally new concept. I’ll learn it in the future. For now I just want to create a "White Board tool" which should be capable of displaying PPT, PDF, have Simple Drawing tool and a chat box. Can I do it with the help of HTML 5
+ Jquery + CSS

You’ll likely need to use some kind of server-side code in order to properly retrieve your various types of files (unless they are explicitly stored in the same directory as your project and you would be accessing them through links). Additionally,
most browsers are not going to be able to "display" files like PowerPoint natively, you’ll need to look into a library as a way to present these within the browser (although there are other
ways to embed a PowerPoint presentation within your web application
).

Finally, a drawing tool shouldn’t be too out of reach as it’s very commonly implemented using the HTML <canvas> element along with a bit of Javascript / jQuery. If you search around for it, you shouldn’t have too much trouble finding a simple HTML5 Drawing
implementation. There are quite a few "it depends" answers related to a project like this and I am sure that you should be able to accomplish something like it using either a pure HTML5 / Javascript implementation or one that leverages ASP.NET (either
Web Pages or MVC
).

Hello Rion William,
I’ve read SignalR articles from official ASP.NET website. Its a very cool and easy concept. A simple "Chat box" App requires only few lines of code (hardly 7-8 lines of code after adding the SignalR library) and its quite self explanatory. And Ya HTML 5 canavas
is also easy way to create white board. I can combine these two to make a simple White board tool, But I’m trying to build a more advanced white board tool with more flexibility and more featues. Please see this post

http://forums.asp.net/t/2012233.aspx?What+you+can+and+can+not+do+with+ASP+NET+SignalR+

Pro ASP.NET MVC 5

[RESOLVED]How to get the id of anchor tag created in mvc razor view.

Hello,

I am new for MVC, been trying to send the id of the anchor tag clicked to the controller.

<table width="100%">
                    <tr>                  
                       
            @foreach (var item in ViewBag.Schedules as List<BMS.DataAccessLayer.Schedules>)
                {    <td>
                             <span class="span12">
                   <a href="@Url.Action("AgentHomePost")"><img src="@Url.Content(@item.IconUrl.ToString())" width="150px" height="150px" name="@item.BreakTypeName" class=" wip" id="@item.BreakTypeName" alt="@item.BreakTypeName"/> </a> 
                   
                 </span>
                        </td>
                   
                }    
                         </tr>
                </table>
 public ActionResult AgentHomePost(string Id)
        {
            // blah blah
            return RedirectToAction("AgentHome", "Home");
        }

I assume that you’ve validated and can see the id’s you want (View Page Source).

The next thing you need to do it put some selection mechanism for the user and encapsulate it all in a @Html.BeginForm block with a submit form.  I would personally not construct the view in the view, I would construct the infrastructure for the view in
the viewmodel and pass a strongly typed view using that viewmodel to the view.  But that’s my preference.

This
post
shows a good example.

instead of using <a> tag, try using @html.action, you can pass the input parameters as route values of action link

@Html.ActionLink("Back
to List"
,
"AgentHomePost",
new
{ id=item.BreakTypeName})

To get the image, you need to place a <div> tag around @html.ActionLink and use a css class whose bakground
is the image, and set the width of div to the images width

<div
class="ActiveNav">@Html.ActionLink("Back
to List"
,
"AgentHomePost",
new
{ id=item.BreakTypeName})
</div>

.ActiveNav

{width:120px;height:23px;background:url(images/Nav.png)
no-repeat;padding-top:7px;padding-left:10px;}

you might have to put separate css for different type of url.

 

Hi,

You have to use the overload version of the Url.Action(string,object)

In your case, it has to be:
<a href=’@Url.Action("AgentHomePost",new{Id=item.BreakTypeName})’>

check this for overloaded method details:
http://msdn.microsoft.com/en-us/library/dd460294%28v=vs.118%29.aspx

Hi Ashim,

@Url.Action() is the right solution for this issue. 

let me know if any other issue. 

[RESOLVED]Pop Up not posting data to controller

Hi! I am pretty new to ASP.NET MVC5, and I am dealingwith something strange,

I have a view , displaying some data from the model that the controller returns (a, b, c), and threeHidden fields with those values.

@using (Ajax.BeginForm("Registro", "Experiencias", null, new AjaxOptions { HttpMethod = "POST", OnSuccess = "detalleSuccess" }, new { id = "DetalleForm", name="DetalleForm" }))
{
    
    @Html.Hidden("idExperiencia", Model.a)
    @Html.Hidden("exclusiva", Model.b)
    @Html.Hidden("idPregunta", Model.c)
    <div class="texto">
         <h2 class="titulo">@Model.a</h2>
         <p class="font_18">@Model.b</p>
         <p class="font_18">@Model.c</p>
    </div>
    <div class="row_derecha">
       <a href="#" class="boton_azul pos_abajo basic6" onclick="ParticiparModal('modal-popup')">Show</a>
    </div>


    <div id="modal-popup" style="display: none;">
         <div class="campo_datos ">
              @Html.TextBoxFor(model => Model.email, new { @class = "input_popup", id = "email", name="correoElectronico"})
         </div>
         <div class="container_boton_condiciones submitbutton" data-form-name="DetalleForm"><a class="boton_grande naranja" href="#">Send</a></div>
    </div>

In the view there is a link that opens the pop up "modal-popup". This pop up has a text box where the user must enter an email address and it is supoosed to be stored in the model.email field. Then if you click in the Send button, the form is submitted.

The problem is that the POST controller action receives a Model object but it is allways null, I think it’s because the model is quite complicated, it has a list inside it and some other objects, and the model binder does not know how to translate it, so
I want to do a Model Binder.

To do it I look at the POST action that is sent by the form (with firebug)  and I see that in the POST action it only sends the hidden fields that are outside of the pop up, in this case it only sends "idExperiencia", "exclusiva" and "idPregunta", I have
tried to add a hidden field in the pop up but it doesn’t appear in the post parameters.

Do you have any idea why the post action is only sending the hidden fields of the main page?

I hope somebody could help me

Thanks!

Post your entire view and model please

you don’t say which modal framework you are using, but most move the modal content to end of the body to make the css work. of course after this, the field is no longer in the form. you need to put the form in the modal, or write javascript to move the modal
back (may need to modify css to get this to work).