|
I have dropdown list in a partial class. The drop down in the partial class is generated on angularjs. Problem is now I wanted to populates the dropdown in the partial view based upon the selection of the value of the dropdown list, present in the view.
I write the following code but it is not working.
1) The dropdownlist selectedchange event in cshtml file..
$("#ddOrd").change(function () {
if ($("#ddOrd option:selected").text() == "ASK") {
$.ajax({
type: 'POST',
url: '@Url.Action("GetPayment")',
dataType: 'json',
data: { Ord: $("#ddOrd").val() }
});
}
})
2) in the controller class I made the following changes...
public JsonResult GetPayment(string ord)
{
List<payment> customPaymentlist = db.Payment.Where(obj => obj.Name== "ASK").ToList();
ViewBag.Payment = db.Payment.Where(obj => obj.Name == "ASK").ToList();
ViewBag.Payment = customPaymentlist;
return Json(customPaymentlist);
}
3) The Partial View Contains the following code in which I haven't change any thing.. copying it for just reference...
{{type.payment1}}
I haven't use angularjs before so I am not clear the details of it. Now GetPayment function fetching the required record but the problem is that it is not populating the same record in the dropdownlist in the partial view. Please suggest any solution.
modified 18-May-17 2:23am.
|
|
|
|
|
Hi,
I am getting the following error??? Please help???
ERROR:
Server Error in '/Online_Book_Shopping' Application.
The remote name could not be resolved: 'smtp.gmail.com'
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Net.WebException: The remote name could not be resolved: 'smtp.gmail.com'
Source Error:
Line 60: smt.Port = 587;
Line 61: smt.EnableSsl= true;
Line 62: smt.Send(msg);//Error comes in this line of code
Line 63: lblmsg.Text = "Username and Password Sent Successfully";
Line 64: lblmsg.ForeColor = System.Drawing.Color.ForestGreen;
Source File: e:\Vijaya\Online_Book_Shopping\ForgetPassword.aspx.cs Line: 62
Following is the code:-
using System.Net;
using System.Net.Mail;
using System.Drawing;
using System.Configuration;
using System.Data.SqlClient;
using System.Data;
public partial class ForgetPassword : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
string username = "";
string password = "";
string constr = ConfigurationManager.ConnectionStrings["CS"].ConnectionString;
SqlConnection con = new SqlConnection(constr);
{
SqlCommand cmd = new SqlCommand("select Name, Password from dbo.RegisteredUsers where Email=@email", con);
cmd.Parameters.AddWithValue("Email", txtemail.Text);
con.Open();
using (SqlDataReader dr = cmd.ExecuteReader())
{
if (dr.Read())
{
username = dr["Name"].ToString();
password = dr["Password"].ToString();
}
}
con.Close();
if (!string.IsNullOrEmpty(username))
{
MailMessage msg = new MailMessage();
msg.From = new MailAddress("nilusilu3@gmail.com");
msg.To.Add(txtemail.Text);
msg.Subject = " Recover your Password";
msg.Body = ("Your Username is:" + username + "<br/><br/>" + "Your Password is:" + password);
msg.IsBodyHtml = true;
SmtpClient smt = new SmtpClient();
smt.Host = "smtp.gmail.com";
System.Net.NetworkCredential ntwd = new NetworkCredential();
ntwd.UserName = "nilusilu3@gmail.com";
ntwd.Password = "";
smt.UseDefaultCredentials = true;
smt.Credentials = ntwd;
smt.Port = 587;
smt.EnableSsl= true;
smt.Send(msg);
lblmsg.Text = "Username and Password Sent Successfully";
lblmsg.ForeColor = System.Drawing.Color.ForestGreen;
}
}
}
}
|
|
|
|
|
First check if there is internet connection at all...
Than try some changes in your code:
smt.UseDefaultCredentials = false;
smt.Credentials = new NetworkCredential("username", "password");
smt.DeliveryMethod = SmtpDeliveryMethod.Network;
Skipper: We'll fix it.
Alex: Fix it? How you gonna fix this?
Skipper: Grit, spit and a whole lotta duct tape.
|
|
|
|
|
It is no wonder so much hacking continues when people still store passwords in clear text. Please read Secure Password Authentication Explained Simply[^] and use some proper security on your site. You should also not send passwords via email, there are better, more secure methods, of resetting a user password.
|
|
|
|
|
Don't send email via gmail, don't send passwords via email, don't store passwords in clear text. Literally everything you are doing are things you shouldn't do.
As for the error it is a network error, nothing to do with your code and nothing that can be solved with code. Google the error for more info.
|
|
|
|
|
|
Hi Team,
I am using Telerik version 2013.3.1114.45 in my Asp.net application. Now I have upgraded my version into 2017.1.228.45. After upgradations lot of Telerik functionalities are not working.
Some of the examples I have described what I have faced so far as follows.
Scenario 1:
I am having rad numeric textboxes on my page. I entered the numeric values into the text box and press enter button.
Actual result: value cleared in the textbox (This problem occurred after upgradations)
Expected result: value shouldn't be cleared in the textbox.
Scenario 2 :
When I click the button the rad window needs to be displayed but it's not opening after upgradations.
Scenario 3
Rad grid row selections, tab index for rad grid also not working. The design was collapsed in rad controls.
Note:
If I do any postback, the Telerik controls are working good.
Queries
Whether we can upgrade Telerik version directly from 2013.3.1114.45 to 2017.1.228.45?
Please provide your valuable solutions.
Thanks in Advance!!!
Simiyon A
|
|
|
|
|
That's a commercial toolkit, which presumably comes with support.
Telerik support are the only people who can assist you with bugs in their software.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Hi All,
I am trying to return a DataSet that has 6 table to a cshtml file from Web Api, that DataSet is created by using the Entities from Entity Framework the reason I am returning the DataSet is I am converting the Entity Collections as Tables and wrapping them in a DataSet and returning that.
But I am getting the following Exceptions, anybody can please help me in fixing it? Here is my Get method Code:
public DataSet Get()
{
DataSet dsAllListsOfForm = new DataSet();
dsAllListsOfForm.Tables.Clear();
dynamic objCollection; DataTable table;
using (AppDevSecEntities ctx = new AppDevSecEntities())
{
objCollection = (from c in ctx.Departments orderby c.DepartmentName select c).AsQueryable();
table = Common.ConvertToDataTable<Department>(objCollection);
dsAllListsOfForm.Tables.Add(table);
objCollection = (from c in ctx.FunctionalCatagories orderby c.FunctionalCatagoryName select c).AsQueryable();
table = Common.ConvertToDataTable<FunctionalCatagory>(objCollection);
dsAllListsOfForm.Tables.Add(table);
objCollection = (from c in ctx.BusinessUnits orderby c.BusinessUnitName select c).AsQueryable();
table = Common.ConvertToDataTable<BusinessUnit>(objCollection);
dsAllListsOfForm.Tables.Add(table);
objCollection = (from c in ctx.Locations orderby c.LocationName select c).AsQueryable();
table = Common.ConvertToDataTable<Location>(objCollection);
dsAllListsOfForm.Tables.Add(table);
}
return dsAllListsOfForm;
}
Any help/suggestion is going to be very helpful, I am really new to the MVC and FrontEnd tools because I was working with Integrations for quite a While, thanks in advance.
Thanks,
Abdul Aleem
"There is already enough hatred in the world lets spread love, compassion and affection."
|
|
|
|
|
The full error would be helpful.
There are two kinds of people in the world: those who can extrapolate from incomplete data.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
Here is the full error message:
{"Message":"An error has occurred.","ExceptionMessage":"The 'ObjectContent1' type failed to serialize the response body for content type 'application/json; charset=utf-8'.","ExceptionType":"System.InvalidOperationException","StackTrace":null,"InnerException":{"Message":"An error has occurred.","ExceptionMessage":"Error getting value from 'UserJobRoles' on 'System.Data.Entity.DynamicProxies.UserJob_8B6D07991013E40D2C8A48D1247E9769FA4695229DBE170A0749E3AB1ADC9D3C'.","ExceptionType":"Newtonsoft.Json.JsonSerializationException","StackTrace":" at Newtonsoft.Json.Serialization.DynamicValueProvider.GetValue(Object target)\r\n at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.CalculatePropertyValues(JsonWriter writer, Object value, JsonContainerContract contract, JsonProperty member, JsonProperty property, JsonContract& memberContract, Object& memberValue)\r\n at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeObject(JsonWriter writer, Object value, JsonObjectContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty)\r\n at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeValue(JsonWriter writer, Object value, JsonContract valueContract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerProperty)\r\n at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeList(JsonWriter writer, IEnumerable values, JsonArrayContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty)\r\n at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeValue(JsonWriter writer, Object value, JsonContract valueContract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerProperty)\r\n at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeObject(JsonWriter writer, Object value, JsonObjectContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty)\r\n at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeValue(JsonWriter writer, Object value, JsonContract valueContract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerProperty)\r\n at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeObject(JsonWriter writer, Object value, JsonObjectContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty)\r\n at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeValue(JsonWriter writer, Object value, JsonContract valueContract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerProperty)\r\n at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeList(JsonWriter writer, IEnumerable values, JsonArrayContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty)\r\n at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeValue(JsonWriter writer, Object value, JsonContract valueContract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerProperty)\r\n at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeObject(JsonWriter writer, Object value, JsonObjectContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty)\r\n at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeValue(JsonWriter writer, Object value, JsonContract valueContract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerProperty)\r\n at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeObject(JsonWriter writer, Object value, JsonObjectContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty)\r\n at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeValue(JsonWriter writer, Object value, JsonContract valueContract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerProperty)\r\n at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeList(JsonWriter writer, IEnumerable values, JsonArrayContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty)\r\n at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeValue(JsonWriter writer, Object value, JsonContract valueContract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerProperty)\r\n at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeObject(JsonWriter writer, Object value, JsonObjectContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty)\r\n at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeValue(JsonWriter writer, Object value, JsonContract valueContract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerProperty)\r\n at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeList(JsonWriter writer, IEnumerable values, JsonArrayContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty)\r\n at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeValue(JsonWriter writer, Object value, JsonContract valueContract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerProperty)\r\n at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.Serialize(JsonWriter jsonWriter, Object value, Type objectType)\r\n at Newtonsoft.Json.Serialization.JsonSerializerProxy.SerializeInternal(JsonWriter jsonWriter, Object value, Type rootType)\r\n at Newtonsoft.Json.Converters.DataTableConverter.WriteJson(JsonWriter writer, Object value, JsonSerializer serializer)\r\n at Newtonsoft.Json.Converters.DataSetConverter.WriteJson(JsonWriter writer, Object value, JsonSerializer serializer)\r\n at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeConvertable(JsonWriter writer, JsonConverter converter, Object value, JsonContract contract, JsonContainerContract collectionContract, JsonProperty containerProperty)\r\n at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeValue(JsonWriter writer, Object value, JsonContract valueContract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerProperty)\r\n at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.Serialize(JsonWriter jsonWriter, Object value, Type objectType)\r\n at Newtonsoft.Json.JsonSerializer.SerializeInternal(JsonWriter jsonWriter, Object value, Type objectType)\r\n at System.Net.Http.Formatting.BaseJsonMediaTypeFormatter.WriteToStream(Type type, Object value, Stream writeStream, Encoding effectiveEncoding)\r\n at System.Net.Http.Formatting.JsonMediaTypeFormatter.WriteToStream(Type type, Object value, Stream writeStream, Encoding effectiveEncoding)\r\n at System.Net.Http.Formatting.BaseJsonMediaTypeFormatter.WriteToStream(Type type, Object value, Stream writeStream, HttpContent content)\r\n at System.Net.Http.Formatting.BaseJsonMediaTypeFormatter.WriteToStreamAsync(Type type, Object value, Stream writeStream, HttpContent content, TransportContext transportContext, CancellationToken cancellationToken)\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.WebHost.HttpControllerHandler.<WriteBufferedResponseContentAsync>d__1b.MoveNext()","InnerException":{"Message":"An error has occurred.","ExceptionMessage":"The ObjectContext instance has been disposed and can no longer be used for operations that require a connection.","ExceptionType":"System.ObjectDisposedException","StackTrace":" at System.Data.Entity.Core.Objects.ObjectContext.get_Connection()\r\n at System.Data.Entity.Core.Objects.ObjectQuery 1.GetResults(Nullable1 forMergeOption)\r\n at System.Data.Entity.Core.Objects.ObjectQuery 1.Execute(MergeOption mergeOption)\r\n at System.Data.Entity.Core.Objects.DataClasses.EntityCollection1.Load(List 1 collection, MergeOption mergeOption)\r\n at System.Data.Entity.Core.Objects.DataClasses.EntityCollection1.Load(MergeOption mergeOption)\r\n at System.Data.Entity.Core.Objects.DataClasses.RelatedEnd.DeferredLoad()\r\n at System.Data.Entity.Core.Objects.Internal.LazyLoadBehavior.LoadProperty[TItem](TItem propertyValue, String relationshipName, String targetRoleName, Boolean mustBeNull, Object wrapperObject)\r\n at System.Data.Entity.Core.Objects.Internal.LazyLoadBehavior.<>c__DisplayClass7 2.<getinterceptordelegate>b__1(TProxy proxy, TItem item)\r\n at System.Data.Entity.DynamicProxies.UserJob_8B6D07991013E40D2C8A48D1247E9769FA4695229DBE170A0749E3AB1ADC9D3C.get_UserJobRoles()\r\n at GetUserJobRoles(Object )\r\n at Newtonsoft.Json.Serialization.DynamicValueProvider.GetValue(Object target)"}}}
Thanks,
Abdul Aleem
"There is already enough hatred in the world lets spread love, compassion and affection."
|
|
|
|
|
This appears to be the important part: "The ObjectContext instance has been disposed and can no longer be used for operations that require a connection."
There are two kinds of people in the world: those who can extrapolate from incomplete data.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
indian143 wrote: the reason I am returning the DataSet is I am converting the Entity Collections as Tables and wrapping them in a DataSet and returning that.
So the reason you're returning a DataSet is because you're returning a DataSet ?
Is there an actual reason for doing that? I can't remember what a JSON-serialized DataSet looks like, but I can't imagine it's going to be easier to work with than an anonymous object containing the entities.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Hi Rick,
I am able to return it to the front end using Web Api Get method. I am seeing the bunch of Collection of DataTables. But now I need another simple for you but not simple for me to write a code. Because I am not good at front end script buddy.
Can you please guide me a little bit in writing a code which can retrieve DataTables from Web Api return object and then bind it to Dropdown lists that I am having in my html?
Like for example if I have 3 tables (Department, Location and Supervisor) in my DataSet and that DataSet is returned to cshtml file, then I want to retrieve each of those tables and bind them to related Dropdownlists, if support I am using the same name as the table names for the Dropdowns.
Thanks,
Abdul Aleem
"There is already enough hatred in the world lets spread love, compassion and affection."
|
|
|
|
|
As I said, it's much easier to consume the original entities from script, rather than trying to convert the entities to a DataSet on the server, and then having to jump through hoops to consume the data from script.
public object Get()
{
using (AppDevSecEntities ctx = new AppDevSecEntities())
{
return new
{
Departments = (from c in ctx.Departments orderby c.DepartmentName select c).ToList(),
FunctionalCategories = (from c in ctx.FunctionalCatagories orderby c.FunctionalCatagoryName select c).ToList(),
BusinessUnits = (from c in ctx.BusinessUnits orderby c.BusinessUnitName select c).ToList(),
Locations = (from c in ctx.Locations orderby c.LocationName select c).ToList(),
};
}
}
$.get("api/controller/Get").then(function(data){
var list = $("#Department");
var selectedValue = list.val();
list.empty();
$.each(data.Departments, function(index, department){
$("<option>").attr("value", department.ID).text(department.DepartmentName).appendTo(list);
});
list.val(selectedValue);
});
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Hi Rick, thank you very much as I am new to the MVC, so when I am calling the Web Api Action method, its going to go to the Controller Action and returning from there the Json but not returning to the html page, how should I work with Web API when I want to load the html, do I need to call the html and then call the web api methods or should I set up the Api Controller Action methods as start point and then redirect to my html page?
It is basic question but this is my first MVC (MVC Web Api) application, that's why I need help. Because in MVC applications the url would be controller action methods and then it will be binded to the cshtml file. But how can I do that in Web Api because by default the Action method is not going to html at all.
2. Another question is if I am calling API controller Get action method and redirecting to html page then, why should I call it again to load data, because I have written the returning of Data in the Get action method just like above.
Please help me in understanding this confusion a little bit. Thank you very much Rick.
Thanks,
Abdul Aleem
"There is already enough hatred in the world lets spread love, compassion and affection."
|
|
|
|
|
You don't use WebAPI controllers to return HTML. You use them to load or change the raw data.
Your MVC controller returns an HTML view, which includes Javascript to make an AJAX request to the WebAPI controller. The WebAPI controller returns the raw data formatted as JSON, which your Javascript can then use to update the UI without having to reload the whole page.
You can also use your WebAPI from other types of applications - WPF, Windows Store apps, mobile apps, etc.
Getting Started with ASP.NET Web API 2 (C#) | Microsoft Docs[^]
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Thanks for clearing all doubts my friend, its hard to do the things if we have done Web-farms long time and then worked only on back-end and middle tier for a while. I am sure I will enjoy programming the MVC and Web Api my friend, thanks again.
Thanks,
Abdul Aleem
"There is already enough hatred in the world lets spread love, compassion and affection."
|
|
|
|
|
hi to everyone
i need your help
i need to add GridView to a webpage using c#, without declare it in the page.aspx. is it possible?
i've tried in this way, but it never work
here the aspx
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" Runat="Server">
<section ID="normalElement" runat="server"></section>
<section ID="adminPanel" runat="server"></section>
<section ID="myC" runat="server"></section>
</asp:Content>
here the c#
GridView view = new GridView();
DataTable tbl = new DataTable();
DataColumn idCol = tbl.Columns.Add("COL_A");
idCol.DataType = System.Type.GetType("System.String");
DataColumn nameCol = tbl.Columns.Add("COL_B");
nameCol.DataType = System.Type.GetType("System.String");
DataColumn descrCol = tbl.Columns.Add("COL_C");
descrCol.DataType = System.Type.GetType("System.String");
DataColumn delCol = tbl.Columns.Add("COL_D");
delCol.DataType = System.Type.GetType("System.Boolean");
view.DataSource = tbl;
view.DataBind();
myC.Controls.Add(view);
but when i run the page, never appears on the page.
i've tried to add an empty row, but never change
so: is it possible doing what i'm trying to do?
thank you
|
|
|
|
|
With your code, you have created the table tbl but you did not bind any data to it, those are columns you defined with no data so it will not be visible on the page.
Try something like below -
Have a place holder as below -
<asp:PlaceHolder ID="ph" runat="server" />
I am able to add the grid on page with below code.
protected void Page_Load(object sender, EventArgs e)
{
List<string> countrylist = new List<string>() { "India", "US" };
GridView grid = new GridView();
grid.AutoGenerateColumns = true;
grid.DataSource = countrylist;
grid.DataBind();
ph.Controls.Add(grid);
}
modified 20-Sep-20 21:01pm.
|
|
|
|
|
<asp:Panel id="panel_left" runat="server" Visible="false">
<asp:UpdatePanel runat="server" ID="UpdatePanel1" UpdateMode="Conditional">
<Triggers>
<asp:AsyncPostBackTrigger ControlID="rdbGVRow" />
</Triggers>
<ContentTemplate>
<div class="row" style="padding-top:10px;">
<div class="col-md-12">
<div class="table-responsive" style="border: thin; overflow-y: hidden;">
<asp:GridView ID="grid_contact" runat="server" AutoGenerateColumns="False" DataKeyNames="C_ID"
OnRowDataBound="gv1_RowDataBound" OnPageIndexChanging="grid_contact_PageIndexChanging" AllowPaging="true" PageSize="10"
CssClass="table table-bordered table-hover" AutoPostBack="true" >
<HeaderStyle CssClass="table-bordered table-hover" Height="10px"/>
<PagerStyle cssClass="gridpager" HorizontalAlign="Center" />
<Columns>
<asp:TemplateField HeaderText="Detail" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:RadioButton ID="rdbGVRow" runat="server" OnCheckedChanged="radioChecked" AutoPostBack="true"/>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Name">
<ItemTemplate><%#Eval("NAME")%> <%#Eval("LNAME")%>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="C_ID" HeaderText="Contact Id" SortExpression="C_ID" />
<asp:BoundField DataField="TITLE" HeaderText="Job Title" SortExpression="JOB TITLE" />
<asp:BoundField DataField="Added_on" HeaderText="Added On" />
<asp:TemplateField HeaderText="Status">
<ItemTemplate><div class="label label-lg label-success"><%#Eval("STATUS")%> </div>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Panel>
|
|
|
|
|
Did you face any error?
modified 20-Sep-20 21:01pm.
|
|
|
|
|
Use this code,
protected void gv1_RowDataBound(object sender, GridViewRowEventArgs e)
{
Radiobuttonlb = e.Row.FindControl("rdbGVRow") as Radiobutton;
ScriptManager.GetCurrent(this).RegisterAsyncPostBackControl(lb);
}
also set
ClientIDMode="AutoID" for the Radiobutton
|
|
|
|
|
I am looking for information about how to integrate asp.net core or mvc and angular2, any information I would appreciate, thanks
|
|
|
|
|
Google will find you plenty.
|
|
|
|
|