I want to Integrate Magento API V2 which is installed in my localhost and call the V2 API in ASP.NET Visual Studio 2015

Please forive me if this is a very basic level question since I am very new to ASP.Net world.

I need to show a chart like below in my ASP.Net application. What are the options available to me?

enter image description here

The data for the chart will be fed from the application (c#) which is saved in the database for each employee.

enter image description here

I have a gridview in which I insert one row for the first time and save it. Till this it works properly as expected.

But when I see the saved data, and wanted to modify/Add one more data, I get error as

Column 'EXP_TYPE_ID' does not belong to table .

I don't know why it is giving me this error, as it saves properly whenever I add fresh record.

Here is my Insert code.

 protected void GrdPartyInfo_InsertCommand(object sender, GridRecordEventArgs e)
{
    int iRowCount = 0;

    if (Session["partyInfo"] != null)
    {
        dtPartyInfo = (DataTable)Session["partyInfo"];
    }
    else
    {
        BindDataTable();
    }

    iRowCount = dtPartyInfo.Rows.Count;
    DataRow newRow = dtPartyInfo.NewRow();
    newRow["SR_NO"] = iRowCount + 1;
    newRow["EXP_TYPE_ID"] = Convert.ToString(e.Record["EXP_TYPE"]);
    newRow["EXP_TYPE"] = CF.ExecuteScaler2("Select Type_desc from type_mst where Type_Code = 'PAR' and Type_Abbr ='" + Convert.ToString(e.Record["EXP_TYPE"]) + "'").ToString();
    newRow["TITLE"] = Convert.ToString(e.Record["TITLE"]);
    newRow["F_NAME"] = Convert.ToString(e.Record["F_NAME"]);
    newRow["M_NAME"] = Convert.ToString(e.Record["M_NAME"]);
    newRow["L_NAME"] = Convert.ToString(e.Record["L_NAME"]);
    newRow["GENDER"] = Convert.ToString(e.Record["GENDER"]);
    newRow["EMAIL_ID"] = Convert.ToString(e.Record["EMAIL_ID"]);       

    newRow["MOB_NUM"] = Convert.ToString(e.Record["MOB_NUM"]);

    newRow["PAN_NO"] = Convert.ToString(e.Record["PAN_NO"]);
    newRow["ADHAAR_NO"] = Convert.ToString(e.Record["ADHAAR_NO"]);
    newRow["ADDRESS"] = Convert.ToString(e.Record["ADDRESS"]);

    dtPartyInfo.Rows.Add(newRow);
    GrdPartyInfo.DataSource = dtPartyInfo;
    GrdPartyInfo.DataBind();
    AddToViewState("GrdPartyInfo");
}

and Aspx of gridview

<cc1:Grid ID="GrdPartyInfo" AllowDataAccessOnServer="true" runat="server" CallbackMode="true"
                        Serialize="true" FolderStyle="../Styles/Grid/style_12" AllowAddingRecords="true"
                        AutoGenerateColumns="false" Width="100%" ShowFooter="true" ShowHeader="true"
                        OnInsertCommand="GrdPartyInfo_InsertCommand" OnRebind="GrdPartyInfo_Rebind" OnRowDataBound="GrdPartyInfo_RowDataBound"
                        OnUpdateCommand="GrdPartyInfo_UpdateCommand">
                        <ClientSideEvents OnClientEdit="GrdPartyInfo_OnClientEdit" OnClientDblClick="GrdPartyInfo_OnClientDblClick" />
                        <TemplateSettings RowEditTemplateId="tplRowEdit" />
                        <Columns>
                            <cc1:Column ID="Column1" DataField="MKEY" ReadOnly="true" Width="0%" runat="server"
                                Visible="false">
                                <TemplateSettings TemplateId="gtchkConfirm" HeaderTemplateId="HTConfirm" />
                            </cc1:Column>
                            <cc1:Column ID="Column2" DataField="SR_NO" HeaderText="Sr No" Visible="true" Width="5%">
                                <TemplateSettings TemplateId="tplNumbering1" />
                            </cc1:Column>
                            <cc1:Column ID="Column41" DataField="EXP_TYPE_ID" HeaderText="Expense Type" Visible="false"
                                Width="10%">
                            </cc1:Column>
                            <cc1:Column ID="Column3" DataField="EXP_TYPE" HeaderText="Expense Type" Visible="true"
                                Width="10%">
                                <TemplateSettings RowEditTemplateControlId="cmbExpType" RowEditTemplateControlPropertyName="value" />
                            </cc1:Column>
                            <cc1:Column ID="Column4" DataField="TITLE" HeaderText="Title" Visible="true" Width="6%">
                                <TemplateSettings RowEditTemplateControlId="cmbTitle" RowEditTemplateControlPropertyName="value" />
                            </cc1:Column>
                            <cc1:Column ID="Column5" DataField="F_NAME" HeaderText="First Name" Visible="true"
                                Width="8%">
                                <TemplateSettings RowEditTemplateControlId="txtFname" RowEditTemplateControlPropertyName="value" />
                            </cc1:Column>
                            <cc1:Column ID="Column6" DataField="M_NAME" HeaderText="Middle Name" Visible="true"
                                Width="9%">
                                <TemplateSettings RowEditTemplateControlId="txtMname" RowEditTemplateControlPropertyName="value" />
                            </cc1:Column>
                            <cc1:Column ID="Column7" DataField="L_NAME" HeaderText="Last Name" Visible="true"
                                Width="8%">
                                <TemplateSettings RowEditTemplateControlId="txtLName" RowEditTemplateControlPropertyName="value" />
                            </cc1:Column>
                            <cc1:Column ID="Column8" DataField="GENDER" HeaderText="Gender" Visible="true" Width="7%">
                                <TemplateSettings RowEditTemplateControlId="cmbGender" RowEditTemplateControlPropertyName="value" />
                            </cc1:Column>
                            <cc1:Column ID="Column22" DataField="EMAIL_ID" HeaderText="Email Id" Visible="true"
                                Width="10%">
                                <TemplateSettings RowEditTemplateControlId="txtEmailid" RowEditTemplateControlPropertyName="value" />
                            </cc1:Column>
                            <cc1:Column ID="Column23" DataField="MOB_NUM" HeaderText="Mob No" Visible="true"
                                Width="8%">
                                <TemplateSettings RowEditTemplateControlId="txtMobNo" RowEditTemplateControlPropertyName="value" />
                            </cc1:Column>
                            <cc1:Column ID="Column33" DataField="PAN_NO" HeaderText="Pan No" Visible="true" Width="8%">
                                <TemplateSettings RowEditTemplateControlId="txtPanno" RowEditTemplateControlPropertyName="value" />
                            </cc1:Column>
                            <cc1:Column ID="Column34" DataField="ADHAAR_NO" HeaderText="Adhaar No" Visible="true"
                                Width="9%">
                                <TemplateSettings RowEditTemplateControlId="txtAdhaar" RowEditTemplateControlPropertyName="value" />
                            </cc1:Column>
                            <cc1:Column ID="Column35" DataField="ADDRESS" HeaderText="Address" Visible="true"
                                Width="12%">
                                <TemplateSettings RowEditTemplateControlId="txtAddress" RowEditTemplateControlPropertyName="value" />
                            </cc1:Column>
                            <cc1:Column ID="Column36" DataField="ATTACHMENT" HeaderText="Attachment" Visible="true"
                                Width="8%">
                                <TemplateSettings RowEditTemplateControlId="FlAttach" RowEditTemplateControlPropertyName="value" />
                            </cc1:Column>
                        </Columns>
                        <Templates>
                            <cc1:GridTemplate runat="server" ID="tplRowEdit">
                                <Template>
                                    <table class="rowEditTable">
                                        <tr>
                                            <td valign="top">
                                                <fieldset style="width: 900px; height: 250px;">
                                                    <legend>Party Information</legend>
                                                    <table cellpadding="2" cellspacing="2" border="0">
                                                        <tr>
                                                            <%--<td>
                                                                        Sr No:
                                                                    </td>
                                                                    <td>
                                                                        <input type="text" id="txtsrno" disabled="disabled" style="width: 150px;" class="ob_gEC" />
                                                                    </td>--%>
                                                            <td>
                                                                Type:
                                                            </td>
                                                            <td>
                                                                <asp:DropDownList ID="cmbExpType" runat="server" DataSourceID="sd_Type" DataTextField="TYPE_DESC"
                                                                    DataValueField="TYPE_ABBR" Width="150px">
                                                                    <asp:ListItem Value="--Select--">--Select--</asp:ListItem>
                                                                </asp:DropDownList>
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td>
                                                                Title:
                                                            </td>
                                                            <td>
                                                                <asp:DropDownList ID="cmbTitle" runat="server" DataSourceID="sd_Type_Title" DataTextField="TITLE"
                                                                    DataValueField="TITLE_CODE" Width="150px">
                                                                    <asp:ListItem Value="--Select--">--Select--</asp:ListItem>
                                                                </asp:DropDownList>
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td>
                                                                First Name:
                                                            </td>
                                                            <td>
                                                                <input type="text" id="txtFname" style="width: 150px; height: 18px; font-size: 11px;"
                                                                    class="ob_gEC" />
                                                            </td>
                                                            <td>
                                                                Middle Name:
                                                            </td>
                                                            <td>
                                                                <input type="text" id="txtMname" style="width: 150px; height: 18px; font-size: 11px;"
                                                                    class="ob_gEC" />
                                                            </td>
                                                            <td>
                                                                Last Name:
                                                            </td>
                                                            <td>
                                                                <input type="text" id="txtLName" style="width: 150px; height: 18px; font-size: 11px;"
                                                                    class="ob_gEC" />
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td>
                                                                Gender:
                                                            </td>
                                                            <td>
                                                                <select id="cmbGender">
                                                                    <option value="0" selected="selected">--Select--</option>
                                                                    <option value="Male">Male</option>
                                                                    <option value="Female">Female</option>
                                                                </select>
                                                            </td>
                                                            <td>
                                                                Email Id:
                                                            </td>
                                                            <td>
                                                                <input type="text" id="txtEmailid" style="width: 150px; height: 18px; font-size: 11px;"
                                                                    class="ob_gEC" />
                                                            </td>
                                                            <td>
                                                                Mobile No:
                                                            </td>
                                                            <td>
                                                                <input type="text" id="txtMobNo" style="width: 150px; height: 18px; font-size: 11px;"
                                                                    class="ob_gEC" />
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td>
                                                                Pan No:
                                                            </td>
                                                            <td>
                                                                <input type="text" id="txtPanno" style="width: 150px; height: 18px; font-size: 11px;"
                                                                    class="ob_gEC" />
                                                            </td>
                                                            <td>
                                                                Adhaar No:
                                                            </td>
                                                            <td>
                                                                <input type="text" id="txtAdhaar" style="width: 150px; height: 18px; font-size: 11px;"
                                                                    class="ob_gEC" />
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td>
                                                                Address:
                                                            </td>
                                                            <td>
                                                                <%--<input type="text" id="txtAddress" style="width: 150px;" class="ob_gEC"  />--%>
                                                                <asp:TextBox ID="txtAddress" CssClass="ob_gEC" runat="server" Style="width: 240px;
                                                                    height: 50px; font-size: 11px;" TextMode="MultiLine"></asp:TextBox>
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td>
                                                                Attachment:
                                                            </td>
                                                            <td>
                                                                <input type="file" id="FlAttach" style="width: 250px; height: 18px;" class="ob_gEC" />
                                                            </td>
                                                        </tr>
                                                    </table>
                                                </fieldset>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td colspan="2" align="center">
                                                <input type="button" value="Save" onclick="GrdPartyInfo.save()" class="tdText" />
                                                <input type="button" value="Cancel" onclick="GrdPartyInfo.cancel()" class="tdText" />
                                            </td>
                                        </tr>
                                    </table>
                                </Template>
                            </cc1:GridTemplate>
                        </Templates>
                        <Templates>
                            <cc1:GridTemplate runat="server" ID="tplNumbering1">
                                <Template>
                                    <b>
                                        <%# (Container.RecordIndex + 1) %></b>
                                </Template>
                            </cc1:GridTemplate>
                        </Templates>
                    </cc1:Grid>

I have the following code in my razor view that works fine.

<table>
  <thead>
    <tr>
      <th><a=href="~/Home/LawFirmDetails?myInfo=@info.CurrentPageIndex&sortField=@info.SortField" class="header">First Name</a></th>

My Contoller signature looks like this:
public async Task<IActionResult> LawFirmDetails(int? page, string sortField)

So far, so good, everything works. When I click on the column header it calls LawFirmDetails and passes back the values. In this case, @info is a class and I am passing back a few values from it. What I really want to do is pass back the whole class though, but when I try to do that it comes back null.

In this case i change the signature to:

public async Task<IActionResult> LawFirmDetails(Lawyer lawyer) and the href to:
<a=href="~/Home/LawFirmDetails?lawyer=@info" class=header>First Name</a></th>

Aside from the fact that I'm now trying to pass back a class rather than a few values I don't think anything is different. Does anyone have any ideas on this?

I have a bootstrap table of data, and each row is clickable, revealing additional information. When that row of information takes up two lines, the rows of my entire table all increase in height (to fit two lines). How do I make it so that the hidden row will indeed take two lines, but all other rows in my table remain regularly sized?

I need to load some xml data from an RSS feed. If I create a .NET Framework 4.5.2 Web API application, using XMLReader.Create(url) works just fine. However if I try to run the same code in a .NET Core 1.0 Web API application, it fails with the following error:

Cannot open 'http://[RSS feed url]'. The Uri parameter must be a file system relative or absolute path.

This is the code, which I've run inside brand new, separate 4.5.2 and .NET Core 1.0 Web API applications:

[HttpGet]
public IEnumerable<string> Get()
{
    XmlReader reader = XmlReader.Create("http://[RSS feed url]");
    // ...
}

I know the feed URL works, I've tried a couple different ones that I am able to otherwise load just fine. I've also tried using XDocument.Load(url) as well, and get the same exception. Any ideas?

I have to make a calculator for school. The buttons are supposed to build a string in the text box when clicked and then when the = button is pushed the answer will be calculated based on the numbers and the operation. I don't know how take the numbers from the string to do the math with them. Any help is appreciated. here is what I have so far

<head>
<script runat="server">
Dim value_all As String = "0"
Public Shared first_value As Integer
Public Shared second_value As Integer
Public Shared operator1 As Integer

Sub fillvalue(buttonvalue As Object, e As EventArgs)
value_all = lbl1.Text & buttonvalue.Text
lbl1.Text = value_all
End Sub

sub clear(s as Object, e as EventArgs)
 lbl1.Text =""
    End Sub

 'here is where i want to do the math
    Sub math(buttonvalue As Object, e As EventArgs)
        If value_all.Contains("+") Then
        lbl1.Text = buttonvalue.text + buttonvalue.text
    ElseIf value_all.Contains("-") Then
        lbl1.Text = first_value - second_value
    ElseIf value_all.Contains("*") Then
        lbl1.Text = first_value * second_value
    ElseIf value_all.Contains("/") Then
        lbl1.Text = first_value / second_value
    End If

End Sub
</script>
</head>

<body>
<form id="Form1" runat="server">
<h3><asp:textbox id="lbl1" runat="server" /></h3>
<asp:Button ID="Button1" OnClick="fillvalue" Text="1" value="1"       runat="server" />
<asp:Button ID="Button2" OnClick="fillvalue" Text="2" value="2" runat="server" />
<asp:Button ID="Button3" OnClick="fillvalue" Text="3" value="3" runat="server" />
<asp:Button id="Buttonadd" Text="+" runat="server" OnClick="fillvalue" value="+" />
<br />

<asp:Button ID="Button4" OnClick="fillvalue" Text="4" value="4" runat="server" />
<asp:Button ID="Button5" OnClick="fillvalue" Text="5" value="5" runat="server" />
<asp:Button ID="Button6" OnClick="fillvalue" Text="6" value="6" runat="server" />
<asp:Button ID="Buttonsub" OnClick="fillvalue" Text="-"  runat="server" value="-" />


<asp:Button ID="Button7" OnClick="fillvalue" Text="7" value="7" runat="server" />
<asp:Button ID="Button8" OnClick="fillvalue" Text="8" value="8" runat="server" />
<asp:Button ID="Button9" OnClick="fillvalue" Text="9" value="9" runat="server" />
<asp:Button ID="Buttonmult" OnClick="fillvalue" Text="*" runat="server" value="*"/>
<br />

<asp:Button ID="Buttoneq" OnClick="math" Text="=" value="=" runat="server" />
<asp:Button ID="Buttonclr" OnClick="clear" Text="clear"  runat="server" />
 <asp:Button ID="Buttondiv" OnClick="fillvalue" Text="/" value="/" runat="server" />
</form>
</body>

I am creating a simple CMS and I want the users of the system to easily code the views. For example instead of writing:

@ViewBag.some_data_from_cms

I want them to write something like this:

{{some_data_from_cms}}

and you can guess the rest.

Is is possible with Razor or do I have to invent (or inherit from Razor) a new engine?

When 3th party cookies are disabled in the browser, pages loaded into iframe have disabled cookies. When ASP MVC application resource is loaded in parent (main) window and the same application is loaded in iframe, later one doesn't send session cookies and so doesn't share session with top level page.

My first idea to solve this is to provide SessionID as parameter in the iframe url, and somehow based on that SessionID load existing Session State of top page. Is it possible?

my code for sending is as follows :

[HttpPost] public ActionResult SendingMessage(WhatsappModel obj) { string from = "918550084913"; string to = obj.number; string msg = obj.message; string imei = "354115072887894"; string nick_name = "nigga"; WhatsApp wa = new WhatsApp(from, imei, nick_name, false, false); wa.OnConnectSuccess += () => { ViewBag.abc = "connection established"; wa.OnLoginSuccess += (phoneNumber, data) => { wa.SendMessage(to, msg);

           };

           wa.OnLoginFailed += (data) =>
           {
               ViewBag.abcd = "login failed";
           };
           wa.Login();
       };

       wa.OnConnectFailed += (ex) =>
       {
           ViewBag.abcde = "login failed";
       };


       wa.Connect();


       return View();

   }

I am trying to build a EF C# Razor application. I continue to fail in endeavor to have the dropdown box[listbox]'s choice call a route called getRecruiter(with that value) and change the recruitername textbox to the recruiter.

It errors saying: Uncaught ReferenceError: RecruiterName is not defined If anyone could help me, I would greatly appreciate it. I am trying to learn how to use Razor and C# and have tried everything I could find online.

Here is the relevant code:

Notes Model:

using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;

namespace JOM.Models
{
    public class NotesModel
    {
        [Key]
        public int NotesID { get; set; }

        public int JobID { get; set; }
        public string Recruiter { get; set; }
        public string NoteTitle { get; set; }
        public string NoteData { get; set; }
        public DateTime ActiveDate { get; set; }
    }

    public class JobWithRecruiter
    {
        public int JobID { get; set; }
        public string RecruiterName { get; set; }
    }
}

Notes Controller:

using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Entity;
using System.Linq;
using System.Net;
using System.Web;
using System.Web.Mvc;
using JOM.DAL;
using JOM.Models;

namespace JOM.Controllers
{
    public class NotesModelsController : Controller
    {
        private JobsContext db = new JobsContext();

        // GET: NotesModels
        public ActionResult Index()
        {
            IEnumerable<JobModel> jobs = db.Jobs;
            ViewData["jobs"] = jobs;

            return View(db.Notes.ToList());
        }

        // GET: NotesModels/Details/5
        public ActionResult Details(int? id)
        {
            if (id == null)
            {
                return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
            }
            NotesModel notesModel = db.Notes.Find(id);
            if (notesModel == null)
            {
                return HttpNotFound();
            }
            return View(notesModel);
        }

        // GET: NotesModels/Create
        public ActionResult Create()
        {
               IEnumerable<JobModel> jobs = db.Jobs;
            ViewData["jobs"] = jobs;

            return View();
        }

        // POST: NotesModels/Create
        // To protect from overposting attacks, please enable the specific properties you want to bind to, for 
        // more details see http://go.microsoft.com/fwlink/?LinkId=317598.
        [HttpPost]
        [ValidateAntiForgeryToken]
        public ActionResult Create([Bind(Include = "NotesID,JobID,Recruiter,NoteTitle,NoteData,ActiveDate")] NotesModel notesModel)
        {
            ViewBag.Jobs =
             from job in db.Jobs
             select job;
            ViewBag.Recruiters =
                from job in db.Jobs
                join note in db.Notes on job.JobID equals note.JobID
                select new JobWithRecruiter { JobID = job.JobID, RecruiterName = note.Recruiter };

            if (ModelState.IsValid)
            {
                db.Notes.Add(notesModel);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(notesModel);
        }

        // GET: NotesModels/Edit/5
        public ActionResult Edit(int? id)
        {
            if (id == null)
            {
                return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
            }
            NotesModel notesModel = db.Notes.Find(id);
            if (notesModel == null)
            {
                return HttpNotFound();
            }
            return View(notesModel);
        }

        // POST: NotesModels/Edit/5
        // To protect from overposting attacks, please enable the specific properties you want to bind to, for 
        // more details see http://go.microsoft.com/fwlink/?LinkId=317598.
        [HttpPost]
        [ValidateAntiForgeryToken]
        public ActionResult Edit([Bind(Include = "NotesID,JobID,Recruiter,NoteTitle,NoteData,ActiveDate")] NotesModel notesModel)
        {
            if (ModelState.IsValid)
            {
                db.Entry(notesModel).State = EntityState.Modified;
                db.SaveChanges();
                return RedirectToAction("Index");
            }
            return View(notesModel);
        }

        // GET: NotesModels/Delete/5
        public ActionResult Delete(int? id)
        {
            if (id == null)
            {
                return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
            }
            NotesModel notesModel = db.Notes.Find(id);
            if (notesModel == null)
            {
                return HttpNotFound();
            }
            return View(notesModel);
        }

        // POST: NotesModels/Delete/5
        [HttpPost, ActionName("Delete")]
        [ValidateAntiForgeryToken]
        public ActionResult DeleteConfirmed(int id)
        {
            NotesModel notesModel = db.Notes.Find(id);
            db.Notes.Remove(notesModel);
            db.SaveChanges();
            return RedirectToAction("Index");
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                db.Dispose();
            }
            base.Dispose(disposing);
        }
    }
}

Notes View:

@model JOM.Models.NotesModel
    @using JOM.Models;
@{
    ViewBag.Title = "Create";
}

@functions
{
    public string getRecruiter(int jobID)
    {
        if (jobID > 0)
        {
            var j = (IEnumerable<JobWithRecruiter>)ViewBag.Recruiters;
            return j.Where(jo => jo.JobID.Equals(jobID)).First<JobWithRecruiter>().RecruiterName;
        }
        return "No Name Selected";
    }
        }
<h2>Create</h2>


@using (Html.BeginForm())
{
    @Html.AntiForgeryToken()

    <div class="form-horizontal">
        <h4>Notes</h4>
        <hr />
        @{
            int selectedJobID = 0;
            string RecruiterName = "Not Selected";
    }
    @Html.ValidationSummary(true, "", new { @class = "text-danger" })
        <div class="form-group">
            <label class="control-label col-md-2" for="JobDesc">Choose Job:</label>
            <div class="col-md-10">
@{ 
    var jobs = (IEnumerable<JobModel>)ViewBag.Jobs;
    }
    @Html.DropDownList("listbox", jobs.Select(item => new SelectListItem
{
    Value = item.JobID.ToString(),
    Text = item.JobDesc.ToString()
}))

                <script language="Javascript">
    $(document).ready(function () {
        $('#listbox').change(function () {
            selectedJobID = $(this).val();
            @{
                RecruiterName = getRecruiter(selectedJobID); 
                }
            $('#recruiter').val(RecruiterName);

        });
    });
                 </script>
               </div>
        </div>

        <div class="form-group">
            @Html.Label("Recruiter", htmlAttributes: new {@class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.TextBox(RecruiterName, RecruiterName,new { ID="recruiter", @class = "form-control" });
                @Html.ValidationMessageFor(model => model.Recruiter, "", new { @class = "text-danger" })
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.NoteTitle, htmlAttributes: new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.EditorFor(model => model.NoteTitle, new { htmlAttributes = new { @class = "form-control" } })
                @Html.ValidationMessageFor(model => model.NoteTitle, "", new { @class = "text-danger" })
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.NoteData, htmlAttributes: new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.EditorFor(model => model.NoteData, new { htmlAttributes = new { @class = "form-control" } })
                @Html.ValidationMessageFor(model => model.NoteData, "", new { @class = "text-danger" })
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.ActiveDate, htmlAttributes: new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.EditorFor(model => model.ActiveDate, new { htmlAttributes = new { @class = "form-control" } })
                @Html.ValidationMessageFor(model => model.ActiveDate, "", new { @class = "text-danger" })
            </div>
        </div>

        <div class="form-group">
            <div class="col-md-offset-2 col-md-10">
                <input type="submit" value="Create" class="btn btn-default" />
            </div>
        </div>
    </div>
}

<div>
    @Html.ActionLink("Back to List", "Index")
</div>

@section Scripts {
        @Scripts.Render("~/bundles/jqueryval")
}

I am new asp.net MVC & Razor view. I want to create view with Grid on first half of page and second half of page should display edit partial view. I am following below example from link - http://www.binaryintellect.net/articles/4a00a9ce-73e5-4d89-aaae-2d835eca0854.aspx

Index:

// First half of page which shows grid of products and pages
@{
    if (Model.ProductViewModel.SelectedCustomer != null)
    {
        if (Model.ProductViewModel.DisplayMode == "ReadWrite")
        {
            Html.RenderPartial
            ("_GridEditPartial", Model.ProductViewModel.SelectedCustomer);
        }
    }
}

@section Scripts{
    <script src="https://code.jquery.com/ui/1.12.0-rc.2/jquery-ui.min.js"></script>
    <script src="~/Scripts/jquery.unobtrusive-ajax.min.js"></script>
    <script type="text/javascript">
        $(function () {
            var id = 0;
            $(document).on('click', '.btnEdit', function () {
                id = $(this).attr("data-value");
                $(this).load("@Url.Action("GetProductById")", { id: id });
            });
        });
    </script>
}

This is Action method of Index view

public ActionResult Index(int? pageNumber)
        {
            ProductModel model = GetProductModel(pageNumber);
            model.ProductViewModel.SelectedCustomer = null;

            return View(model);
        }

        private static ProductModel GetProductModel(int? pageNumber)
        {
            ProductModel model = new ProductModel();
            model.PageNumber = (pageNumber == null ? 1 : Convert.ToInt32(pageNumber));
            model.PageSize = 4;

            List<Product> products = Product.GetSampleProducts();

            if (products != null)
            {
                model.Products = products.OrderBy(x => x.Id)
                         .Skip(model.PageSize * (model.PageNumber - 1))
                         .Take(model.PageSize).ToList();

                model.TotalCount = products.Count();
                var page = (model.TotalCount / model.PageSize) - (model.TotalCount % model.PageSize == 0 ? 1 : 0);
                model.PagerCount = page + 1;
            }
            model.ProductViewModel = new ProductViewModel();
            return model;
        }
Below action is called when edit link is clicked
  public ActionResult GetProductById(int id)
        {
            var products = Product.GetSampleProducts().Where(x => x.Id == id).First();

            ProductModel model = GetProductModel(1);
            model.ProductViewModel.DisplayMode = "ReadWrite";
            model.ProductViewModel.SelectedCustomer = products;
            return View("Index", model);
        }

Partial View look like this:

@using (Html.BeginForm("UpdateProduct", "Home", FormMethod.Post))
{
    <div class="form-group">
        <label for="exampleInputEmail1">Product Name</label>
        @Html.TextBoxFor(x => x.Name, new { @class = "form-control" })
    </div>
    <div class="form-group">
        <label for="exampleInputPassword1">Price</label>
        @Html.TextBoxFor(x => x.Price, new { @class = "form-control" })
    </div>
    <div class="form-group">
        <label for="exampleInputPassword1">Department</label>
        @Html.TextBoxFor(x => x.Department, new { @class = "form-control" })
    </div>

    <button type="submit" class="btn btn-default">Submit</button>
}

When I clik on Edit link. It doesn't render second half of page the partial view. It render below edit link of view

I have stored procedure to generate a results like following

enter image description here

I want to show a result like following

which is

if (HeaderID and TitleNo same) 
show that results in same row 

else
 go to new row

enter image description here

So I wrote the Razor page like following

                        <tbody>
                            @foreach (var item in Model)
                            {
                                <tr>
                                    <td rowspan="2" class="vertaline-mid">@item.TitleNo</td>
                                    <td rowspan="2" class="vertaline-mid">@item.TitleImage</td>

                                    @foreach (var image in Model)
                                    {
                                        <td class="image-td">
                                            <a>@image.SubtitleName</a>
                                            <span>@image.SubtitleValue</span>
                                        </td>
                                    }
                                </tr>
                                <tr>
                                    @foreach (var imageid in Model)
                                    {
                                        <td>@imageid.CaseID</td>
                                    }
                                </tr>
                            }                               
                        </tbody>

But then I'm getting view like following which is wrong

I cant even Group this stored procedure then that will be effect on some result.

how to handle this on client side.

enter image description here

This is a silly question but how do I create web pages that have a flat look (I think this is the right term) with Visual Studio 2015. Please see attached example. enter image description here

Thank you all for you help.

We have an ASP.NET (4.5) web app using Forms authentication and custom database to authenticate users. Our client uses ADFS Active Directorey Federation Services and would like to use ADFS users to log into our web app. I need to figure out how to map those ADFS users to our custom users in apps own database. When user attempts to access my app Login page they get re-directed to the ADFS login and once authenticated returned to my login page along with an object which would give access to some information about the authenticated user which I then need to map to the user in our web app. I'd really appreciate a simple code example which could be used with this scenario. Specifically need info on the user/principal object or something that's passed back and which I could use to uniquely identify a user and possibly a group the user belongs to than write my code to obtain the user from our database. I don't really want to make the web app ADSF aware, but I'm after something simple. That would work with this scenario.

I have 2 files :-

  1. Items.aspx with the list of items in a grid view, A button(to open a form for adding new item), and a div with id testing.

code Inside Items.aspx

    <%@ Page Title="" Language="C#" MasterPageFile="~/Basic.Master" AutoEventWireup="true" CodeBehind="Items.aspx.cs" Inherits="FlowerShopAdminPanel.Items" %>

            <asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
            </asp:Content>
            <asp:Content ID="Content2" ContentPlaceHolderID="header" runat="server">
                <div id="dvGrid" class="container">
            <!-- This contains the gridview -->
                </div>
                <div id="testing"></div>



            <script>
                function openDialog($itemid,$categoryid) {
                    $('#testing').dialog({
                        modal: true,
                        dialogClass: "no-close",
                        open: function () {
                            $(this).load('AddItem.aspx?itemid=' + $itemid+'&categoryid='+$categoryid);
                            $(".ui-dialog-titlebar-close", ui.dialog | ui).hide();
                        },
                        height: 500,
                        width: 500,
                        title: 'Add Item'
                    });
                }
            </script>
            <style>
                .image {
                    height: 30vh;
                }

                .no-close .ui-dialog-titlebar-close {
                    display: none;
                }
            </style>
        </asp:Content>

This loads a form to add item in a jquery modal. we can upload image to that item using a Button . Above function is on another aspx form in which I am

  1. AddItem.aspx

         <div>
    <asp:Label runat="server" Text="Category Name"></asp:Label>
        <asp:DropDownList runat="server" ID="category_ddl"></asp:DropDownList>
    </div>   
    
        <div> 
            <asp:Label runat="server" Text="Item Name"> </asp:Label>
            <asp:TextBox runat="server" ID="itemname_txt"></asp:TextBox>
        </div> 
        <div>
            <asp:Label runat="server" Text="Description"></asp:Label>
            <asp:TextBox runat="server" TextMode="MultiLine" Rows="5" Columns="50" ID="description_txt"></asp:TextBox>
        </div>
    
        <div>
            <asp:Label runat="server" Text="Main Image"></asp:Label>
            <asp:FileUpload runat="server"  ID="mainimage_fileupload"/><br />
    
            <asp:Image runat="server" ID="mainimage_img" Visible="false"  />
    
            <asp:Button runat="server" ID="fileupload_btn" Text="Upload" OnClick="fileupload_btn_Click" />
    
            <asp:Label runat="server" ID="filename_lbl" Visible="false" ForeColor="Red" Font-Bold="true"></asp:Label>
        </div>
    
        <div>
            <asp:Label runat="server" Text="Active"> </asp:Label>
            <asp:CheckBox  runat="server" ID="isActive_chk"/>
        </div>
    
         <div>
            <asp:Button runat="server"  ID="addItem_btn" Text="Add Item" OnClick="addItem_btn_Click"/>
             <asp:Button runat="server"  ID="cancel_btn" Text="Cancel" OnClick="cancel_btn_Click"/>
        </div>   
    
    </div>
    </form>
    

Whenever I upload the image it opens up as a normal aspx page. Basically, Whenever the aspx page is refreshed, it opens up as a normal web page. I always want to open it in the jQuery modal.

Please help in resolving this issue.

Thank you

I created a SOAP webservice using VS 2010. I wanted to send html tags in a single method that's why I added the validation mode to my web.config file :

<httpRuntime requestValidationMode="2.0" />
    <pages validateRequest ="false">

But the problem is that all methods are not secured anymore because validationrequest is set as false for the entire request. I made some searches and I found that in .NET 4.5 the ValidateRequestMode property was added, which allows excluding controls from the page global validation. but this property is used for check-boxes or controls ... how can I implement it in my webservice as we are invoking? If I cannot implement it, is there any solution to disable request validation only for one webmethod ?

Thanks

I have 3 excel files ,and each excel files contains certain amount of data.and each excel files are joined by a column, Here My problem is Want to get a xml file from excel files.

First excel sheet contains following information-excel name -Employees

emp id ||empname||compid||departid

500 ||xxx ||01 || A

501 ||yyy ||02 ||B

Second excel sheet contains following information-excel name -Company

Compid || compname ||Location

01 || YYY || Ktpna

02 || 02-YYY || Thdpza

Third excel sheet contains following information-excel name -Department

Departid || Departname || Location|| Teamleader

A || A-AAA ||A-Ktpna || A-XXX

B || B-AAA ||B-Thdpza || B-YYY

I want to get a XMl Output like

<employeesInformation>
<Employees>
<emp id> 500 </emp id>
<empname> xxx </empname>
<compid> 01 </compid>
<departid> A </departid>
</Employees>
<Company>
<Compid> 01 </Compid>
<compname> YYY </compname>
<Location> Ktpna </Location> 
</Company>
<Department>
<Departid >A<Departid>
<Departname> A-AAA  <Departname>
<Location>A-Ktpna<Location>
<Teamleader> A-XXX<Teamleader>
</Department>
<employeesInformation>

<employeesInformation>
<Employees>
<emp id> 501 </emp id>
<empname> yyy </empname>
<compid> 02 </compid>
<departid> B </departid>
</Employees>
<Company>
<Compid> 02 </Compid>
<compname> 02-YYY </compname>
<Location> Thdpza </Location> 
</Company>
<Department>
<Departid >B<Departid>
<Departname> B-AAA  <Departname>
<Location>B-Thdpza <Location>
<Teamleader> B-YYY<Teamleader>
</Department>
<employeesInformation>

and using following code

  private DataTable ReadExcelFile(string filename)
        {
            // Initialize an instance of DataTable
            DataTable dt = new DataTable();

            try
            {
                // Use SpreadSheetDocument class of Open XML SDK to open excel file
                using (SpreadsheetDocument spreadsheetDocument = SpreadsheetDocument.Open(filename, false))
                {
                    // Get Workbook Part of Spread Sheet Document
                    WorkbookPart workbookPart = spreadsheetDocument.WorkbookPart;

                    // Get all sheets in spread sheet document 
                    IEnumerable<Sheet> sheetcollection = spreadsheetDocument.WorkbookPart.Workbook.GetFirstChild<Sheets>().Elements<Sheet>();

                    // Get relationship Id
                    string relationshipId = sheetcollection.First().Id.Value;

                    // Get sheet1 Part of Spread Sheet Document
                    WorksheetPart worksheetPart = (WorksheetPart)spreadsheetDocument.WorkbookPart.GetPartById(relationshipId);

                    // Get Data in Excel file
                    SheetData sheetData = worksheetPart.Worksheet.Elements<SheetData>().First();
                    IEnumerable<Row> rowcollection = sheetData.Descendants<Row>();

                    if (rowcollection.Count() == 0)
                    {
                        return dt;
                    }

                    // Add columns
                    foreach (Cell cell in rowcollection.ElementAt(0))
                    {
                        dt.Columns.Add(GetValueOfCell(spreadsheetDocument, cell));
                    }

                    // Add rows into DataTable
                    foreach (Row row in rowcollection)
                    {
                        DataRow temprow = dt.NewRow();
                        int columnIndex = 0;
                        foreach (Cell cell in row.Descendants<Cell>())
                        {
                            // Get Cell Column Index
                            int cellColumnIndex = GetColumnIndex(GetColumnName(cell.CellReference));

                            if (columnIndex < cellColumnIndex)
                            {
                                do
                                {
                                    temprow[columnIndex] = string.Empty;
                                    columnIndex++;
                                }

                                while (columnIndex < cellColumnIndex);
                            }

                            temprow[columnIndex] = GetValueOfCell(spreadsheetDocument, cell);
                            columnIndex++;
                        }

                        // Add the row to DataTable
                        // the rows include header row
                        dt.Rows.Add(temprow);
                    }
                }

                // Here remove header row
                dt.Rows.RemoveAt(0);
                return dt;
            }
            catch (IOException ex)
            {
                throw new IOException(ex.Message);
            }
        }

i am developing app which is maximum time in offline mode but even in web app the transaction happens. got problem how to sync the database after offline device connect to online.

ex: customer : x1
balance:15$
paid: 10$ in online,
after transaction online balance : 5$

but in offline old sync data
customer: x1
balance:15$
paid: 5$
after transcation balance in offline : 10$

now balance will be 0: how to handle and sync the offline and online data.

using xamrin to develop the android app.

I am working on an asp.net mvc application which got multiple sub-domains, and I am sharing the session across the the sub domains.

I set cookieAuthenticationOptions.CookieDomain = ".domain.com;" to make it work.

But it is not working in the localhost, I set for local as

cookieAuthenticationOptions.CookieDomain = ".localhost:1984;"

Is there any other way to setup for localhost?

i am creating a web app in which i am using angularjs for database conectivity

here is my code

<div ng-repeat="x in sonvinrpm">
<input type="Text" ng-model="venuemobile" value="{{x.venuemobile}}" ng-init="venuemobile='{{venuemobile}}'"
</div>
<button ng-click="updfunction()">update</button>

on my page load my textbox fetching particular venuemobile from my database(1234567890) if i edit the venuemobile and press update the value of venuemobile should be updated

but i am facing the error

 missing parameter: venuemobile

and i found out this error is appearing because i am using repeater,

when i remove repeater and enter into textbox manually then my database is updating properly,

previously i used ng-repeater for my dropdownlist and table(because there are multiple data not single data) in this case i need only one value from database, what should i use instead of ng-repeat