How can i add a - character in the URL using ASP.NET MVC. I have a controller called home and action name DownloadSpiderman2PCGAMEHighlyCompressed, From the mentioned action the created URL is

http://localhost:7500/Home/DownloadSpiderman2PCGAMEHighlyCompressed

I want to add - character in to my URL i have try multiple ways couldn't find solution

My effort

I have rename the - in the view however the url does not reflect the - in the address.

 public ActionResult DownloadSpiderman2PCGAMEHighlyCompressed()
        {
            return View("Download-Spiderman2-PC-GAME-Highly-Compressed");
        }

My expected output should be

http://localhost:7500/Home/Download-Spiderman2-PC-GAME-HighlyCompressed

i have a template for front end and admin page i want to open my template in sublime and make a Content management system with code igniter or other farameworks or import it in visual studio and make a Content management system with asp.net or asp core is it possible?

I would like to show an continues slide show on my view (lets say 10 pictures located on a Network path).

And at the same time, when the slide show is running I would like to call a controller action (lets say every 5 seconds).

During the controller call, the slide show should not stop.

After the call I need to decide: continue with the current slide show or start another one (the new path will come from the controller call).

Should I use an ajax call (with json return)?

Thank you for help.

I have one Excel sheet with multiple tabs, need to insert this data into SQL Server table using Asp net mvc asp net mvc through this task is completed please to help me

I have a textbox on my form:

 <input type="text" class="input-group-field" id="draftSearchProducts" name="draftSearchProducts" placeholder="SearchProducts" />

In my controller I have the following:

 [HttpGet]
    public ActionResult SearchResults(string keywords, int queryLimit = 20, int offset = 0)
    {
        try
        {
            ProductSearchResults searchResults = new ProductSearchResults();

            ComApiData<GetProductsDataConnector> productData = new ComApiData<GetProductsDataConnector>();

            var products = productData.Connector.GetProductBySearch(new ProductRequestParameters()
            {
                Search = keywords,
                LTPMerchantId = merchantId,
                QueryLimit = queryLimit,
                QueryOffset = offset
            });

            searchResults.ProductDetails = products.ToList();

            return PartialView("_SearchResults", searchResults);
        }
        catch (Exception ex)
        {
            throw ex;
        }
    }

And there is a button on the form:

<a id="draftAddProduct" class="hollow button secondary"><i class="fa fa-plus"></i>&nbsp;Add Product</a>

Since I am new to this side of development, I need a little help. I need to wire up the button to take the value typed in the text call the SearchResults controller (located in a file called ProductsController.cs) and populate a modal dialog box with the results. I have a partial razor page:

    @model Sauron.Models.Products.ProductSearchResults

@foreach (var product in Model.ProductDetails)
{
    <tr>
        <td class="imageColumn">
            @if (product.Image != null)
            {
                <div class="ajax-image-load">
                    <input type="hidden" id="BlockImageID" value="@product.Image.ImageId" />
                    <input type="hidden" id="BlockImageWidth" value="89" />
                    <input type="hidden" id="BlockImageHeight" value="89" />
                    <input type="hidden" id="BlockImageLoaderGif" value="/images/loader-circle-basic.gif" />
                </div>
            }
        </td>
        <td>
            @product.SKU
            <input type="hidden" id="editID" name="editID" value="@product.ProductId" />
        </td>
        <td>@(product.Description != null ? product.Description.Name : product.ReceiptName)</td>
        @*<td>@(product.ColorId != null ? product.)</td> we might want to gather the color object as a property of this search class model*@
        <td>
            @{
                var textColor = "";
                if((product.InventorySummary ?? 0) <= 0){
                    textColor = "red-text";
                }
            }
            <span class="@textColor">@((product.InventorySummary ?? 0).ToString())</span>
        </td>
        <td>
            @if (product.ProductType != null ? product.ProductType.Equals(ProductType.PACK) : false)
            {
                <span>@(product.PackQty != null ? string.Format("{0} {1}", product.PackQty.Value, product.ProductType.ToString()) : product.ProductType.ToString())</span>
            }
            else if (product.ProductType != null ? product.ProductType.Equals(ProductType.CASE) : false)
            {
                <span>@(product.PackQty != null ? string.Format("{0} {1}", product.PackQty.Value, product.ProductType.ToString()) : product.ProductType.ToString())</span>
            }
            else
            {
                <span>@(product.ProductType != null ? product.ProductType.ToString() : "")</span>
            }
        </td>

    </tr>
}

that will display the results. I need to display the results of the _SearchResults.cshtml page in a modal box.

I want to call the SearchResults method from the values entered in the text box to display the results.

Anyone's help is appreciated.

I have the following code to add images to a list , images in a folder within the project

List<System.Drawing.Image> pic;
pic = new List<System.Drawing.Image>();            
pic.Add(new Bitmap(GetType(), "~/Image/Apple.jpg"));

I'm not sure what's the problem

how to handle programmatically added Delete button in asp.net grid view my code:

  CommandField cField = new CommandField();
        cField.DeleteText = "Delete";
        cField.ShowDeleteButton = true;
        GridView1.Columns.Add(cField);

I have an MVC application (website) using pretty much OOB authentication like below. Every once in a while, a large number of users will be denied access and forced to login again, although the browser shows a valid AspNetApplicationCookie with an expiration date in the distant future. This seems to happen at the same time. I suspected something with server patching, or workstations being rebooted and some corporate policy wiping out cookies, but they are still there. My startup file code is below:

 public partial class Startup
{
    // For more information on configuring authentication, please visit http://go.microsoft.com/fwlink/?LinkId=301864
    public void ConfigureAuth(IAppBuilder app)
    {
        // Configure the db context and user manager to use a single instance per request
        app.CreatePerOwinContext(ApplicationDbContext.Create);
        app.CreatePerOwinContext<ApplicationUserManager>(ApplicationUserManager.Create);

        // Enable the application to use a cookie to store information for the signed in user
        // and to use a cookie to temporarily store information about a user logging in with a third party login provider
        // Configure the sign in cookie
        TimeSpan expiretimespan;
        TimeSpan validateinterval;
        expiretimespan = TimeSpan.Parse(ConfigurationManager.AppSettings["TimeoutSpanDays"]);
        double tsDays = expiretimespan.TotalDays;

        validateinterval = TimeSpan.Parse(ConfigurationManager.AppSettings["ValidateIntSpanDays"]);
        double tsVIDays = validateinterval.TotalDays;

        app.UseCookieAuthentication(new CookieAuthenticationOptions
        {
            AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie,
            LoginPath = new PathString("/Account/SignIn"),
            ExpireTimeSpan = TimeSpan.FromDays(tsDays),
            Provider = new CookieAuthenticationProvider
            {
                OnValidateIdentity = SecurityStampValidator.OnValidateIdentity<ApplicationUserManager, ApplicationUser>(
                    validateInterval: TimeSpan.FromDays(tsVIDays),
                    regenerateIdentity: (manager, user) => user.GenerateUserIdentityAsync(manager))
            }
        });

        app.UseExternalSignInCookie(DefaultAuthenticationTypes.ExternalCookie);

        // Uncomment the following lines to enable logging in with third party login providers
        //app.UseMicrosoftAccountAuthentication(
        //    clientId: "",
        //    clientSecret: "");

        //app.UseTwitterAuthentication(
        //   consumerKey: "",
        //   consumerSecret: "");

        //app.UseFacebookAuthentication(
        //   appId: "",
        //   appSecret: "");

        //app.UseGoogleAuthentication(new GoogleOAuth2AuthenticationOptions()
        //{
        //    ClientId = "",
        //    ClientSecret = ""
        //});
    }
}

I'm trying to structure correctly my Login form which is designed in Bootstrap. It's a Simple one but I can't still get it right.

What I want is the outcome must be similar to the following: enter image description here

But Actually I have this one: enter image description here

I would like to my Login form to be similar to the first Login Picture.

Here is my Login Form:

<body class="hold-transition login-page">
    <div class="login-box">
        @*<div class="login-logo">
            <a href="#"><b>TMS</b></a>
        </div>*@
        <!-- /.login-logo -->
        <div class="login-box-body">
            <p class="login-box-msg">Sign in to start your session</p>

            <section id="loginForm" class="left col-md-8">
                <h2>Use a local account to log in.</h2>
                <form method="post">
                    @AntiForgery.GetHtml()
                    @* If one or more validation errors exist, show an error *@
                    @Html.ValidationSummary("Log in was unsuccessful. Please correct the errors and try again.", excludeFieldErrors: true, htmlAttributes: null)
                    <div style="color:#000;" class="btn btn-info col-lg-offset-3">
                        <img src="~/Icon/icons8-high-priority-40.png" width="21" height="19" />  @Page.LogMessage
                    </div>
                    <fieldset>
                        <legend>Log in to Your Account</legend>

                        <div class="form-horizontal">
                            <div class="email form-group has-feedback">
                                <label for="email" @if (!ModelState.IsValidField("email")) { <text> class="error-label control-label col-md-4" </text> }>Email address</label>
                                <div class="col-md-10">
                                    <input type="text" id="email" name="email" class = "form-control" value="@email" @Validation.For("email") />
                                    <span class="glyphicon glyphicon-user form-control-feedback"></span>
                                    @* Write any user name validation errors to the page *@
                                    @Html.ValidationMessage("email")

                                </div>

                            </div>
                            <div class="password form-group has-feedback">
                                <label for="password" @if (!ModelState.IsValidField("password")) { <text> class="error-label control-label col-md-4" </text> }>Password</label>
                                <div class="col-md-10">
                                    <input type="password" id="password" class = "form-control" name="password" @Validation.For("password") />
                                    <span class="glyphicon glyphicon-lock form-control-feedback"></span>
                                    @* Write any password validation errors to the page *@
                                    @Html.ValidationMessage("password")

                                </div>

                            </div>
                              <div class="remember-me row">
                                <div class="col-xs-8">
                                    <div class="checkbox icheck">
                                        <input type="checkbox" id="rememberMe" name="rememberMe" value="true" checked="@rememberMe" />
                                        <label class="checkbox" for="rememberMe">Remember me?</label>
                                       </div>
                                    </div>
                              </div>
                            <div class="form-group">
                                <div class="col-md-offset-8 col-md-4">
                              <input type="submit" value="Submit" class="btn btn-primary btn-block btn-flat" />
                                    </div>
                            </div>
                        </div><br />

                        @*<div style="color:#f00; width:220px" class="message-infolog">
                            <span style="initial-letter-wrap:initial; text-decoration-line:underline;"><img src="~/Icon/icons8-high-priority-40.png" width="21" height="19" /> @Page.LogMessage</span>
                        </div>*@
                    </fieldset>
                </form>
                @*<p>
            <a href="~/Account/Register">Don't have a Account?</a>
            <a href="~/Account/ForgotPassword">Did you forget your password?</a>
        </p>*@
            </section>
            <div class="social-auth-links text-center">
                <p>- OR -</p>
                <button class="lead btn btn-success">
                    <i class="fa fa-refresh fa-spin fa-2x fa-fw"></i>
                    <a href="@Href("~Account/SignIn.cshtml")" id = "loginHome" class = "btn btn-block btn-social btn-facebook btn-flat" >                        
                        <span class="sr-only">Sign in using</span><b style="color:#000">365</b>
                    </a>
                </button>

            </div>

        </div>

    </div>


</body>

HTML Header:

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>@Page.Title</title>
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <link href="~/Content/bootstrap.min.css" rel="stylesheet" />
    <link rel="stylesheet" href="~/Scripts/bower_components/font-awesome/css/font-awesome.min.css">
    <link rel="stylesheet" href="~/Scripts/bower_components/Ionicons/css/ionicons.min.css">
    <link rel="stylesheet" href="~/Scripts/dist/css/AdminLTE.min.css">
    <link rel="stylesheet" href="~/Scripts/plugins/iCheck/square/blue.css">
    <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700,300italic,400italic,600italic">
</head>

CSS

html {
    background-color: #e2e2e2;
    margin: 0;
    padding: 0;
}

body {
    background-color: #fff;
    border-top: solid 10px #000;
    color: #333;
    font-size: .85em;
    font-family: "Segoe UI", Verdana, Helvetica, Sans-Serif;
    margin: 0;
    padding: 0;
}

/*a {
    color: #333;
    outline: none;
    padding-left: 3px;
    padding-right: 3px;
    text-decoration: underline;
}

    a:link, a:visited,
    a:active, a:hover {
        color: #333;
    }

    a:hover {
        background-color: #c7d1d6;
    }

header, footer, hgroup,
nav, section {
    display: block;
}*/

mark {
    background-color: #a6dbed;
    padding-left: 5px;
    padding-right: 5px;
}

.float-left {
    float: left;
}

.float-right {
    float: right;
}

.clear-fix:after {
    content: ".";
    clear: both;
    display: block;
    height: 0;
    visibility: hidden;
}

h1, h2, h3,
h4, h5, h6 {
    color: #000;
    margin-bottom: 0;
    padding-bottom: 0;
}

h1 {
    font-size: 2em;
}

h2 {
    font-size: 1.75em;
}

h3 {
    font-size: 1.2em;
}

h4 {
    font-size: 1.1em;
}

h5, h6 {
    font-size: 1em;
}

    h5 a:link, h5 a:visited, h5 a:active {
        padding: 0;
        text-decoration: none;
    }


/* main layout
----------------------------------------------------------*/
.content-wrapper {
    margin: 0 auto;
    max-width: 960px;
}

#body {
    background-color: #efeeef;
    clear: both;
    padding-bottom: 35px;
}

    .main-content {
        background: url("../Images/accent.png") no-repeat;
        padding-left: 10px;
        padding-top: 30px;
    }

    .featured + .main-content {
        background: url("../Images/heroAccent.png") no-repeat;
    }

header .content-wrapper {
    padding-top: 20px; 
}

footer {
    clear: both;
    background-color: #e2e2e2;
    font-size: .8em;
    height: 100px;
}


/* site title
----------------------------------------------------------*/
.site-title {
    color: #c8c8c8;
    font-family: Rockwell, Consolas, "Courier New", Courier, monospace;
    font-size: 2.3em;
    margin: 0;
}

.site-title a, .site-title a:hover, .site-title a:active {
    background: none;
    color: #c8c8c8;
    outline: none;
    text-decoration: none;
}


/* login
----------------------------------------------------------*/
#login {
    display: block;
    font-size: .85em;
    margin: 0 0 10px;
    text-align: right;
}

    #login a {
        background-color: #d3dce0;
        margin-left: 10px;
        margin-right: 3px;
        padding: 2px 3px;
        text-decoration: none;
    }

    #login a.email {
        background: none;
        margin: 0;
        padding: 0;
        text-decoration: underline;
    }

    #login ul {
        margin: 0;
    }

    #login li {
        display: inline;
        list-style: none;
    }


/* menu
----------------------------------------------------------*/
ul#menu {
    font-size: 1.3em;
    font-weight: 600;
    margin: 0 0 5px;
    padding: 0;
    text-align: right;
}

    ul#menu li {
        display: inline;
        list-style: none;
        padding-left: 15px;
    }

        ul#menu li a {
            background: none;
            color: #999;
            text-decoration: none;
        }

        ul#menu li a:hover {
            color: #333;
            text-decoration: none;
        }


/* page elements
----------------------------------------------------------*/
/* featured */
.featured {
    background-color: #fff;
}

    .featured .content-wrapper {
        background-color: #7ac0da;
        background-image: -ms-linear-gradient(left, #7ac0da 0%, #a4d4e6 100%);
        background-image: -o-linear-gradient(left, #7ac0da 0%, #a4d4e6 100%);
        background-image: -webkit-gradient(linear, left top, right top, color-stop(0, #7ac0da), color-stop(1, #a4d4e6));
        background-image: -webkit-linear-gradient(left, #7ac0da 0%, #a4d4e6 100%);
        background-image: linear-gradient(left, #7ac0da 0%, #a4d4e6 100%);
        color: #3e5667;
        padding: 20px 40px 30px 40px;
    }

        .featured hgroup.title h1, .featured hgroup.title h2 {
            color: #fff;
        }

        .featured p {
            font-size: 1.1em;
        }

/* page titles */
hgroup.title {
    margin-bottom: 10px;
}

hgroup.title h1, hgroup.title h2 {
    display: inline;
}

hgroup.title h2 {
    font-weight: normal;
    margin-left: 3px;
}

/* features */
section.feature {
    width: 300px;
    float: left;
    padding: 10px;
}

/* ordered list */
ol.round {
    list-style-type: none;
    padding-left: 0;
}

    ol.round li {
        margin: 25px 0;
        padding-left: 45px;
    }

        ol.round li.zero {
            background: url("../Images/orderedList0.png") no-repeat;
        }

        ol.round li.one {
            background: url("../Images/orderedList1.png") no-repeat;
        }

        ol.round li.two {
            background: url("../Images/orderedList2.png") no-repeat;
        }

        ol.round li.three {
            background: url("../Images/orderedList3.png") no-repeat;
        }

        ol.round li.four {
            background: url("../Images/orderedList4.png") no-repeat;
        }

        ol.round li.five {
            background: url("../Images/orderedList5.png") no-repeat;
        }

        ol.round li.six {
            background: url("../Images/orderedList6.png") no-repeat;
        }

        ol.round li.seven {
            background: url("../Images/orderedList7.png") no-repeat;
        }

        ol.round li.eight {
            background: url("../Images/orderedList8.png") no-repeat;
        }

        ol.round li.nine {
            background: url("../Images/orderedList9.png") no-repeat;
        }

/* content */
article {
    float: left;
    width: 70%;
}

aside {
    float: right;
    width: 25%;
}

    aside ul {
        list-style: none;
        padding: 0;
    }

        aside ul li {
            background: url("../Images/bullet.png") no-repeat 0 50%;
            padding: 2px 0 2px 20px;
        }

.label {
    font-weight: 700;
}

/* login page */
/*#loginForm {
    border-right: solid 2px #c8c8c8;
    float: left;
    width: 55%;
}

    #loginForm .validation-error {
        display: block;
        margin-left: 15px;
    }

    #loginForm .validation-summary-errors ul {
        margin: 0;
        padding: 0;
    }

    #loginForm .validation-summary-errors li {
        display: inline;
        list-style: none;
        margin: 0;
    }

    #loginForm input {
        width: 250px;
    }

    #loginForm input[type="checkbox"],
    #loginForm input[type="submit"],
    #loginForm input[type="button"],
    #loginForm button {
        width: auto;
    }*/

#socialLoginForm {
    margin-left: 40px;
    float: left;
    width: 40%;
}

    #socialLoginForm h2 {
        margin-bottom:  5px;
    }

#socialLoginList button {
    margin-bottom: 12px;
}

#logoutForm {
    display: inline;
}

/* contact */
.contact h3 {
    font-size: 1.2em;
}

.contact p {
    margin: 5px 0 0 10px;
}

.contact iframe {
    border: 1px solid #333;
    margin: 5px 0 0 10px;
}

/* forms */
fieldset {
    border: none;
    margin: 0;
    padding: 0;
}

    fieldset legend {
        display: none;
    }

    fieldset ol {
        padding: 0;
        list-style: none;
    }

        fieldset ol li {
            padding-bottom: 5px;
        }

label {
    display: block;
    font-size: 1.2em;
    font-weight: 600;
}

label.checkbox {
    display: inline;
}

input, textarea {
    border: 1px solid #e2e2e2;
    background: #fff;
    color: #333;
    font-size: 1.2em;
    margin: 5px 0 6px 0;
    padding: 5px;
    width: 300px;
}

textarea {
    font-family: inherit;
    width: 500px;
}

    input:focus, textarea:focus {
        border: 1px solid #7ac0da;
    }

    input[type="checkbox"] {
        background: transparent;
        border: inherit;
        width: auto;
    }

    input[type="submit"],
    input[type="button"],
    button {
        background-color: #d3dce0;
        border: 1px solid #787878;
        cursor: pointer;
        font-size: 1.2em;
        font-weight: 600;
        padding: 7px;
        margin-right: 8px;
        width: auto;
    }

    td input[type="submit"],
    td input[type="button"],
    td button {
        font-size: 1em;
        padding: 4px;
        margin-right: 4px;
    }

/* info and errors */
.message-info {
    border: 1px solid;
    clear: both;
    padding: 10px 20px;
}
.message-infolog {
    border: 1px solid;
    clear: both;
    padding: 3px 7px;
    color-rendering:optimizeQuality;
    border-color:#3e5667;
}

.message-error {
    clear: both;
    color: #e80c4d;
    font-size: 1.1em;
    font-weight: bold;
    margin: 20px 0 10px 0;
}

.message-success {
    color: #7ac0da;
    font-size: 1.3em;
    font-weight: bold;
    margin: 20px 0 10px 0;
}

.error {
    color: #e80c4d;
}

/* styles for validation helpers */
.field-validation-error {
    color: #e80c4d;
    font-weight: bold;
}

.field-validation-valid {
    display: none;
}

input.input-validation-error {
    border: 1px solid #e80c4d;
}

input[type="checkbox"].input-validation-error {
    border: 0 none;
}

.validation-summary-errors {
    color: #e80c4d;
    font-weight: bold;
    font-size: 1.1em;
}

.validation-summary-valid {
    display: none;
}


/* tables
----------------------------------------------------------*/
table {
    border-collapse: collapse;
    border-spacing: 0;
    margin-top: 0.75em;
    border: 0 none;
}

th {
    font-size: 1.2em;
    text-align: left;
    border: none 0px;
    padding-left: 0;
}

    th a {
        display: block;
        position: relative;
    }

    th a:link, th a:visited, th a:active, th a:hover {
        color: #333;
        font-weight: 600;
        text-decoration: none;
        padding: 0;
    }

    th a:hover {
        color: #000;
    }

    th.asc a, th.desc a {
        margin-right: .75em;
    }

    th.asc a:after, th.desc a:after {
        display: block;
        position: absolute;
        right: 0em;
        top: 0;
        font-size: 0.75em;
    }

    th.asc a:after {
        content: '▲';
    }

    th.desc a:after {
        content: '▼';
    }

td {
    padding: 0.25em 2em 0.25em 0em;
    border: 0 none;
}

tr.pager td {
    padding: 0 0.25em 0 0;
}


/********************
*   Mobile Styles   *
********************/
@media only screen and (max-width: 850px) {

    /* header
    ----------------------------------------------------------*/
    header .float-left,
    header .float-right {
        float: none;
    }

    /* logo */
    header .site-title {
        margin: 10px;
        text-align: center;
    }

    /* login */
    #login {
        font-size: .85em;
        margin: 0 0 12px;
        text-align: center;
    }

        #login ul {
            margin: 5px 0;
            padding: 0;
        }

        #login li {
            display: inline;
            list-style: none;
            margin: 0;
            padding: 0;
        }

        #login a {
            background: none;
            color: #999;
            font-weight: 600;
            margin: 2px;
            padding: 0;
        }

        #login a:hover {
            color: #333;
        }

    /* menu */
    nav {
        margin-bottom: 5px;
    }

    ul#menu {
        margin: 0;
        padding: 0;
        text-align: center;
    }

        ul#menu li {
            margin: 0;
            padding: 0;
        }


    /* main layout
    ----------------------------------------------------------*/
    .main-content,
    .featured + .main-content {
        background-position: 10px 0;
    }

    .content-wrapper {
        padding-right: 10px;
        padding-left: 10px;
    }

    .featured .content-wrapper {
        padding: 10px;
    }

    /* page content */
    article, aside {
        float: none;
        width: 100%;
    }

    /* ordered list */
    ol.round {
        list-style-type: none;
        padding-left: 0;
    }

        ol.round li {
            padding-left: 10px;
            margin: 25px 0;
        }

            ol.round li.zero,
            ol.round li.one,
            ol.round li.two,
            ol.round li.three,
            ol.round li.four,
            ol.round li.five,
            ol.round li.six,
            ol.round li.seven,
            ol.round li.eight,
            ol.round li.nine {
                background: none;
            }

     /* features */
     section.feature {
        float: none;
        padding: 10px;
        width: auto;
     }

        section.feature img {
            color: #999;
            content: attr(alt);
            font-size: 1.5em;
            font-weight: 600;
        }

    /* forms */
    input {
        width: 90%;
    }

    /* login page */
    #loginForm {
        border-right: none;
        float: none;
        width: auto;
    }

        #loginForm .validation-error {
            display: block;
            margin-left: 15px;
        }

    #socialLoginForm {
        margin-left: 0;
        float: none;
        width: auto;
    }


    /* footer
    ----------------------------------------------------------*/
    footer .float-left,
    footer .float-right {
        float: none;
    }

    footer {
        text-align: center;
        height: auto;
        padding: 10px 0;
    }

        footer p {
            margin: 0;
        }
}

I will appreciate any help and Subjection! Thanks

I want to send email through my ASP.Net application without hardcoding NetworkCredentials or senders password. For suppose i want to have a query form on my web application where an anonymous user can send email to admin without being logged in on his gmail account. Can anyone help. I need to use Razor View and C# Thanks in advance

I try to make a link look like a bootstrap button, where I use asp.net razor templating language where I give the link a class of btn only. I got my inspiration from this question: How to make <a href=""> link look like a button? Yet I don't get my gray formatted button. Here is my code:

<a class="btn" href="@Url.Action("viewList","PMGLists",new { id =this.Request.QueryString["pmgID"] })"><span class="glyphicon glyphicon-circle-arrow-left"></span> Back to PMG List</a>

And this is what I get when my so called button / link is rendred. Screenshot of 2 buttons

Does anyone know what am I missing here...

I have a WebForms page that is used for collecting personal data, and among other things I need to check if an email entered by user already exists in the database, and I need to check that from the client side (this is the first step of a multi-step form, and postback is triggered only when all steps are completed).

I opted to call a WCF method from the client validation function, like this:

Control:

<asp:TextBox ID="EmailAddressTextBox" runat="server"/>
<asp:CustomValidator ValidationGroup="Personal" ID="EmailExistsVal" runat="server" 
    ControlToValidate="EmailAddressTextBox" ErrorMessage="Email already exists" 
    ClientValidationFunction="EmailExistsVal_Validate"/>

Submit button:

<input type="button" value="Go" onclick="Page_ClientValidate('Personal'); return false;" />

Validation function:

    function EmailExistsVal_Validate(sender, args) {
        $.get('Service.svc/CheckEmail?email=' + $('#<%=EmailAddressTextBox.ClientID%>').val(), null, null, 'json')
            .success(function (data, textStatus, xhr) {
                args.IsValid = data.AlreadyExists === false; 
            })
            .error();
    }

The problem is that it executes in the wrong order. When the button click triggers the validation, the ajax request in the custom validation executes when Page_ClientValidate is called (which is expected), the service method works like charm, but the response from gets back AFTER Page_ClientValidate is completed (which is, come to think of it, also expected - this is an async call).

One possible fix is to make the $.get call synchronous, like here: https://stackoverflow.com/a/5641995/1202275, but I wonder if there is a more elegant solution. Or is the whole setup wrong and I shoudn't be doing it like that?

I am making a site and want to make "login with facebook" and "login with google" and save the credential in mssql database . How can this be done ? Please help.

I need to help you. I am gonna be crazy because of that problem. I want to show a certain amount of news on a page. Any guys can help me on my problem ? I have tried to fix it but i could not :/ There is my codes. can anyone edit please ? Thank you and sorry for my english. My english is so bad :D .

 <%@ Page Title="" Language="C#" MasterPageFile="~/biribenibitirsin.Master" AutoEventWireup="true" CodeBehind="Blog.aspx.cs" Inherits="biribenibitirsin.Blog" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <asp:Literal ID="ltrl_meta_ek" runat="server"></asp:Literal>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div class="col-xl-12 col-lg-12 col-md-12 col-sm-12 col-xs-12" style="padding-bottom: 70px;">
        <div class="row" >

            <asp:Panel runat="server" ID="pnlAll">
                <asp:Repeater ID="rpt_blog_baslik" runat="server"  OnItemCommand="rpt_blog_baslik_paging">
                    <ItemTemplate>
                        <div class="ikinci_yol col-lg-4 col-xl-4 col-md-6 col-sm-12 col-xs-12">
                            <br />
                            <a href="<%# blogicerikmodal(Eval("ID").ToString()) %>" style="font-weight: bold; color: black; font-family: sans-serif; font-size: 21px; text-transform: uppercase; text-decoration: none;"><%# Eval("BASLIK").ToString()%>  </a>
                            <br />
                            <br />
                            <%#Eval("ICERIK") %>
                        </div>
                    </ItemTemplate>
                </asp:Repeater>
            </asp:Panel>
        </div>
        <div class="clearfix"></div>
        <asp:Panel runat="server" ID="pnlSingle" Visible="false">
            <asp:Repeater ID="rpt_blog_icerik" runat="server">
                <ItemTemplate>
                    <div class="blog_icerik_baslik col-lg-12 col-md-12 col-sm-12 col-xs-12">
                        <h1><%# Eval("BASLIK") %> </h1>
                    </div>
                    <div class="blog_icerik">
                        <%#Eval("ICERIK") %>
                        <br />
                        <br />
                        <br />
                        <div class="blog_icerik_etiket col-lg-12 col-md-12 col-sm-12 col-xs-12">ETİKET :  <%# Eval("ETIKET") %> </div>
                    </div>
                    <div class="blog_icerik_tarih col-lg-12 col-md-12 col-sm-12 col-xs-12">Yayımlanma Tarihi: <%# Eval("TARIH") %></div>
                </ItemTemplate>
            </asp:Repeater>
        </asp:Panel>
    </div>
</asp:Content>

and here my code behind:

   using System;
     using System.Collections.Generic;
     using System.Linq;
     using System.Web;
     using System.Web.UI;
     using System.Web.UI.WebControls;
     using biribenibitirsin.classes;
     using System.Data;
     using System.Data.SqlClient;

     namespace biribenibitirsin
     {
    public partial class Blog : System.Web.UI.Page
    {
        DBconn db = new DBconn();

        protected void Page_Load(object sender, EventArgs e)
        {

            if (!Page.IsPostBack)
            {

                string id2;
                id2 = Request.QueryString["id"];

                if (Request.QueryString["id"] != null)
                {
                    if (db.numeric_check_security(Request.QueryString["id"].ToString()))
                    {
                        blog_icerik_al(id2);
                        pnlSingle.Visible = true;
                        pnlAll.Visible = false;
                    }
                    else
                    {
                        Response.Redirect("~/");
                    }
                }
                else
                {
                    blog_basliklari_ekle();
                    pnlSingle.Visible = false;
                    pnlAll.Visible = true;
                }
            }
        }
        public void blog_icerik_al(string id)
        {
            if (!string.IsNullOrEmpty(id))
            {
                DataTable dt = db.GetTable("select * from BLOG_ICERIK Where ID=" + id);
                dt.Rows[0]["ETIKET"].ToString();
                dt.Rows[0]["BASLIK"].ToString();
                dt.Rows[0]["TARIH"].ToString();
                //DataTable dt_blog = blogicerik_al(dt);

                //if (dt_blog.Rows[0]["ID"].ToString() != "")
                //{
                //    dt_blog.Rows[0]["ID"] = "<div class=\"col-lg-12 col-md-12 col-sm-12 col-xs-12\">" + dt_blog.Rows[0]["ICERIK"] + "</div>";
                //}

                rpt_blog_icerik.DataSource = dt;
                rpt_blog_icerik.DataBind();
            }
        }
        private DataTable blogicerik_al(DataTable dt)
        {
            DataTable dt_liste = createdatabase(dt);
            return dt;
        }

        public void blog_basliklari_ekle()
        {
            DataTable dt = db.GetTable("select * from BLOG_ICERIK WHERE  DELETED = 0 And AKTIF = 1  order by SIRA");
            DataTable dt_icerik = icerikleri_ayarla(dt);

            for (int i = 0; i < dt_icerik.Rows.Count; i++)
            {
                if (dt_icerik.Rows[i]["BASLIK"].ToString() != "")
                {
                    dt_icerik.Rows[i]["ICERIK"] = "<div class=\"col-lg-12 col-md-12 col-sm-12 col-xs-12\">" + dt_icerik.Rows[i]["BASLIK"].ToString() + "</div>";

                }
            }
            //----------------------------------------------



            rpt_blog_baslik.DataSource = dt; // dt_icerik;
            rpt_blog_baslik.DataBind();
        }

        public DataTable icerikleri_ayarla(DataTable dt_icerik)
        {
            DataTable dt_liste = createdatabase(dt_icerik);

            return dt_liste;
        }

        public DataTable createdatabase(DataTable dt_icerik)
        {
            DataTable dt_liste = new DataTable();
            dt_liste.Columns.Add("ID");
            dt_liste.Columns.Add("BASLIK");
            dt_liste.Columns.Add("ICERIK");
            dt_liste.Columns.Add("ETIKET");
            dt_liste.Columns.Add("TARIH");
            dt_liste.Columns.Add("SIRA");
            for (int i = 0; i < dt_icerik.Rows.Count; i++)
            {
                DataRow dt_liste_DataRow = dt_liste.NewRow();
                dt_liste_DataRow["ID"] = dt_icerik.Rows[i]["ID"].ToString();
                dt_liste_DataRow["BASLIK"] = dt_icerik.Rows[i]["BASLIK"].ToString();
                dt_liste_DataRow["ICERIK"] = dt_icerik.Rows[i]["ICERIK"].ToString();
                dt_liste_DataRow["ETIKET"] = dt_icerik.Rows[i]["ETIKET"].ToString();
                dt_liste_DataRow["TARIH"] = dt_icerik.Rows[i]["TARIH"].ToString();
                dt_liste_DataRow["SIRA"] = dt_icerik.Rows[i]["SIRA"].ToString();
                dt_liste.Rows.Add(dt_liste_DataRow);
            }
            return dt_liste;

        }

        public string blogicerikmodal(string haberid)
        {
            return "/Blog.aspx?id=" + haberid;
        }
    }
    }

We have a situation with with our MSSQL DataBase backups. Data: 1. Actually our DBA has set backups of Website DBs every 4 hours. 2. So the backup of each website DB is created every 4 hours and it contains 4 files (with .bak) extension. 3.Folder hierarchy of these backup files are as follows: \folder\sub-folder(4 X Files).bak

PROBLEM we have is that we have to check in each "sub-folder" if the 4(four) .bak files are created after every four 4 hours manually.

Can somebody help with the creation of the powershell script which can :

  1. Generate the list of the Websites (subfolder name) in which 4 new files are not created for the latest timestamp.
  2. Email us the list

Thanks in advance.

Saeed

I would like to return text label in my gridview with Jquery

 <div class="risksContainer">
        <div class="risksGrid">
            <asp:GridView ID="GridViewRisks"
                runat="server" 
        [...]
        />
                <Columns> 
                    <asp:TemplateField HeaderText="...">
                        <ItemTemplate>
                            <div class="CodeProductColumn">
                                <asp:Label ID="IDRisk" runat="server" CssClass="IDRiskIndex" Text="<%# Item.ID_Risk %>" />
                                <asp:Repeater ID="LabelRepeatCodeProduct" runat="server"
                                [....]
                                </asp:Repeater>
                            </div>
            </ItemTemplate>

I try many solutions, but i don't know how i get the label Text of my selected row. javascript :

function blabla(){
 var Id_risk = $(".risksContainer .risksGrid .IDRiskIndex").text();
 alert("Id_risk =" + Id_risk );
 return Id_risk ;
}

(this function start when i click on edit button in my row)

I get text of all rows in my gridview and not only my selected row. I try with "parent, child, first, selected, rows[]... I am beginner and i'm desperate to find it

I want to send email through my ASP.Net application without hardcoding NetworkCredentials or senders password. For suppose i want to have a query form on my web application where an anonymous user can send email to admin without being logged in on his gmail account. Can anyone help. I need to use Razor View and C# Thanks in advance

I have a silverlight video player which gets initialized through C# code. Is there a way to initialize it through JavaScript. I tried to set it through WebMethod but as InitParam can not be static hence in vain. How can I do that?

  <div id="silverlightControlHost" style="height: 200px; width: 40%; margin-top: -5%;">
            <object data="data:application/x-silverlight-2," type="application/x-silverlight-2" id="silverObject" width="450px" height="332px">
                <param name="source" value="ClientBin/VideoPlayer.xap" />
                <param name="onError" value="onSilverlightError" />
                <param name="background" value="white" />
                <param name="minRuntimeVersion" value="2.0.31005.0" />
                <param name="autoUpgrade" value="true" />
                <param name="onLoad" value="pluginLoaded" />
                <param name="initparams" id="initParams" runat="server" value="" />
                <a href="/Exe/Silverlight.exe" style="text-decoration: none">
                    <%--  <img src="/img/SLMedallion_ENU.png" alt="Get Microsoft Silverlight" style="border-style: none" />--%>
                </a>
            </object>
            <iframe id="_sl_historyFrame" style="visibility: hidden; height: 0px; width: 0px; border: 0px"></iframe>
        </div>

And here is the script I am trying to set the parameter with

 var slCtl = null;
    function pluginLoaded(sender, args) {
        slCtl = sender.getHost();
        alert(JSON.stringify(slCtl));
    }

    function a() {
        slCtl.Content.JS.PlayVideo(8, 0, 'vm')
    }

    function onSilverlightError(sender, args) {
        var appSource = "";
        if (sender != null && sender != 0) {
            appSource = sender.getHost().Source;

        }

        var errorType = args.ErrorType;
        var iErrorCode = args.ErrorCode;

        //            if (errorType == "ImageError" || errorType == "MediaError") {
        //                return;
        //            }

        var errMsg = "Unhandled Error in Silverlight Application " + appSource + "\n";

        errMsg += "Code: " + iErrorCode + "    \n";
        errMsg += "Category: " + errorType + "       \n";
        errMsg += "Message: " + args.ErrorMessage + "     \n";

        if (errorType == "ParserError") {
            errMsg += "File: " + args.xamlFile + "     \n";
            errMsg += "Line: " + args.lineNumber + "     \n";
            errMsg += "Position: " + args.charPosition + "     \n";
        }
        else if (errorType == "RuntimeError") {
            if (args.lineNumber != 0) {
                errMsg += "Line: " + args.lineNumber + "     \n";
                errMsg += "Position: " + args.charPosition + "     \n";
            }
            errMsg += "MethodName: " + args.methodName + "     \n";
        }

        //throw new Error(errMsg);
    }


    $('#next').click(function () {
   slCtl.InitParams = "vm=3,am=0,type=prev";

});

I need to streaming audio-file from server, which wrote on С# and use WEB API2, to IOS- and Android- client. Maybe somebody know a good library for this or specialize protocol and good format with codec?

Thanks for your answers!

I'm trying to turn rows into columns, but the way I'm currently doing is very uneffective. I'd like to find a method to do this that's doesn't require me to turn every thing into a subquery. This is what I'm currently using:

select h.request_id, h.SAMPLES_DATE, h.SAMPLES_TIME, h.parent_area_name, h.area_name, h.point_name, h.oblastname,
unistr((select r.measured_result from lab_requests_requrements r where r.request_id=h.request_id and r.requirement_id = 51)) wr51,
unistr((select r.measured_result from lab_requests_requrements r where r.request_id=h.request_id and r.requirement_id = 131)) wr131,
unistr((select r.measured_result from lab_requests_requrements r where r.request_id=h.request_id and r.requirement_id = 143)) wr143
from lab_requests_head_view h
where h.water_type_id = 3 and h.water_type = 2
order by h.request_number

I've got more than 300 different requirements and I need to write a subquery for each one. Is there a way to just pivot these so it can be more dynamic?

Something weird is happening in my ASP.NET MVC app.I'm using Identity framework in my web app.

In main page I have a link to Login page and when I click on it, browser goes to /Account/Login which is correct

In login page, I have a link to direct user to registration page and browser correctly takes me to /Account/Register

In Registration page I have 2 links. One for going back to login page which works correctly and the other should take me to a different registration page. the URL is /Account/RegisterAffiliate. when I click on this link, browser takes me to Home page instead of going to /Account/RegisterAffiliate. The weird thing is however browser shows the home page, the URL in the address bar is Account/RegisterAffiliate

Now, looks like the address of my home page is changed to Account/RegisterAffiliate, because from now on, this is added to all the other link, for example, login page is now showing /Account/RegisterAffiliate/Account/Login

I don't know what happened to my project that messed up the links.

Important Note

Even if I directly navigate to localhost/Account/RegisterAffiliate from Home page the problem happens. Looks like after navigating to localhost/Account/RegisterAffiliate it becomes my home page url.