Help on Set Values in to textboxes using $getJson in MVC??
Hi,
- $("#btnAutoGenerate").click(function() {
- $.getJSON("<%=Url.Action("GetAutoGenerateCode")%>",function (data) {
- if (data) {
- $("#txtAutoGenerate1").val(data[0]);
- }
- });
- });
-
-
- In controller:
-
- <AcceptVerbs(HttpVerbs.[Get])> _
- Function GetAutoGenerateCode() As ActionResult
- Dim arrCode As New ArrayList
- Dim alngCodeMaxLength = Session("CodeMaxLength")
- Dim ResetPassword As New ResetPassword
- Try
- arrCode = ResetPassword.GenerateRandomCode(alngCodeMaxLength)
- Return Json(arrCode, JsonRequestBehavior.AllowGet)
-
- Catch ex As Exception
- Throw ex
- End Try
- End Function
-
-
- If i keep or remove this line $("#txtAutoGenerate1").val(data[0]); even though iam
- getting this pop up, this pop up i am attaching here...
