mardi 4 août 2015

Fix the row and column as header dynamically in html without modifying the code [on hold]

I have a html page which contains a table in it and I have add that page into my asp.net project. Now I want freeze the panes(fix 1st five rows as header and 1st column) without modifying the html page..

In that html page the table did not contain 'thead', 'tbody' and 'th' tags.

It just like this...

 <table>
   <tr>
      <td></td>
      <td></td>
      <td></td>
    </tr>
    <tr>
      <td></td>
      <td></td>
      <td></td>
    </tr>
 </table>

I don't want to add 'th', 'thead' tags to my html page... because I don't want modify my page... I think we may add them and freeze the panes dynamically.....

ex: http://ift.tt/1DqekbK

Http request returns as failure but actually succeeds

I'm developing a web API and a website to interact with that api. So far I have each part done. I am using angular js for my website and an asp.net webapi for the other end. When I try to connect the two together to make it all work the signal sends and the api end gets executed like normal however in the console on the website end gives me an error: XMLHttpRequest cannot load http://localhost:1795/api/products/[ip address]/en-us/[product]/[version]/[email address]. A wildcard '*' cannot be used in the 'Access-Control-Allow-Origin' header when the credentials flag is true. Origin 'http://localhost:50028' is therefore not allowed access.

It just seems to be going in loops because if I now remove the custom header I provided for the Access-Control-Allow-Origin it still triggers the process I have in the api which gets executed as normal but I still end up getting an error on the other end. XMLHttpRequest cannot load http://localhost:1795/api/products/[ip address]/en-us/[product]/[version]/[email address]. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:50028' is therefore not allowed access.

If I remove the credentials from the http request I get a 401 unauthorized error and the api process won't trigger. I've created both of these projects in Visual Studio 2013 and are both running in Chrome.

Do I ignore the errors on the website side and keep things as they are? Or is there another way to make the call without getting these console errors?

Windows App Design

how to start windows app design in Visual Studio 2012 and latest version. I have good knowledge of design and develop web app in Visual Studio 2010 and 2012. Now I wish to move on Windows Mobile App Design and Develop. But I am unable to Start. Kindly help me and suggest me how I can start to design Windows mobile app.

Textbox for Decimal value null when submitting form in ASP.Net?

Textbox value when submitting the form is null in the controller. Simplified structure of what I have is below:

MODEL

public class MyObject
{
    public decimal DecimalProperty { get; set; }
}

VIEW

@for(var i = 0; i < Model.Count; i++) 
{
   using (Html.BeginForm("UpdateObject", "MyController", FormMethod.Post))
   {
      @Html.Textbox(String.Format("Model[{0}].DecimalProperty", i), Model[i].DecimalProperty)
      <input type="submit" value="Update"/>
   }
}

CONTROLLER

public ActionResult UpdateObject(MyObject myObject)
{
   // Do Stuff...
}

If I put a breakpoint in the controller method, then check the property values of myObject, the DecimalProperty is null. There are other properties on the actual object I'm using and those come across alright, but for some reason this property isn't. I haven't found anything that suggests that decimals must be handled differently than a DateTime or string. I have also tried writing out the html for the input by hand:

 <input type="text" name="@(String.Format("Model[{0}].DecimalProperty", i))" value="@Model[i].DecimalProperty" />

I have set the name and the id attributes of the textbox just to be on the safe side. Any ideas as to why my textbox value is null when I submit the form?

append server side code from client side jquery

I have a server side code block such as <%Response.Write(...)%> How would i append it dynamically from client side script using jquery?

$("div.items").append('<form action="#" method="POST">');
$(".items form').append('<%Response.Write(...)%>')  //???

How to do performance testing for website hosted in integration environment

I wanted to do performance testing(profiling, instrumentation) for asp.net website which is hosted in our integration environment. I am able to do it in local machine using visual studio performance and diagnostics. How to do this in integration environment without installing visual studio in integration.

ASP.NET c# Customer Resources "branching" system

Last couple of hours I am trying to figure out how I can use CustomerResources like the localization and globalization version of the Resources. I have a multilanguage website which uses Resources.localization-globalization.resx to get the texts for that language, example : Resources.en-EN.resx. Now I have multiple customers who want to have some texts changed to their own way of saying it. But also use Multilanguage on that version so what I wanted to do is create a folder based on the customer GUID, and use that name to select the right Resources file like this :

Google/CustomerResources.resx

the /\ folder is dynamic and could be either Google or Yahoo or Bing.

Is there a way to achieve this or could I change this to CustomerResources.Google.resx?

Ajax Post in MVC... Why is the string null?

So basically I'm creating a Request system in a MVC application. I have this "Create Request" section where I can select the type of request I want to do in a DropDownList from Telerik. What I want to do is, every time I choose something from the list, a partial view appears with the form related to that type of request.

This is my ajax Post from the Create.cshtml View:

<script>
    function change() {
        var value = $("#RequestType").val();
        alert(value);
        $.ajax({
            url: "/Request/CreateRequestForm",
            type: "get",
            data: { requestValue : JSON.stringify(value)}
        }).done(function (data) {
            $("#partialplaceholder").html(data);
        }).fail(function () {
            alert('error');
        })
    };
</script>

This is my controller:

public ActionResult Index()
        {
           //Things
            return View();
        }

    [HttpGet]
    public ActionResult Create()
    {
        return View();
    }

    [HttpGet]
    public PartialViewResult CreateRequestForm(string dropDownValue)
    {   string partialView="";
        int RequestType = Convert.ToInt32(dropDownValue);
        switch (RequestType)
        {
            case 1 :
                partialView+="_CreateAbsence";
                break;
            case 2 :
                partialView += "_CreateAdditionalHours";
                break;
            case 3 :
                partialView += "_CreateCompensationDay";
                break;
            case 4 :
                partialView += "_CreateErrorCorrection";
                break;
            case 5 :
                partialView += "_CreateVacation";
                break;
        }
        return this.PartialView(partialView);
    }

Everytime time the even triggers my dropDownValue string is null... Why? Thanks in advance! :)

EDIT View Code

<h1>Create New Request</h1>

        @(Html.Kendo().DropDownList()
          .Name("RequestType")
          .DataTextField("Text")
          .DataValueField("Value")
          .Events(e => e.Change("change"))
          .BindTo(new List<SelectListItem>() {
              new SelectListItem() {
                  Text = "Absence",
                  Value = "1"
              },
              new SelectListItem() {
                  Text = "Additional Hours",
                  Value = "2"
              },
              new SelectListItem() {
                  Text = "Compensation Day",
                  Value = "3"
              },
              new SelectListItem() {
                  Text = "Error Correction",
                  Value = "4"
              },
              new SelectListItem() {
                  Text = "Vacation",
                  Value = "5"
              }
          })
          .Value("1")
        )


<script>
    function change() {
        var value = $("#RequestType").val();
        alert(value);
        $.ajax({
            url: "/Request/CreateRequestForm",
            type: "get",
            data: { requestValue : JSON.stringify(value)}
        }).done(function (data) {
            $("#partialplaceholder").html(data);
        }).fail(function () {
            alert('error');
        })
    };
</script>

<div id="partialplaceholder">

</div>

The table-border doesn't work in IE11 but works in Chrome

I'm trying to get the border working in IE11 like it's working in Google Chrome. I use ASP.NET,inline styling, nth-child, last-child. This is a example of how I use it.

.GridView tbody tr:nth-child(13) td,.GridView tbody tr:nth-child(15) td,.GridView tbody tr:last-child td{
        border-bottom:thin solid white;
    }

Can anyone tell me which attribute or selector I'm not allowed to use?

Web method not called from ajax post

I am trying to call a method as web method from ajax like:

$.ajax({
                    url: 'http://ift.tt/1SI1MDN',
                    method: "POST",
                    contentType: "application/json; charset=utf-8",
                    dataType: "json",
                    //data: angular.toJson(categories),
                    data: angular.copy(categories)

Here categories is serialized as

 [
    {
        "name": "Fruits",
        "metrics": "cups",
        "entry": 0,
        "recommended": true,
        "color": "#989898"
    },
    {
        "name": "Vegetables",
        "metrics": "cups",
        "entry": 1,
        "recommended": true,
        "color": "#37A0BC"
    }
]

Webmethod is like:

        [WebMethod(true)]
        [ScriptMethod(ResponseFormat = ResponseFormat.Json)]
        public static string AddSelfEntry(List<Entry> items)
        {

Here entry is

public class Entry
        {
            public string name;
            public string metrics;
            public int entry;
            public bool recommended;
            public string color;
            //{"name":"Sugary Drinks","metrics":"times","entry":1,"recommended":false,"$$hashKey":"00F"}
        }

I am getting error at console:

enter image description here

No breakpoint hit at webmethod in debugmode.

Please help where I am wrong?

How to add service reference in visual studio with nettcpbinding hosted in IIS?

enter image description here

I have configured wcf service in IIS. my web.config is

<services>
<service name="DNExpWCFService.Service1"        
behaviorConfiguration="DNExpWCFServiceBehaviour">
<endpoint name="WSGetEmployee" address="/WSGetEmployee"                       
binding="wsHttpBinding" contract="DNExpWCFService.IService1">
</endpoint>
<endpoint address="mex" binding="mexHttpBinding"
contract="IMetadataExchange"></endpoint>
</service>
</services>

Now when I add service reference using http://localhost:8333/Service1.svc it works fine. But for nettcpbinding I can't add service reference. I tried using net.tcp://localhost:8444/Service1.svc. But it also fails. How to add service reference using nettcpbinding?

the best way to handle

I am writing a module(frontend extjs 4.2.1, backend asp.net mvc with the EF). I meet a little problem: when the user clicks the search button, a panel of extjs will be displayed and he/she can fill some blanks inside the textfield. after the filter information was submitted, the sever side will use appropriate c# code to deal with it to filter some records from the mssql database, here is my problem:

if the user inserts nothing into the field, the standard and best practice will be that this field will be neglected, however, the blank textfield's value will be '' which I can not use this as the filter string, for instance: there is a textfield named "sex", if the use types nothing into the field, the value passed to server will be '', if i write the lambda expression in this way: var filter = x=>x.sex ==""; Apparently it will not work. You may say that i can use if-else to condition out the stuff. but if i have numerous fields, using the if-else will be really waste of time. so, what is the best practice to do this

How to enforce that Static Class constructor is called in asp.net web application?

How to enforce that static class constructor constructor is called in asp.net web application. One way is I forcefully use the static class so before calling static constructor will be called. Is there any other way to force it.

Transactional methods in Asp.net

I have been working in Grails earlier and in Grails, same as Spring, service methods are transactional by default, we can change it through annotations if we want, but now I am working in ASP.net and I want to know if there is something similar to that. Or we must explicitly open transaction and close it at the end of each method. I am using entity framework...

Assembly signing fails in release mode

I have a C# ASP.NET website project that I've recently added the SCORM player projects from the SharePoint Learning Kit to. These projects come with a keyfile in the Shared folder of the source, which is to be used to sign the projects. I've opened up the properties of the three projects in question and set them to sign with that keyfile. This has allowed me to build the project in Debug mode.

However, when I attempt to publish the project, or run it in Release mode, the signing fails during the build process with an error as follows:

Error 19

Assembly signing failed; output may not be signed -- Error signing assembly -- The system cannot find the file specified. C:\Users\username\Documents\VS2010 SS Working Folder\ProjectName.TFS\ProjectName\ProjectName.root.SCORM\ProjectName\LearningComponents\Storage\CSC

Why would it fail in Release mode but not in Debug mode? What can I do to let it build in Release mode?

Reload table after searching

I'm trying to edit a column of a table after I search it using a drop down list; however, when I click the "Edit" button nothing shows up. Please advise and thank you!

More info: I have a Home page where the drop down list is located and as I click search it references the Results.aspx page where the table is shown and, as stated above, when I click edit nothings shows up.

Home.aspx.cs:

 using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Configuration;
using System.Web.Security;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;


namespace Inventory
{
    public partial class Home : System.Web.UI.Page
    {

        SqlConnection cn = new SqlConnection("Data Source=10.10.101.188;Initial Catalog=ActioNetITInventory;User ID=rails.sa;Password=ActioNet1234");

        protected void Page_Load(object sender, EventArgs e)
        {
           //methods

                Populate1();

        }//end page_load

        //puts data on the first dropdown list
        public void Populate1()
        {
            SqlCommand cmd = new SqlCommand("SELECT * FROM [Inventory]", new SqlConnection(ConfigurationManager.AppSettings["ConnString"]));
            cmd.Connection.Open();

            SqlDataReader ddlValues;
            ddlValues = cmd.ExecuteReader();


            DropDownList1.DataSource = ddlValues;
            DropDownList1.DataValueField = "Assigned";
            DropDownList1.DataTextField = "Assigned";
            DropDownList1.DataBind();

            //starts the dropdown list with empty so you can search with serial or the drop down
            DropDownList1.Items.Insert(0, new ListItem(String.Empty, "--Select--"));
            DropDownList1.SelectedIndex = 0;

            cmd.Connection.Close();
            cmd.Connection.Dispose();

        }//end populate one





    }//end class
}//end namespace Inventory

Results.aspx.cs:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Configuration;
using System.Web.Security;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;


namespace Inventory
{
    public partial class Results : System.Web.UI.Page
    {
        SqlConnection conn = new SqlConnection("Data Source=10.10.101.188;Initial Catalog=ActioNetITInventory;User ID=rails.sa;Password=ActioNet1234");



        protected void Page_Load(object sender, EventArgs e)
        {



        }






    }//end class
}//end name space

Results.html:

    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Results.aspx.cs" Inherits="Inventory.Results" %>

<!DOCTYPE html>

<html xmlns="http://ift.tt/lH0Osb">
<head id="Head1" runat="server">
    <title>Results</title>

    <link href="StyleSheet1.css" rel="stylesheet" />

    <link href="Background.css" rel="stylesheet" type="text/css" />

    <link href="Default.css" rel="stylesheet" />

    <link href="Component.css" rel="stylesheet" />

    <link rel="shortcut icon" href="~/logo.ico" type="image/x-icon" />

    <style type="text/css">
        .auto-style1 {
            height: 80px;
            width: 335px;
        }
    </style>

</head>
<body>
    <form id="form1" runat="server">
        <div style="margin-left: 400px">
            &nbsp;&nbsp;&nbsp;&nbsp;&n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&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <br />
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<asp:GridView ID="GridView1" runat="server" 
                AutoGenerateColumns="False" 
                CellPadding="4" 
                DataKeyNames="Serial" 
                DataSourceID="SqlDataSource1" 
                ForeColor="#333333" 
                ShowFooter="True" 
                Width="1393px" >
                <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                <Columns>
                    <asp:CommandField ShowEditButton="True" ButtonType="Button" />
                    <asp:BoundField DataField="Type" HeaderText="Type" SortExpression="Type" />
                    <asp:BoundField DataField="Make" HeaderText="Make" SortExpression="Make" />
                    <asp:BoundField DataField="Model" HeaderText="Model" SortExpression="Model" />
                    <asp:BoundField DataField="Serial" HeaderText="Serial" ReadOnly="True" SortExpression="Serial" />
                    <asp:TemplateField HeaderText="Assigned" SortExpression="Assigned">
                        <EditItemTemplate>
                            <asp:TextBox ID="TextBox3" runat="server" Text='<%# Bind("Assigned") %>'></asp:TextBox>
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="Label3" runat="server" Text='<%# Bind("Assigned") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Location" SortExpression="Location">
                        <EditItemTemplate>
                            <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("Location") %>'></asp:TextBox>
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="Label2" runat="server" Text='<%# Bind("Location") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Notes" SortExpression="Notes">
                        <EditItemTemplate>
                            <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("Notes") %>'></asp:TextBox>
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="Label1" runat="server" Text='<%# Bind("Notes") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
                <EditRowStyle BackColor="#999999" />
                <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
                <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                <SortedAscendingCellStyle BackColor="#E9E7E2" />
                <SortedAscendingHeaderStyle BackColor="#506C8C" />
                <SortedDescendingCellStyle BackColor="#FFFDF8" />
                <SortedDescendingHeaderStyle BackColor="#6F8DAE" />
            </asp:GridView>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp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ConnectionStrings:ActioNetITInventoryConnectionString %>" 
                SelectCommand="SELECT * FROM [Inventory] WHERE ([Assigned] = @Assigned)" 
                DeleteCommand="DELETE FROM [Inventory] WHERE [Serial] = @Serial"
                 InsertCommand="INSERT INTO [Inventory] ([Type], [Make], [Model], [Serial], [Assigned], [Location], [Notes]) VALUES (@Type, @Make, @Model, @Serial, @Assigned, @Location, @Notes)" 
                UpdateCommand="UPDATE [Inventory] SET [Type] = @Type, [Make] = @Make, [Model] = @Model, [Assigned] = @Assigned, [Location] = @Location, [Notes] = @Notes WHERE [Serial] = @Serial">
                <DeleteParameters>
                    <asp:Parameter Name="Serial" Type="String" />
                </DeleteParameters>
                <InsertParameters>
                    <asp:Parameter Name="Type" Type="String" />
                    <asp:Parameter Name="Make" Type="String" />
                    <asp:Parameter Name="Model" Type="String" />
                    <asp:Parameter Name="Serial" Type="String" />
                    <asp:Parameter Name="Assigned" Type="String" />
                    <asp:Parameter Name="Location" Type="String" />
                    <asp:Parameter Name="Notes" Type="String" />
                </InsertParameters>
                <SelectParameters>
                    <asp:FormParameter FormField="DropDownList1" Name="Assigned" Type="String" />
                </SelectParameters>
                <UpdateParameters>
                    <asp:Parameter Name="Type" Type="String" />
                    <asp:Parameter Name="Make" Type="String" />
                    <asp:Parameter Name="Model" Type="String" />
                    <asp:Parameter Name="Assigned" Type="String" />
                    <asp:Parameter Name="Location" Type="String" />
                    <asp:Parameter Name="Notes" Type="String" />
                    <asp:Parameter Name="Serial" Type="String" />
                </UpdateParameters>
            </asp:SqlDataSource>
            <br />
             <br />
            <asp:Button ID="Button1" runat="server" PostBackUrl="~/Home.aspx" Text="Back" Width="88px" />
            <br />

            <br />
            <br />
            <br />
            <br />
            <br />
            <br />
            <br />
            <br />
        </div>
    </form>
</body>
</html>

how to get the rows if textbox value has changed inside gridview

Gridview that contains textboxes

After editing the textbox values inside this gridview, i need to get the rows (only edited rows) in button click event (button placed outside the gridview).

Asp.net mvc5 two matching strings return false?

Working on a project where I compare two string, how ever the string do match but it returns false for some reason...

This is the code I try to run to compare:

    @using (Html.BeginForm("Index", "Projects", FormMethod.Post, new { enctype = "multipart/form-data" }))
{
    {
        var allProjects = ViewData["allProjects"] as List<Project>;
        <h3>
            <a href="#">Inhouse projekt</a>
        </h3>
        <div>
            @{
                Html.RenderPartial("Projects", allProjects.Where(x => x.ProjectStatu.Name == "Pågående - Inhouse"));
            }
        </div>
        <h3>
            <a href="#">Outhouse projekt</a>
        </h3>
        <div>
            @{
                Html.RenderPartial("Projects", allProjects.Where(x => x.ProjectStatu.Name == "Pågående - Outhouse"));
            }
        </div>
        <h3>
            <a href="#">Övriga projekt</a>
        </h3>
        <div>
            @{
                Html.RenderPartial("Projects", allProjects.Where(x => x.ProjectStatu.Name != "Pågående - Inhouse" && x.ProjectStatu.Name != "Pågående - Outhouse" && x.ProjectStatu.Name != "Avslutat"));
            }
        </div>
        <h3>
            <a href="#">Avslutade projekt</a>
        </h3>
        <div>
            @{
                Html.RenderPartial("Projects", allProjects.Where(x => x.ProjectStatu.Name == "Avslutat"));
            }
        </div>
        <input type="submit" value="Spara" id="submit" name="submit" style="padding: 5px 20px 5px 20px; float: right;" />
     }
 }

Proof the two string's do match but it returns a false.. enter image description here

Add other projects stylesheet to Bundleconfig

I have a common solution MyApp. Within this, I have more than 2 projects like MyCommon,MyInclude,MyWeb. I want to place stylesheets,scripts in a common project and refer them in other projects. Now I refer my stylesheets in MyWeb project by adding them in BundleConfig as following:

public static void RegisterBundles(BundleCollection bundles)
        {
  bundles.Add(new ScriptBundle("~/bundles/bootstrap").Include(
                      "~/Scripts/bootstrap.js",
                      "~/Scripts/respond.js"));

            bundles.Add(new StyleBundle("~/Content/css").Include(
                      "~/Content/bootstrap.css",
                      "~/Content/login.css",
                      "~/Content/site.css"));
}

So, Now If I place these login.css,site.css in MyInclude project in MyApp solution and add them to this MyWeb project. How can i do this ? Can anyone help me to do this.. Thanks in advance..

How to apply Google Material Design to ASP.NET Controls (i.e. Checkbox, Button and etc)?

I'm trying to apply the Google Material Design to my ASP.NET web form controls. I can easily apply to HTML controls, but no chance with ASP.NET.

Original Page

 <form id="signinform" runat="server" class="form-validation animated fadeIn">
        <div class="container" id="login-block">
        <div class="row">
            <div class="col-sm-6 col-md-4 col-md-offset-4">
                <div class="account-wall">
                    <img class="user-img animated fadeIn" src="/Assets/global/images/logo/logo_white.png" />
                    <asp:PlaceHolder runat="server" ID="ErrorMessage" Visible="false">
                        <p class="text-danger">
                            <asp:Literal runat="server" ID="FailureText" />
                        </p>
                    </asp:PlaceHolder>
                    <div class="form-signup">
                        <div class="prepend-icon m-b-5">
                            <asp:TextBox runat="server" ID="username" CssClass="form-control form-white username" placeholder="Username" />
                            <asp:RequiredFieldValidator runat="server" ControlToValidate="username" Display="Dynamic" CssClass="text-danger m-b-0" ErrorMessage="The username field is required." />
                            <i class="icon-user"></i>
                        </div>
                        <div class="prepend-icon">
                            <asp:TextBox runat="server" ID="Password" TextMode="Password" CssClass="form-control form-white password" placeholder="Password" />
                            <asp:RequiredFieldValidator runat="server" ControlToValidate="Password" Display="Dynamic" CssClass="text-danger m-b-0" ErrorMessage="The password field is required." />
                            <i class="icon-lock"></i>
                        </div>
                        <div class="checkbox checkbox-material-grey">
                            <asp:CheckBox runat="server" ID="RememberMe" CssClass="md-checkbox" />
                            <asp:Label runat="server" CssClass="c-white normal f-11 m-b-15" AssociatedControlID="RememberMe">Remember me?</asp:Label>
                        </div>  
                    </div>
                    <div class="checkbox checkbox-material-grey">
                        <label class="c-white normal f-11 m-b-15">
                            <input type="checkbox" runat="server" name="remembercb" value="option1" class="md-checkbox">
                            Remember me?
                        </label>
                    </div>
                    <asp:Button runat="server" OnClick="LogIn" Text="Login" CssClass="btn btn-embossed btn-danger btn-block" />
                    <asp:Button runat="server" ID="ResendConfirm" OnClick="SendEmailConfirmationToken" Text="Resend confirmation" Visible="false" CssClass="btn btn-default" />
                    <p>
                        <asp:HyperLink runat="server" ID="RegisterHyperLink" ViewStateMode="Disabled">Register as a new user</asp:HyperLink>
                    </p>
                    <p>
                        <asp:HyperLink runat="server" ID="ForgotPasswordHyperLink" ViewStateMode="Disabled">Forgot your password?</asp:HyperLink>
                    </p>
                </div>
            </div>
        </div>
    </div>
</form>

HTML Control

<div class="checkbox checkbox-material-grey">
    <label class="c-white normal f-11 m-b-15">
        <input type="checkbox" runat="server" name="remembercb" value="option1" class="md-checkbox">
        Remember me?
    </label>
</div>

ASP.Net Control

<div class="checkbox checkbox-material-grey">
    <asp:CheckBox runat="server" ID="RememberMe" CssClass="md-checkbox" />
    <asp:Label runat="server" CssClass="c-white normal f-11 m-b-15" AssociatedControlID="RememberMe">Remember me?</asp:Label>
</div>

Is there any way to use Material Design with ASP.NET controls?

Using ASP.NET 5 Packages in ASP.NET 4.5 Project

I have an interest in using some of the ASP.NET 5 packages like Logging and Dependency Injection in a ASP.NET 4.5 (MVC5) project running on .NET 4.5. I have successfully installed both packages from nuget and appear to be able to use them just fine. Is there a reason why I shouldn't do this (other than the fact that they are in beta of course)?

Saving multiple selected checkboxlist into database asp.net

i'm working with ASP.NET web application and i'm having a problem with adding multiple selected checkboxlist into the database . i want the user to be able to chose more then one Check Box. i have tried some method but it didn't work the database still empty even my database connection work fine with others tables .

Destinations table :

CREATE TABLE [dbo].[Destinations]
(
    [Id] INT NOT NULL PRIMARY KEY, 
    [North] INT NULL DEFAULT 0, 
    [West] INT NULL DEFAULT 0, 
    [South] INT NULL DEFAULT 0, 
    [East] INT NULL DEFAULT 0, 
    CONSTRAINT [FK_Destinations_DeliveryMen] FOREIGN KEY ([Id]) REFERENCES [DeliveryMen]([Delivery_ID])
)

and my CheckBoxList is :

   <asp:CheckBoxList ID="CheckBoxList2" runat="server" RepeatColumns="2" RepeatDirection="Horizontal" Width="263px">
                <asp:ListItem text="North " Value="1"></asp:ListItem>
                <asp:ListItem text="South " Value="2"></asp:ListItem>
                <asp:ListItem text="West " Value="3"></asp:ListItem>
                <asp:ListItem text="East " Value="4"></asp:ListItem>
            </asp:CheckBoxList>

UPDATE : the C# code that i have tried :

SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["MyDatabase"].ConnectionString);
conn.Open();
string insertcheckboxlist = "insert into Destinations (North,West,South,East) values(@1,@3,@2,@4))";
SqlCommand comm = new SqlCommand(insertcheckboxlist, conn);
comm.Parameters.AddWithValue("@CheckBoxList2", CheckBoxList2.SelectedItem.Value);

connected model and disconnected model in EF

I'm confused a lot about connected model and disconnected in entity framework .

I was used traditional way ADO.net (DataReader for connected model and DataAdapter for disconnected model) and all I know that I use connected model when I have many users need to update or insert together and the disconnected model in a few circumstances when I need to send the data to other process make some operations on the data in memory and send them back to the db .

Now I read some articles about connected model and disconnected model in EF and I'm confused why should I attach explicitly the entities to the context in disconnected model ? I had read also that the default behavior in web is disconnected model and in WPF is connected model !


  • Could someone explain in easy manner with an an analogy of real life what's the difference between the two models?
  • How we could handle both models in EF with simple example?
  • Is there a relationship between the type of app (web form , MVC, WPF, WCF) and the dedicated model used in the EF?
  • When to use connected model and when to use disconnected model (using EF) ?

How to secure IIS Web Server

We have a web application which consists of an IIS web server which is on the internet, and a database server, which IIS accesses over a VPN link.

The problem we have is that we need to store the connectstring somewhere (which obviously can't be in the database).

I note that it is possible to encrypt web.config connect strings using aspnet_regiis :

http://ift.tt/1wS2nIT

Can anyone comment on how robust this is. What we do not want is the database being hacked from the internet.

One thing which concerns me is the aspnet_regiis is used to decrypt and encrypt and is installed on the machine itself. So if the machine was compromised and this exe was on there, discovering the passwords would not be that hard.

So assuming that this method of securing a password is not recommended, what other options do I have.

Note that in case it is relevant, IIS is running in the context of IIS APPPOOL\DefaultAppPool account.

Thanks.

Is it possible to put two images into one Gridview cell in XtraReport

I use xtrareport in asp.net and I have a gridview inside. I want to insert two images into one field of gridview.

Any Suggestions?

Add OnHover style programmatically to a link button in an extended control class

I'm extending the GridView control to add a custom Pager. I have added a few link buttons in my Pager and I need to change the color of the link buttons on hover.

I've seen several examples online but all have to include the actual CSS class in the aspx page and just reference it from the code behind. My situation is different between I only got a .cs file and I don't want to manually add classes to the aspx page.

This is the CSS I need to apply to my LinkButton "lnkBtnFirst"

btn-link:hover{
  color: #2a6496;
}

Enable multi user management in c#

In the table users a MySql db for each user can be stored with a different color, for example:

Users       colors
Foo         green
Pluto       yellow
Foo         red

When the user is authenticated I need to know what color is associated with the user who logs on.

I used the List method to append the variable color for each user in this way:

List<string> colorList = new List<string>();

....

if (reader.HasRows)
{
    while (reader.Read())
    {
        Colors = reader["Colors"].ToString();
        colorList.Add(Colors.ToString());
    }

        ns = string.Join(", ", colorList.ToArray());
}

And everything works up here.

Now I need publish in a GridView all rows stored in Experience table where are stored the comments of all users for each color.

For example in the case of user Foo I need publish in GridView all comments stored in Experience table speaking of the colors red and green.

But I can't publish this GridView because if user is Foo I see only the comments on the red color and nothing comment for green color.

Thought with loop I have this output:

SELECT * FROM Experience WHERE Colors IN ('red');

SELECT * FROM Experience WHERE Colors IN ('green');

My code below.

Anybody know how can I resolve do this?

Can you suggest?

Can you help me?

Thank you in advance.

private DataSet RetrieveColors()
    {
        str = null;
        strArr = null;
        count = 0;

        str = ns == null ? "" : ns.ToString();
        char[] splitchar = { ',' };

        if (!string.IsNullOrEmpty(str))
        {
            strArr = str.Split(splitchar);
        }
        else
        {
            strArr = null;
        }

        for (count = 0; count <= strArr.Length - 1; count++)
        {
                sql = @" SELECT * FROM Experience WHERE Colors IN (?); ";
        }


        DataSet dsColors = new DataSet();

        using (OdbcConnection cn =
          new OdbcConnection(ConfigurationManager.ConnectionStrings["ConnMySQL"].ConnectionString))
        {
            cn.Open();

            using (OdbcCommand cmd = new OdbcCommand(sql, cn))
            {
                for (count = 0; count <= strArr.Length - 1; count++)
                {
                    cmd.Parameters.AddWithValue("param1", Server.UrlDecode(strArr[count].Trim()));
                }

                OdbcDataAdapter adapter = new OdbcDataAdapter(cmd);
                adapter.Fill(dsColors);
            }
        }

        return dsColors;
    }

Edit # 1

Users       colors
Foo         green
Pluto       yellow
Foo         red

Validation failed for one or more entities EF6

I'm trying to develop a simple website using asp.net mvc4 & EF6 where I can simply save a client's data in MS SQL 2012 DB. For some unknown reason, whenever I try to save data I'm getting an error like this,

Validation failed for one or more entities. See 'EntityValidationErrors' property for more details

Here are my codes below,

Controller

[HttpPost]
    public ActionResult ClientManager(ClManagement ClTable)
    {
        if (Session["AdminNAME"] != null)
        {
            if (ModelState.IsValid)
            {
                var AddClient = ClTable.AddUserInfo;
                try
                {
                    db.ClientInfoes.Add(AddClient);
                    db.SaveChanges();
                    TempData["client_add_success"] = "Information Added Successfully!";
                }
                catch (DbEntityValidationException dbEx)
                {
                    foreach (var validationErrors in dbEx.EntityValidationErrors)
                    {
                        foreach (var validationError in validationErrors.ValidationErrors)
                        {
                            System.Console.WriteLine("Property: {0} Error: {1}", validationError.PropertyName, validationError.ErrorMessage);
                        }
                    }
                }
                return RedirectToAction("ClientManager", new { ClPanelId = "AllCl" });
            }
            else
            {
                TempData["client_add_fail"] = "Error! Information Add failed!";
                return RedirectToAction("ClientManager", new { ClPanelId = "AllCl" });
            }
        }
        else
        {
            return RedirectToAction("AdminLogin");
        }
    }

Model

public class ClManagement
{
    public ClientInfo AddUserInfo { get; set; }
    public IEnumerable<ClientInfo> UserCollection { get; set; }
}

View

@using (Html.BeginForm("ClientManager", "Home", FormMethod.Post))
            {
                @Html.ValidationSummary(true)
                <div class="editor-label">
                    <strong>Username</strong>
                </div>
                <div class="editor-field">
                    @Html.TextBoxFor(a => a.AddUserInfo.username, new { size = 50 })
                    @Html.ValidationMessageFor(a => a.AddUserInfo.username)
                </div>
                <div class="editor-label">
                    <strong>Password</strong>
                </div>
                <div class="editor-field">
                    @Html.PasswordFor(a => a.AddUserInfo.password, new { size = 50 })
                    @Html.ValidationMessageFor(a => a.AddUserInfo.password)
                </div>
                <div class="editor-label">
                    <strong>Email</strong>
                </div>
                <div class="editor-field">
                    @Html.TextBoxFor(a => a.AddUserInfo.email, new { size = 50 })
                    @Html.ValidationMessageFor(a => a.AddUserInfo.email)
                </div>
                <div class="editor-label">
                    <strong>Sex</strong>
                </div>
                <div class="editor-field">
                    @Html.DropDownListFor(a => a.AddUserInfo.sex, new List<SelectListItem>{
                        new SelectListItem() {Text = "Male", Value="Male"},
                        new SelectListItem() {Text = "Female", Value="Female"}
                    })
                    @Html.ValidationMessageFor(a => a.AddUserInfo.sex)
                </div>
                <div class="editor-label">
                    <strong>Blood Group</strong>
                </div>
                <div class="editor-field">
                    @Html.DropDownListFor(a => a.AddUserInfo.blood, new List<SelectListItem>{
                        new SelectListItem() {Text = "A+", Value="A+"},
                        new SelectListItem() {Text = "B+", Value="B+"},
                        new SelectListItem() {Text = "AB+", Value="AB+"},
                        new SelectListItem() {Text = "O+", Value="O+"},
                        new SelectListItem() {Text = "A-", Value="A-"},
                        new SelectListItem() {Text = "B-", Value="B-"},
                        new SelectListItem() {Text = "AB-", Value="AB-"},
                        new SelectListItem() {Text = "O-", Value="O-"}
                    })
                    @Html.ValidationMessageFor(a => a.AddUserInfo.blood)
                </div><br />
                <p><input type="submit" class="btn btn-info" value="Add" /></p>
            }

How can I solve this problem? What could possibly go wrong? Your help would be a life saving for me. Thanks!

How to bind more than one gridview on single asp.net page?

How to bind more than one gridview on single asp.net page,with edit, update and pagination. Must work independendly.

Deduct 10% from recordset number

Is it possible to run a calculation when presenting a number from a recordset to a webpage

I want to deduct 10% off the number in the database.

I've tried the below:

 <%=((Recordset1.Fields.Item("FullCover").Value)*90/100)%>

But it just returns "-1.#IND"

Font Awesome Icons in DropDownList Items

I want a select box with the font awesome icon and the name of the icon. I build my ListItems for the DropDownList in Code behind dynamically and want to show the icon with the unicode. Here is my output:

unicode is as plain text

The decleration of the DropDownList looks like this:

<asp:DropDownList ID="ddl_Icons" CssClass="form-control select2" style="font-family: 'FontAwesome', Arial" runat="server"></asp:DropDownList>

The font-family should be correct but there is still no icon displayed. Any tips how I can display the icons?

Internet explorer hanging with long running AJAX WebMethod on SetTimeout

I have a couple of SetTimeouts for when the page loads which will load in chart data using AJAX calls to the code behind.

    $(document).ready(function() {
        window.setTimeout(drawGraphs, 0);
        window.setTimeout(drawGraphsCharts, 0);
    });

This works great in Chrome and Firefox, however if one of the methods takes a long time, e.g. 1-5 seconds to finish, Internet Explorer hangs when this is taking place until this has completed, rather than loading one by one like the other browsers.

Has anyone come across this and how to fix it.

I am simulating a long running method at the moment using the following in my web method.

    for (var i = 0; i < 1000000000; i++)
    {
        var test = i + i;
        var test2 = i * i;
    }

How to write ListView TextBox Items to Database for each row

I have this Listview:

<asp:ListView ID="fundingListView" runat="server" OnItemCommand="fundingListView_OnItemCommand" OnItemDataBound="fundingListView_OnItemDataBound" DataKeyNames="ID"> 
                    <ItemTemplate>
                        <div style="width:40px; float:left; margin:5px 15px 5px 0px; padding-left:10px;">
                            <asp:LinkButton ID="addFundingLinkButton" runat="Server" ToolTip="Finanzierung zuweisen" CommandName="addFunding" CssClass="insertTextModuleButtonFade"></asp:LinkButton>
                        </div>
                        <div style="float:left; width:40px; margin:10px 10px 5px 0px; text-align:center;"><%# Eval("id") %>&nbsp;</div>
                        <div style="float:left; width:120px; margin:10px 10px 5px 0px; text-align:center;"><%# Eval("financialPartnerId") %>&nbsp;</div>
                        <div style="float:left; width:80px; margin:10px 10px 5px 0px; text-align:center;"><%# Eval("accountNumber") %>&nbsp;</div>
                        <div style="float:left; width:120px; margin:10px 10px 5px 0px; text-align:center;"><%# Eval("fundingAmount") %></div>                    
                        <div style="float:left; width:120px; margin-left:40px;">
                            <asp:TextBox ID="fundingConfirmationAmount" runat="server" Width="96" Height="12"></asp:TextBox>
                        </div>     
                        <asp:Label id="fundingAlreadyAddedButton" runat="server" style="visibility:hidden"><%# Eval("alreadyAdded") %></asp:Label>               
                        <div class="clear"></div>
                    </ItemTemplate>

It is possible to change the value of the textbox "fundingConfirmationAmount" on the webpage.

How do I access the entered value in this textbox for each row of the listview and write the new text to my mysql database?

Thanks in advance

How to open and write exist excel template in ASP.NET C# using Windows 2008 server?

I have problem in my project.I want to write data into exist excel file in Asp.NET C# on Windows 2008 server . I created project on my local computer and it is working properly but When I published on server I get this error: The Error

:System.Runtime.InteropServices.COMException (0x800A03EC): 
Exception from HRESULT: 0x800A03EC at Microsoft.Office.Interop.Excel._Workbook.SaveAs(Object Filename,Object FileFormat, Object Password, Object WriteResPassword, Object ReadOnlyRecommended, Object CreateBackup, XlSaveAsAccessMode AccessMode, Object ConflictResolution, Object AddToMru, Object TextCodepage, Object TextVisualLayout, Object Local) 
at Stock.EService.ReadExistingExcel() 

Here is save file code:

mWorkBook.SaveAs(path3, Excel.XlFileFormat.xlWorkbookNormal, Missing.Value, Missing.Value, false, false, Excel.XlSaveAsAccessMode.xlNoChange,Excel.XlSaveConflictResolution.xlUserResolution, true,Missing.Value, Missing.Value, Missing.Value);

mWorkBook.Close(true, Missing.Value,Missing.Value);

How can solve my problem.I create a file in server and gave full control but my project does not work. Please help me.

Can a client get to a button click event programmatically if the button is not rendered?

This is in ASP.NET web forms, I have a save button on a screen. When I load the page initially, under certain conditions, the save button is not rendered.

button1.visible = false

In my button clicked event, I have this

public void button1_click(Object sender, EventArgs e)
{
    SaveData();
}

The only security preventing the user being from being saved is on whether the save button is rendered.

In MVC, it would be trivial to access the save button action method just by making a HTTP POST to the server with my own modified request.

In ASP.NET Web forms, I'm a little bit confused because it relies on the encrypted ViewState being posted back. Do I still need to add this security to the button1_click event too? If so, then can you tell me how a client can fire a postback to the server that would reach the button click event without the button being visible?

DNX start multiple websites

I have a folder A, which including two websites project. Can I start them only one command?

Such as dnx <something here> kestrel. For now, I have to switch to each website root directory, and execute command dnx . kestrel separately.

Any suggestion is helpful.

Getting AdWords customerId without a refresh token

I'm working on a Web Application that allows user to connect AdWords account. 1) So once user connected their AW account I am getting token from AW API that includes an access token and a refresh token. So far so good, it's just a typical OAuth2 process.

2) Next time another user connects same AW account, AW would not provide me with a refresh token, assuming I have it stored somewhere, which is expected.

So here is the problem, there doesn't seem to be a way to get user information without the refresh token, meaning I can't identify the user to retrieve the refresh token.

I'm using .NET library (Google.Apis.Analytics.v3) and it doesn't allow me to request customer information without providing the refresh token...

Here is the sample code:

var tokenResponse = await adWordsService.ExchangeCodeForTokenAsync(code, redirectUri);
var adWordsUser = adWordsService.GetAdWordsUser();
var customerService = (CustomerService)adWordsUser.GetService(AdWordsService.v201502.CustomerService);
var customer = customerService.get();

adWordsService is just a wrapper around the API. so when I execute this line var customer = customerService.get() I get a following error:

ArgumentNullException: Value cannot be null.

Parameter name: AdWords API requires a developer token. If you don't have one, you can refer to the instructions at http://ift.tt/RTUfQb to get one.

Google.Api.Ads.AdWords.Lib.AdWordsSoapClient.InitForCall(String methodName, Object[] parameters)

Developer token is there and so are all the client IDs.

If I add this line adWordsUser.Config.AuthToken = tokenResponse.AccessToken; before making the call, it complains about the refresh token.

ArgumentNullException: Value cannot be null.

Parameter name: Looks like your application is not configured to use OAuth2 properly. Required OAuth2 parameter RefreshToken is missing. You may run Common\Utils\OAuth2TokenGenerator.cs to generate a default OAuth2 configuration.

Google.Api.Ads.Common.Lib.OAuth2ProviderBase.ValidateOAuth2Parameter(String propertyName, String propertyValue)

So the question is, how does one acquire user information (in this case customerId, according to this article http://ift.tt/1Ie2Uou) during authentication for the purpose of storing the refresh token?

Microsoft.Owin.Host.SystemWeb gets error Could not load file or assembly System.Query

I have an existing web form website and trying to upgrade authentication from Membership to Identity with Owin. I tried to install those packages:

  • Microsoft.AspNet.Identity.EntityFramework
  • Microsoft.AspNet.Identity.Owin
  • Microsoft.Owin.Security.Cookies
  • Microsoft.Owin.Host.SystemWeb

But after installed the Microsoft.Owin.Host.SystemWeb package, I got error as below:

"Could not load file or assembly 'System.Query, Version=1.0.2319.19041, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified."

I also tried to remove out this package, It worked again, but would get error if I try to re-install the package.

Have anybody faced with this issue can help me to solve?

Thank you, Giang.

ASP.NET MVC: Custom Validation by DataAnnotation depending on configuration

I'm using DataAnnotation for client and server validation of my view model. I would like to ask you about the best practices of using custom validation.

I have two forms, which use the same view model:

public class RecipientViewModel
{
    [Required]
    public string Address1 { get; set; }

    public string Address2 { get; set; }
}

What I want to achieve, it is that the first form should validate the Address2 field, but the second form did not. Of course my view model is much bigger and I want to do it generic as much as possible.

Is there any possibility to pass a list of fields to be validated and how? For example view could pass it to view model somehow?

Role Based Session Expiring Duration in Asp.Net Identity

My Application is having 3 types of Asp.Net User Roles. Currently every user is having Cookie Expiration Time of 10 days. I am able to set this at Startup Class using this code:

  app.UseCookieAuthentication(new CookieAuthenticationOptions
            {
                AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie,
                LoginPath = new PathString("/Home/Login"),
                ExpireTimeSpan = new TimeSpan(10, 1, 0, 0, 0),
                 SlidingExpiration=true,
}

The problem here is that this sliding expiring time is applied to all kind of users in the system. I am not able to figure out how can we set the expiring time of cookie based on the Role of the user who've just logged in.

Any help will be greatly appreciated.

Thanks

How can we collaborate a multiple Excel sheets?

how we are collect a multiple excel sheets data into one? Is there any tool is available ?? I want it to collect all excel sheets that can merged together whenever necessary.

Find Master Page Dropdown control on other Master Page ASP.net

I have two master page one is User.Master and Other is Account.Master I want to find User.Master Dropdown selected value on Account.Master Page . Please give me suggestion and help me.

How Can I Use Release Management To Remove \ Add Change Web.Config Tags?

As everyone knows , in VS2010 and above there is a use of Web.config transforms to remove add update tags and attributes in a web.config file .

Release management has the ability to switch values inside a web.token.config (convention is a variable like so : ConnectionString )

but what do i do in order to remove a whole section ? or add one for a different environment ? for example , qa should not have a debug option , so in transforms we could Hide Copy Code

i really am trying to connect between transforms and release management but can't , they do not behave the same , a single build definition must know which web.config file to use (i use web.QA.config and web.prod.config) , while release template has only one build definition for both his qa and prod paths .

so , one release template with 2 stages (qa->prod) which has the same build definition cannot transform once for qa and once for prod (because again, it is defined in the build definition , from where to transform like Hide Copy Code

:/p:UseWPP_CopyWebApplication=true /p:PipelineDependsOnBuild=false /p:Configuration=QA /p:TransformConfigFiles=true

i tried this link http://ift.tt/1KNIgBD[^]

but it does not help the build definition transform the right web.config according to the release path . he just build the web.release.config , which does not help .

i tried many other sites as well , non of them answers the simple question : how can release management transform the web config file beyond just a simple value swap , which is not enough in my scenario , how can it add tags , remove them change deeper configurations .

how can i define "DisplayErrorMessage" in this case?

this is a code that i wrote for my open button...but i have error on "DisplayErrorMessage" part...what should i write instead? or how can i define it in order to don't error again

protected void btnOpen_Click(object sender, EventArgs e)
{
    txtFileName.Text = txtFileName.Text.Trim();
    if (txtFileName.Text == string.Empty)
    {
        string strErrorMessage = "you did Not specify file for opening!";
        DisplayErrorMessage(strErrorMessage);
    }

    string strFileName = txtFileName.Text;
    string strRootRelativePath = "~/app_data/pageContent";
    string strRootRelativePathName =
    string.Format("{0}/{1}", strRootRelativePath, strFileName);
    string strPathName = Server.MapPath(strRootRelativePathName);

    System.IO.StreamReader ostreamReader = null;

    try
    {
        ostreamReader = new System.IO.StreamReader(strPathName, System.Text.Encoding.UTF8);
        litPageMessages.Text = ostreamReader.ReadToEnd();
    }
    catch (Exception ex)
    {
        litPageMessages.Text = ex.Message;
    }
    finally
    {
        if (ostreamReader != null)
        {
            ostreamReader.Dispose();
            ostreamReader= null;
        }

    }
}

ASP.Net Hide Left Hand Menu On Home Page

I have an asp.net website which is having a left hand menu added to it and have hit an issue as I have found that I am doing a lot of code duplication (which is bad I know). What I want is for the left hand menu to be added to my Site.Master file rather than me having to add it to every single page.

I can do this, but the left hand menu is then displayed on the "Home" page which I don't want so i was thinking that i need some sort of IF statement but I don't know how I can do this as I cant look at the URL as when the user hits the page its the standard naming (e.g. http://ift.tt/1N770SC)

My left hand menu is a scrolling nav-stacked which is working fine so I will also need to add the JQuery for this to the Site.Master I think.

Current HTML for my 'About Us' page

<asp:Content ID="AboutBodyContent" ContentPlaceHolderID="MainContent" runat="server">
    <div class="col-sm-3 hidden-xs" style="padding-left: 0px">
        <div class="follow-scroll">
            <ul class="nav nav-stacked">
                <li><a runat="server" href="~/">Home</a></li>
                <li class="active"><a runat="server" href="~/About">About</a></li>
                <li><a runat="server" href="~/Session/pg1">Session</a></li>
                <li><a runat="server" href="~/EmailPg">Email</a></li>
            </ul>
        </div>
    </div>

    <div class="col-xs-12 col-sm-9">
        <h2><%: Title %>.</h2>
        <p>Use this area to provide additional information.</p>
        <p>Use this area to provide additional information.</p>
        <p>Use this area to provide additional information.</p>
    </div>

    <script type="text/javascript">
        (function ($) {
            var element = $('.follow-scroll'),
                originalY = element.offset().top;

            // Space between element and top of screen (when scrolling)
            var topMargin = 75;

            // Should probably be set in CSS; but here just for emphasis
            element.css('position', 'relative');

            $(window).on('scroll', function (event) {
                var scrollTop = $(window).scrollTop();

                element.stop(false, false).animate({
                    top: scrollTop < originalY
                            ? 0
                            : scrollTop - originalY + topMargin
                }, 300);
            });
        })(jQuery);
    </script>
</asp:Content>

The HTML code below is what I thought of for my Site.Master but as I said it needs to not be displayed on the "Home Page".

    <div class="container body-content" style="padding-top: 25px">
        <div class="container">
            <div class="row">
                <div class="col-xs-12">                            
                    <div class="col-sm-3 hidden-xs" style="padding-left: 0px">
                        <!-- 'IF' statement to go here so not displayed on Home page -->
                        <ul class="nav nav-stacked">
                            <li><a runat="server" href="~/">Home</a></li>
                            <li style="border-left: 1px solid lightgray"><a runat="server" href="~/About">About</a></li>
                            <li style="border-left: 1px solid lightgray"><a runat="server" href="~/Session/pg1">Session</a></li>
                            <li style="border-left: 1px solid lightgray"><a runat="server" href="~/EmailPg">Email</a></li>
                        </ul>
                    </div>
                    <div class="col-xs-12 col-sm-9" style="padding-right: 0px">
                        <asp:ContentPlaceHolder ID="MainContent" runat="server"></asp:ContentPlaceHolder>
                    </div>
                </div>
            </div>                    
        </div>
    </div>

how to stop save button function running when certain tab is open

I have a page that displays a few different tabs.

<li id="liHeader"><a href="#tabHeader" title="Header">General</a></li>
<li id="liFooter"><a href="#tabNotesComments" id="tabNotes" title="Notes/History of Job">Notes (<%= NoOfNotes %>)</a></li>
<li runat="server" id="liDelivery" ><a href="#<%= tabDeliveryDbrief.ClientID %>" title="Delivery Dbrief">Delivery Dbrief</a></li>

Each tab has different functions. Above these tabs is a few buttons new, save, delete etc. In the save function, there is code that creates a note every time something is updated. For example "user A updated job at 12:48 PM". This save button is for any changes that are made in any tab that is opened. But when the tab 'Delivery Debrief' is open, I don't want this note to be created every time I updated something. In this tab the information gets updated a lot so there will be too many notes. So every time the save button is clicked this code is run:

 protected void btnSave_Click(object sender, EventArgs e)
    {
     string Note = Job.Compare(oldJob, new Job(int.Parse(Request.QueryString["JobID"])), Mod);
                                JobNote modNote = new JobNote
                                {
                                    JobID = job.ID,
                                    Company_ID = CurCompID,
                                    Date = DateTime.Now,
                                    Time = DateTime.Now,
                                    Note = Note,
                                    CreatedBy = CurrentUser.UserID,
                                    CreatedByName = CurrentUser.Username,
                                    NoteType = 1
                                };
                                modNote.Create();
}

Is there a way to stop this code running when the delivery debrief tab is open? The notes still need to be created for the other tabs.

Having trouble with transfering 2 different ProductID to the next page

i am currently embarking on a project regarding products catalog. I have check box above the image. So whenever, i checked 2 , i want to transfer 2 different Product Id and display 2 images in the next page. However, i am not able to do that. I can only transfer 1 selected image only . is there any way there once i checked 3 checkboxes, it will show me 3 items on the next page? Great help will be appreciated!!

void GetCheckedBox()
{
    foreach (DataListItem li in DataList1.Items)
    {
         selectedProducts = selectedProducts + "," + cb.Value; 
         LblText.Text = selectedProducts;

         Product.Add(selectedProducts);

         string url = "CompareProducts.aspx?prodId=" + selectedProducts.Substring(selectedProducts.LastIndexOf(',') + 1);

         Response.Redirect(url);
         //  DataList1.DataBind();

        }
    }
}

My ProductID is in string form : 0001,0002, 0003

Open Crystal Report from a file server/ network on web server

I have a web server where an ASP.NET 4.0 site is hosted in iis 6.0.

I also have another file server (internal server & on a different domain) with some crystal report files.

The web site has a page which opens crystal report from file path of the file server & displays the report via the crystal report viewer control.

The problem is when i run the page, I get this exception :

"Unsupported Operation. A document processed by the JRC engine cannot be opened in the C++ stack."

Some solutions for this issue say :

1) Crystal Report File should be copied to the same folder where site is hosted which i cannot do.

2) Check for appropriate file path & permissions.

I can verify by logging remotely into web server that file server is accessible & appropriate permissions to read files are set.

I also verified that crystal reports can run on web server by creating a winforms app which runs same reports.

Please advise what am i missing & how do i go about diagnosing this issue..

Thanks In Advance..

The resource cannot be found on web form when using crystal reports and after deployment

every other form is working fine but one which has crystal report First asking for server's username and password when i provide username password then it show this error Server Error in '/Reports' Application. The resource cannot be found.

my application root folder has full rights for users 'everyone' ,iuser,iusers_iis.... admin ,and the account which i am using .

i checked, the resource exists ,I browsed the .aspx file from iis then hit browse it should be opened in browser even then it shows resource cannot be found.

i have used asp.net website as project but if i run my website from visual studio it works fine and no prompting for username and password of my server.

any help is appreciated.

Exporting CSV file is not woking with double quotes value

i have gridview ,when i exporting grid to csv format if table contain double quotes value data are not shown after double quotes.(export contain value upto double but not after double quotes).If i remove the double quotes it working(it showing all data)