ASP.NET MVC “thickbox” Modal Dialog and selectList form

Last post 11-10-2009 2:37 AM by KeFang Chen - MSFT. 1 replies.

Sort Posts:

  • ASP.NET MVC “thickbox” Modal Dialog and selectList form

    11-07-2009, 11:47 AM
    • Member
      6 point Member
    • abedijoo
    • Member since 05-02-2009, 6:21 AM
    • Posts 8

    User has to input a field by selecting a row from a list.

    I can show a list in Modal Dialog with "thickbox". something like this.

    <%=  Ajax.ActionLink("Please Select From List...", "ShowItemsList", "MyController",ViewData.Model, new AjaxOptions {  InsertionMode = InsertionMode.Replace }, new { @class = "thickbox" })%>

    But i do not know what shall i do, after user selecting a row in the list? how can i refresh the parent, without losing user data entered?

  • Re: ASP.NET MVC “thickbox” Modal Dialog and selectList form

    11-10-2009, 2:37 AM
    Answer

    Hi,

    It seems that you don't know how to assgin the selected value to the input textbox.

    I don't understand how you show the list with the code above.

    So I just share some experience with you.

    Firstly I will display a list with "Html.ListBox" or "Html.DropDownList". Then I will use jquery to add changed event to the list and assign the selected value to the input textbox. Before you begin to refresh the 'parent', rember to send the data to server and save it .Then send it to client again. And you can check the object that you use to store the data to see whether  it is nul. If not, Then assian it to textbox, or else set the textbox blank;

    If you still have the problem, please let me know. Thanks.

Page 1 of 1 (2 items)