i am using oracle.dataaccess.dll Version=4.112.2.0

Problem: oracle.dataaccess.dll.refresh does not exist in file location.

what i tried:

1) i went to visual studio 2012 > solution> manage nugetpackage but i cannot find the .dll with the same version as listed.

2)

Warning 21 Unable to update auto-refresh reference 'oracle.dataaccess.dll'. Cannot find assembly 'G:\Working autoCR CFG edit \app\product\11.2.0\client_1\odp.net\bin\4\Oracle.DataAccess.dll'. G:\Working autoCR CFG edit \myVS2012WebApps\AutoCR\Bin\oracle.dataaccess.dll.refresh

i created that above file path within my folder, and copy the .dll from my c:// and pasted onto my created file path. but it is still giving me that warning.

is there something i am doing wrong? what should i do?

So in my ASP.NET MVC application I have a view with a dropdown list with multiple values. Basically I want to be able to call a different JS function for each selected value.

Model:

[Display(Name = "Rate")]
public string Rate { get; set; }

Here's my view:

List<SelectListItem> rate = new List<SelectListItem>();
    rate.Add(new SelectListItem
    {
        Value = "1",
        Text = "1 Rate",
    });

    rate.Add(new SelectListItem
    {
        Text = "2 Rates",
        Value = "2"
    });
    rate.Add(new SelectListItem
    {
        Text = "3 Rates",
        Value = "3",
    });
    rate.Add(new SelectListItem
    {
        Text = "4 Rates",
        Value = "4"
    });
    rate.Add(new SelectListItem
    {
        Text = "5 Rates",
        Value = "5"
    });

}
    <div class="form-group">
            @Html.LabelFor(model => model.Rate, htmlAttributes: new { @class = "control-label text-left " })
            <div class="">
                @if (Model != null)
                {
                    @Html.DropDownListFor(model => rate,
                        new SelectList(rate, "Text", "Value", Model.Rate),
                        "Vælg rate",
                        new { @class = "form-control", required = "required"})
                }
                else
                {
                    @Html.DropDownListFor(model => rate,
                        new SelectList(rate, "Text", "Value"),
                        "Vælg rate",
                        new { @class = "form-control", required = "required" })
                }
            </div>
        </div>

I am not sure where exactly to add my js function. I tried stuff like adding "onchange" or "onclick" but they do not work.

I'm using Amazon API to generate request for ItemLookup. After signing the request I got a url:

http://webservices.amazon.com/onca/xml?AWSAccessKeyId=[AccessKey]&AssociateTag=[AssociateTag]&ItemId=B06XBCY6DW&Operation=ItemLookup&ResponseGroup=Images%2CItemAttributes%2COffers%2CReviews&Service=AWSECommerceService&Timestamp=2050-02-13T12:00:00Z&Version=2016-02-12&Signature=[Signature]

Which I use in browser and I can see nice xml with item's data, but When I try to get that data with c# I get error

The Uri parameter must be a file system relative or absolute path.

The method I'm using to get data is:

var itemXml = XElement.Load(url);

How can I get that xml in c#??

First I want to prefix this with that I am really new to C#, so any advice on best practices or issues with my current implementation is welcome.

I am trying to add slugs to a few domains in my system. The two domains are Talk and Speaker and the challenge I am trying to figure out is that for my Talk domain I want to slugify the name property and for Speaker I want to slugify the full name property. I created an ISluggable interface to use in my database context to determine which tables to run the slugify code.

using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.ChangeTracking;
using System;
using Conferency.Domain;
using Slugify;

namespace Conferency.Data
{
    public class ConferencyContext: DbContext
    {
        public DbSet<Talk> Talks { get; set; }
        public DbSet<Speaker> Speakers { get; set; }
        public DbSet<Conference> Conferences { get; set; }
        public DbSet<ConferenceSpeaker> ConferenceSpeakers { get; set; }
        public DbSet<SpeakerTalk> SpeakerTalks { get; set; }

        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            modelBuilder.Entity<SpeakerTalk>()
                .HasKey(s => new { s.SpeakerId, s.TalkId });

            modelBuilder.Entity<ConferenceSpeaker>()
                .HasKey(s => new { s.SpeakerId, s.ConferenceId });

            modelBuilder.Entity<Speaker>()
                .Property(b => b.Slug)
                .IsRequired();

            modelBuilder.Entity<Talk>()
               .Property(b => b.Slug)
               .IsRequired();

            base.OnModelCreating(modelBuilder);
        }

        public override int SaveChanges()
        {
            this.timestamps();
            this.slugify();

            return base.SaveChanges();
        }

        private void slugify()
        {
            foreach (EntityEntry<ISluggable> entry in ChangeTracker.Entries<ISluggable>())
            {
                this.addSlug(entry);
            }
        }

        private void timestamps()
        {
            foreach (EntityEntry<IAuditable> entry in ChangeTracker.Entries<IAuditable>())
            {
                this.addTimestamps(entry);
            }
        }

        private void addSlug(EntityEntry<ISluggable> entry)
        {
            if (entry.State == EntityState.Added)
            {
                SlugHelper helper = new SlugHelper();

                // Figure out which domain is used and pull property off
                string slug = helper.GenerateSlug("");
                entry.Property("Slug").CurrentValue = slug;
            }
        }

        private static bool hasProperty()

        private void addTimestamps(EntityEntry<IAuditable> entry)
        {
            DateTime now = DateTime.UtcNow;
            if (entry.State == EntityState.Added)
            {
                entry.Property("CreatedAt").CurrentValue = now;
                entry.Property("ModifiedAt").CurrentValue = now;
            }
            else if (entry.State == EntityState.Modified)
            {
                entry.Property("ModifiedAt").CurrentValue = now;
            }
        }

        protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
        {
            base.OnConfiguring(optionsBuilder);

            optionsBuilder.UseSqlServer("Data Source=(localdb)\\MSSQLLocalDB;Database=ConferencyData;Integrated Security=True;Connect Timeout=30;Encrypt=False;TrustServerCertificate=True;ApplicationIntent=ReadWrite;MultiSubnetFailover=False");
        } 
    }
}

You see I have an addSlug method which is where I am a bit stuck. How can I determine if my EntityEntry is of type Talk or Speaker to determine which property to pass to helper.generateSlug and also once I know which property, how can I pull it off the EntityEntry.

Please let me know if any information is needed and thanks in advanced!

I am new to ASP.Net Core and I am looking to send confirmation emails when a user registers from a gmail account. I used the same gmail account in a project in VS13 and had great success. Now however I cannot manage to send. There are no errors, just no emails are appearing in my sent box.

 public async Task SendEmailAsync(string email, string subject, string message)
    {
        var emailMessage = new MimeMessage();

        emailMessage.From.Add(new MailboxAddress("Rentals Rated", "5.5MenCS6@gmail.com"));

        emailMessage.To.Add(new MailboxAddress("", email));
        emailMessage.Subject = subject;
        emailMessage.Body = new TextPart("plain") { Text = message };

        using (var client = new SmtpClient())
        {
            var credentials = new NetworkCredential
            {
                UserName = "********@gmail.com", 
                Password = "******" 
            };
      //      client.LocalDomain = "gmail.com";
            await client.ConnectAsync("smtp.gmail.com", 587, SecureSocketOptions.Auto).ConfigureAwait(false);
            await client.AuthenticateAsync(credentials);
            await client.SendAsync(emailMessage).ConfigureAwait(false);
            await client.DisconnectAsync(true).ConfigureAwait(false);
        }
    }

^Is my current attempt

in VS13, this was my working code. Not overly relevant to the question but might spark ideas. Thanks!

public static void sendEmail(string email, string emailSubject, string emailBody, string firstName)
    {
        MailAddress fromAddress = new MailAddress("*****@gmail.com", "****");
        MailAddress toAddress = new MailAddress(email, firstName);
        const string fromPassword = "*******";

        SmtpClient smtp = new SmtpClient();
        smtp.Host = "smtp.gmail.com";
        smtp.Port = 587;
        smtp.EnableSsl = true;
        smtp.DeliveryMethod = SmtpDeliveryMethod.Network;
        smtp.UseDefaultCredentials = false;
        smtp.Credentials = new System.Net.NetworkCredential(fromAddress.Address, fromPassword);

        MailMessage message = new MailMessage(fromAddress, toAddress);
        message.Subject = emailSubject;
        message.Body = emailBody;
        smtp.Send(message);
    }

Hello I'm relatively new to coding. I'm trying to teach myself how to do this but I've gotten stuck. I have a drop down list populated from a .mdf server, I'm trying to save the selected value from the drop down list to a spot on a stack of size 4, or maybe a list, I'm not sure which would be better when later in this thing I'm making, I want to make sure the selected items don't conflict with one another, how would I do this? I've tried it like this but Visual studio doesn't like it

protected void Button1_Click(object sender, EventArgs e)
    {
   Stack<string> st = new Stack<string>(4); //I think this gives me a stack limit of 4?
   st.Push(ddl.SelectedValue.ToString());
lbl=st.ToString();

        }

I'm trying my best to understand how to do this stuff and thought it would be simple, but it is not simple for a beginner! Essentially what I want to do is, every time you select a thing from the drop down list, you click the submit button and it puts it onto the stack(or a list if you think that is better to use!) and shown on a label. I've tried similar methods to the above method and it only adds it once to the stack to the first spot in other methods. Thanks for anyone who can answer!

I'm making a post request from on view so that I don't see the parameters on the URL and I can tell it is passing the appropriate parameters to controller for the request but it does not display the appropriate view from that controller.

Calling view

            @Ajax.ActionLink("Work1", "NewIndex", "WorkItems",
            new
            {
                eventCommand = "createforrig",
                //eventArgument1 = @item.Id,
                eventArgument2 = @item.Id
            },
            new AjaxOptions
            {
                HttpMethod = "POST"
            })

WorkItems Controller method

    [HttpPost]
    public ActionResult NewIndex(NewWorkItemViewModel vm)
    {
        vm.IsValid = ModelState.IsValid;
        vm.HandleRequest();

        if (vm.IsValid)
        {
            // NOTE: Must clear the model state in order to bind
            //       the @Html helpers to the new model values
            ModelState.Clear();
        }
        else
        {
            foreach (KeyValuePair<string, string> item in vm.ValidationErrors)
            {
                ModelState.AddModelError(item.Key, item.Value);
            }
        }

        return View(vm);  
    }

Putting a breakpoint on the last Return View(vm) confirms it is being called but the browsers does not update to display the workItems view.

Suggestions on why the browser is not being updated to display the appropriate view.

I am working on asp.net core project. I have created a model with its attribute and also have created a key in the model. When I am trying to scaffold using the entity framework which adds controller and view I am getting error. Please find the error attached with this question.

Error Image

Not sure if this is even possible, but I am working in ASP.NET 4.5+ and would like to achieve the following.

I have a sample URL that I am testing with locally that reads:

http://localhost:5000/search/?page=1&count=15&sort=0&fType=tags&fValue=Tablecloths+%26+Tablecloth+Sets&Categories=EVENTS&landingPageType=1

Instead of ampersands and equal signs to delimit query string parameters/key-value pairs, I would like the URL to be restructured as follows:

http://localhost:5000/search/?page/1/count/15/sort/0/fType/tags/fValue/Tablecloths+%26+Tablecloth+Sets/Categories/EVENTS/landingPageType/1

Essentially, what will happen when this URL is hit is that it will be rewritten behind the scenes to match the former URL. The goal is to boost ranking by structuring my URLs to be more SEO-friendly.

The sample URL mentioned above will only apply to the /search route BUT may have a variable number of URL query parameters. When the url string is split on the '/', the odd tokens will always be a key and the even tokens will always be a value. (eg. /search/?{key}/{value}/{key}/{value})

Any help would be appreciated, thanks.

I have a problem with passing data to action method. I created action link in my view in the way shown below:

@model ComplexModel

...

<a href=@Url.Action( "ComplexAction", "ComplexController", new { complex= @Model, str = "string" } )
class="ui-btn">!!!Change all</a>

And action method with to get all passed parameters:

public ActionResult ComplexAction( ComplexModeloAufgabeViewModel complex, string str )
{
    return View();
}

String is passed correctly, but complex model is allways null. What is happening here?

//Here Is The Code in which u can see that i had used an iframe but i want to use the same link to play in different player is it possible

 <div id="v1">
        @*<video style="height:400px;width:600px;" autoplay="autoplay" >
                <source src="~/Content/IdentiSure Design Example.mp4" type="video/mp4" id="tv_main_channel" />
            </video>*@
        **<iframe width="600" height="400" src="https://www.youtube.com/embed/Wfql_DoHRKc?autoplay=1&modestbranding=1&controls=0" frameborder="0" allowfullscreen></iframe>**
        <div id="myProgress">
            <div id="myBar"></div>
        </div>
    </div>

    <div id="v2" style="display:none;">
        <video style="height:400px;width:600px;" controls="controls" autoplay="autoplay" id="vid">
            <source src="~/Content/dummy_video.mp4" type="video/mp4" />
        </video>
    </div>`enter code here`

in visual studio 2013,when i create a viwe for a particular function=>when ever i change anything in view it gives a error in every line.although it is correct. enter image description here

but it is correct means every lines of code is write.every time i need to build the solution to solve the error.its really occurred. i tried to =>

[Instead of it, try to just delete the contents of this directory with Visual Studio closed then reopen it: %LocalAppData%\Microsoft\VisualStudio\14.0\ComponentModelCache]=>found on Razor intellisense not working in VS 2015 but not working for me.

It seems to be a fundamental question, but I could not find the exact answer.

I am passing a char value from Model to View, and in View I need to check whether the char value is null or empty or not.

I have tried the following:

if ("@Model.CharValue" != "\0") {...}

if ("@Model.CharValue" != ' ') {...}

None of them gave me the proper check. and using

alert("@Model.CharValue");

The pop up gave me this character, which I have no idea what it is.

enter image description here

I'm using dropdown with multiple select with groups in my mvc razor page. I'm following below link and using Multiple Select with Groups dropdown.

Harvest Multiselect Dropdown Link

It is working fine if I implement in razor view like below sample:

....
<select data-placeholder="Search option" id="Mainlist[0].SubList" class="chosen-select" multiple tabindex="6" name="MainList[0].SubList">
     <option value=""></option>
     @foreach (var mainListItem in Model.MainList)
     {
          <optgroup label="@mainListItem.Name">
           @foreach (var subListItem in mainListItem.SubList)
           {
               <option id="report">@subListItem.Name</option>
           }
           </optgroup>
      }
</select>
....

Above razor code for chosen dropdown working fine like in below image: razor chosen-select dropdown

But I have a requirement to add more multi select dropdowns on button click event of jquery. I tried below code in jquery:

var newRow =
"<select data-placeholder='Search option' id='Mainlist[1].SubList' class='chosen-select' multiple tabindex='6' name='MainList[1].SubList'>" +
        "<option value=''></option>" +
        "<optgroup label='Main List Item 1'>" +
        "<option id='report'>Sub List Item 1.1</option>" +
        "<option id='report'>Sub List Item 1.2</option>" +
        "</optgroup>" +
        "<optgroup label='Main List Item 2'>" +
        "<option id='report'>Sub List Item 2.1</option>" +
        "<option id='report'>Sub List Item 2.2</option>" +
        "</optgroup>" +
        "</select>";

$('#TestTable tr:last').after(newRow);

First problem is : I can't implement foreach loop in newRow variable. Second one is : If I try to manage whole list manually like above code, then also List is not coming properly like below image: jquery chosen-select dropdown

Any idea what is causing it? and how can I make dropdown working by jquery? or is there any other way to add same dropdown by jquery?

I already tried $(".chosen-select").chosen() from below link:

chosen-select link

I'm using the EvoPDF with which I save HTML to PDF file. The HTML contains long text (can contains lists, tables, etc.). I want to add pages margins, but I don't want to use the pdfConverter.PdfDocumentOptions.{Bottom/Top}Margin - properties, I want to set pages margins into the HTML (something like in Microsoft Word, where I set the page size and margins and text auto move to next page, which has previously set margins). I previewed their Help page, but I couldn't find info about that.

My Convert code is:

        EvoPdf.HtmlToPdf.PdfConverter pdfConverter = new EvoPdf.HtmlToPdf.PdfConverter();
        pdfConverter.LicenseKey = System.Configuration.ConfigurationManager.AppSettings["EvoHtmlToPdfLicence"];
        pdfConverter.PdfDocumentOptions.PdfPageSize = EvoPdf.HtmlToPdf.PdfPageSize.Letter;
        pdfConverter.PdfDocumentOptions.PdfPageOrientation = EvoPdf.HtmlToPdf.PdfPageOrientation.Portrait;
        byte[] pdf = pdfConverter.GetPdfBytesFromHtmlString(htmlText);

Thank you!

In my ASP.net application, I am creating a Text file and writing data to that file. I am saving that file in specified location on the server. This is an intranet application. When I run my application locally using Visual studio.net, I can create/write and save the file to that network location through the application, but when I deployed the application on the server and then I tried to create the file. It says "Access Denied".

I am not sure what extra things, I need to do so that I can Create a Text file and save it to a specified location.

In this application, I am authenticating a group of users who can use this application.

Do I need to take any extra steps to create the file on server location and then save the data to it. Below is my code:

string DirectoryPath = getDirectortyPath();
StreamWriter file = new StreamWriter(DirectoryPath);
file.WriteLine(FullLine);

public string getDirectortyPath(string Year,string  Quarter)
{
    return ConfigurationManager.AppSettings["ReportPath"] + ".txt";
}

Any help will be greatly apprecaited.

In Windows you can display the Calendar in (MMMM yyyy) format.

I would like my <asp:DateTimeControl> to do the same.

I found the DateOnly property to remove the hour/min/sec from the Date, but how can I make this control pick only months in the year ?

very new to this

I have a simple text file with a few rows of numbers - I want to read the values with a button click - In the view :

<input type="button" title="LoadAnswer" value="Click me" id ="btn_run") 
    onclick="location.href='@Url.Action("ReadFromText", "Question1")'" />      
</div>

In the controller:

public ActionResult ReadFromText()
    {           
        return null;
    }

The text file is just in a folder inside my solution ~Docs/Q1InputFile.txt

The values have to read line for line, summed and printed out in a text box / area in the view - Please advise

My ASP.NET-application is generating static files that can then be accessed by the user directly, e.g. https://example.com/usercontent/xyz.pdf

Currently, this is achieved by writing the generated files directly into the phyiscal directory inside the web-application (like D:\Path\To\Webapp\usercontent\xyz.pdf) and let the user access them via the URL. Unfortunately, the directory on the drive is deleted during each deployment of the application. Is it possible to remap URLs containing this folder to another physical location by using the web.config only?

This way, the deployment would not clean it each time it runs.

Greetings!!

I am trying to count total numbers of files have been selected or dropped in file dropbox in AjaxFileUpload controller. It shows on number of files in Queue. I need to access the numbers of files in queue. How could I do that. I am trying to write onchange event for AjaxFileUpload but it's not working which works for ASP File Uploder.

It will be helpful if I get the number of files have been selected on AjaxFileUpload change.

Thanks

I am trying to populate my header with links. I have two dropdowns at the moment. I would like to populate the links using Umbraco and Razor, so nothing is hardcoded. This can be done quite easily (see code below), but populating the dropdowns is the tricky part.

I'm not sure how I would populate the dropdown in a good way. They are not subpages or anything like that, but they are simply dropdowns to make the header less wide. Here's how I populate my header using Razor by grabbing the links in Umbraco:

var home = CurrentPage.Site();

@foreach (var item in home.Children.Where("Visible"))
{
    <li class="@(item.IsAncestorOrSelf(CurrentPage) ? "active" : null)">
        <a href="@item.Url" class="nav-link">@Umbraco.GetDictionaryValue(item.Name)</a>
    </li>
}

home.Children.Where("Visible") is simply grabbing all the child pages, where I have not checked the umbracoNaviHide.

This is currently how my header is created NOT using Umbraco (which I need to populate using the pages from Umbraco):

<nav class="navbar navbar-toggleable-lg navbar-light fixed-top">
  <div class="d-flex align-items-center justify-content-between">
    <button class="navbar-toggler navbar-toggler-left" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
      <span class="navbar-toggler-icon"></span>
    </button>
    <a class="navbar-brand ml-3" href="/en">
      <img src="logo.png" class="logo" alt="logo">
    </a>
  </div>
  <div class="collapse navbar-collapse" id="navbarSupportedContent">
    <ul class="navbar-nav mr-auto justify-content-between full-width">
      <li class="nav-item dropdown">
        <a class="nav-link dropdown-toggle" href id="navbarDropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
          About
        </a>
        <div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
          <a class="dropdown-item" href="#">About Us</a>
          <a class="dropdown-item" href="#">History</a>
        </div>
      </li>
      <li>
        <a href="" class="nav-link">Our Products</a>
      </li>
      <li class="nav-item dropdown">
        <a class="nav-link dropdown-toggle" href id="navbarDropdownMenuLink2" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
          Resources
        </a>
        <div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink2">
          <a class="dropdown-item" href="#">Tips</a>
          <a class="dropdown-item" href="#">News</a>
        </div>
      </li>
      <li>
        <a href="" class="nav-link">Contact Us</a>
      </li>
    </ul>
  </div>
</nav>

This will produce a result like this: https://codepen.io/anon/pen/QvyeRm

I don't want any of the links to be affected by this, as the links or pages doesn't really have anything to do with the header's layout. Here are some example URLs:

/en/about-us/
/en/history/
/en/our-products/
/en/tips/

I hope that makes sense.

Is there a good and easy way to do this?