This question is locked. New answers and comments are not allowed.
Hi
I have a situation where in i need to add more than 1 email address when user click on + link.
In order to archive this i created a partial view with 'email type' dropdown and textbox for 'email address'. when i click on + link ajax call goes to my action which get the emailtype datasource into viewbad and return the partial view.
Partial view added into a div but when i try to select the dropdown it is not listing the value. It look like a disabled on, but it shows first value in the dropdown. Only issue is i cant able to select value from newly loaded partial view dropdown.
Following is my code snippets
PartialView
Controller that returns partial view
I have a situation where in i need to add more than 1 email address when user click on + link.
In order to archive this i created a partial view with 'email type' dropdown and textbox for 'email address'. when i click on + link ajax call goes to my action which get the emailtype datasource into viewbad and return the partial view.
Partial view added into a div but when i try to select the dropdown it is not listing the value. It look like a disabled on, but it shows first value in the dropdown. Only issue is i cant able to select value from newly loaded partial view dropdown.
Following is my code snippets
PartialView
@using Telerik.Web.Mvc.UI<div> @(Html.Telerik().DropDownList().Name("ddnEmailType").BindTo(new SelectList(ViewBag.EmailType, "ReferenceId", "ReferenceName")) .HtmlAttributes(new { style = string.Format("width:{0}px", 80) })) @Html.TextBox("txtEmail")</div>
Controller that returns partial view
Runtime Observation: 1 diff that i found on the control that rendered on the browser is, The control in view page has some jquery###### no =## but the one added by partial view does not have it.public ActionResult AddEmail(){ViewBag.EmailType = // Logic to get email type from database eg: home, office are 2 type from database.return PartialView("_AddEmailPartial");}
View which gets user's information(this has + link to get more than 1 type of email address)/// this is the ajax link that used to add more than 1 email type.@Ajax.ActionLink(" ", "AddEmail", null, new AjaxOptions{ InsertionMode = InsertionMode.InsertAfter, UpdateTargetId = "addemailaddress" }, new { @class = "AddIcon" })<divid="addemailaddress"class="phoneMailSectionAdd">/// this is the div used to add the partial view.</div>
Please reply me as soon as possible.