Questions tagged [net#]

309020 questions
1

votes
5

answer
3.8k

Views

Kendo MVC fire Create method on Update call

I am using Kendo UI Grid with MVC 4 and it works great with only one exception. If I add a row in the grid, and after that update a row, It end up adding a row rather than updating it. What I can tell is that if I press add, the program enters the Create method in my MVC Controller, if I press Updat...
user1106784
1

votes
1

answer
1.6k

Views

Using a validation summary to display label text

I have taken over maintenance of a site that makes calls through a WCF service. There is a validation summary that displays in a message box for some validators on the client-side. I also have a label that fires if any exceptions arise from my web service calls. After tweaking the layout, the label...
Rex_C
1

votes
5

answer
3.6k

Views

Remove (.aspx) extension for Web Form Application

How to remove (.aspx) extension for Web Form Application? In need http://example.com/About instead of http://example.com/About.aspx
user2217261
1

votes
6

answer
5.6k

Views

How to parse Amadeus air ticket file

Amadeus produces AIR file like below for every flight reservation. I need to read reservation number and source and destination airports from this file. I searched Google for "Amadeus air format" but haven't found format description. Wikipedia entry about EDIFACt is a bit different, it does not des...
Andrus
1

votes
3

answer
582

Views

Passing validation errors back to UI

I have an APS.Net application, which is layered - UI-Service-Business-Data Access-Database. When I save or update a user, or example, I create a UserDto object, populate the properties in the UI, and then pass the object down the layers, to a Save method in the data accessor. When it saves, it retur...
Craig
1

votes
4

answer
3.2k

Views

Which block is executed first when we have multiple catch for a single try block? and why?

Go through the below code Example: try { //some code is executing.. //1.some SqlException thrown //2.some FormatException thrown //3. other Exception thrown } catch(SqlException sqlex) { Console.WriteLine("sqlexception is returned"); } catch(FormatException fx) { Console.WriteLine("FormatException i...
Prathap S V Genny
1

votes
2

answer
1.9k

Views

Date parameter in SQL Server stored procedure from ASP.NET

I've written an SQL Server stored procedure that, amongst other things, accepts a date parameter: CREATE PROCEDURE data.addScore ... (some parameters), @testDate date AS On an ASP.NET page I have a textbox with a Calender Extender control (from the AJAX Toolkit) that allows the user to select a date...
Katstevens
1

votes
1

answer
1.9k

Views

Assigning an Outlook Task in C#

I have tried 2 approaches to achieve the end of being able to create and send an Outlook Task, both error out in a way that I am unable to resolve on my own. I'm having trouble creating an Outlook Task using Microsoft Outlook 14.0 Object Library and the How To from MSDN: http://msdn.microsoft.com/e...
ALUM22
1

votes
1

answer
300

Views

How to skip a bootstrapper or ignore fail in Windows 8?

I have a WiX installer and a number of bootstrappers. We recently added SQL LocalDB support and found we needed to package .Net 4.0.2 to get it to work. I am now testing on Windows 8, and find that this patch fails and isn't actually needed for this OS. However, my installer fails because .Net 4.0.2...
Sugrue
1

votes
2

answer
62

Views

Remove the character alone from the string

My code retrieves the data from various resources . And output will be like below UNY4/4/2010 hds04/5/2010 saths04/22/2013 But I want the output like this 4/4/2010 4/5/2010 04/22/2013 Is there any way to do this ?
Sathish K
1

votes
1

answer
990

Views

DropDownListFor<> not using my selected value if I change it in the model before call

Why does DropDownListFor not always set the selected value? In my case I've noticed this to happen when the dropdown list is being constructed after a form post and the value differs from the value that was submitted. So the scenario is a form containing a dropdown to select a category you want to s...
John Freebs
1

votes
4

answer
3.3k

Views

I need to get the folder path,how to select a folder using fileupload in asp.net?

I want to select the folder using the file upload control and i need to just get the folder path that is to be saved.I think it is not possible to select a folder using file upload control but i think it is possible by some kind of customization. Please anyone could help me.
user1471194
1

votes
2

answer
188

Views

root directory of MVC not found

I'm new to MVC4 (or MVC at all using .NET). I have my controller and views working fine but if I navigate to http://localhost: I get a 404. If I go to " http://localhost:/MyController everything works fine. How do I get a default controller for ROOT of the website?
Randy R
1

votes
2

answer
1.3k

Views

Asp .net Web config file connection string with secured

I have following connection string in my web application. For some security purpose , unable to put sql username and password directly in web.config file. If anything build in security option is available in asp .net to handle this. Advice me
bgs
1

votes
2

answer
26.8k

Views

How to use KeyPressEvent in correct way

try to create HotKeys for my forms code private void FormMain_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == (char)Keys.Enter) { MessageBox.Show("e"); } } works for one key, but if I whant to use combination of keys like CTRL+N, try to use if (e.KeyChar == (char)Keys.Enter &...
gbk
1

votes
2

answer
785

Views

C# redraw blinking

I have UserControl : Panel. When I add to Form own UserControl. UserControl.Anchor = Left|Right|Top|Bottom. When I resize Form Rectangle is blinking. How can you make that do not blink? public partial class UserControl1 : Panel { public UserControl1() { InitializeComponent(); this.ResizeRedraw = tru...
prm
1

votes
2

answer
7.7k

Views

Mouse click and hold event?

Does anyone have an idea how to handle a mouse click and hold event in VB.NET? Suppose I want to click and hold in a button and do some stuff behind the code like change the button BackColor or close a window faster( just like when you click in the ms office 2013 file menu then use a left-arrow to...
Milot25
1

votes
1

answer
756

Views

Render Asp.net server controls dynamically

I have a string stored in DB as "". I am trying to get this data and put it in a div which have runat="server" in it using innerHtml property. protected void Page_Load(object sender, EventArgs e) { Layouts.InnerHtml = GetTemplate(); } public string GetTemplate() { CompassModel.Layout Layout; using...
Deepak D
1

votes
1

answer
10.9k

Views

How can convert XML to PDF using iTextSharp?

How can convert XML to PDF using iTextSharp? the iTextSharp's current XML to PDF is clearly out of date and does not work. So I went about fixing the problem but i am not been able to covert it Can any one help me. 14 loss test ISO-133 gm 36 21 63 24 sand ISO-133 gm 71 22 23 25 clay ISO-133 mg 52 2...
sandeep.wuthoo
1

votes
2

answer
981

Views

C# Array initialization with a ternary operator? [closed]

They don't seem to work in C# string[] directions = IsSomeValueTrue ? string[]{"RIGHT", "LEFT"} : string[]{"UP", "DOWN"}; string[] directions = IsSomeValueTrue ? new string[]{"RIGHT", "LEFT"} : new string[]{"UP", "DOWN"}; What am i missing?
Seehyung Lee
1

votes
3

answer
1.6k

Views

C# Json.Net - How to deserialize complex object Google Elevation

I have this JSON: { "results" : [ { "elevation" : 25.51896667480469, "location" : { "lat" : -26.90408425509977, "lng" : -49.04650926589966 }, "resolution" : 152.7032318115234 } ], "status" : "OK" } This class: public class RootObject { public Elevacao[] results { get; set; } public string status { g...
Tiedt Tech
1

votes
1

answer
14.8k

Views

How to send multiple parameters using Html.BeginForm() in asp.net mvc?

Actually I want to send the image and the text in the textbox to the controller... @using (Html.BeginForm("Upload", "Home", FormMethod.Post, new { enctype = "multipart/form-data" })) { @Html.Label("UserName:") @Html.Label("Upload:") Preview } and I am trying to retrieve them in the controller i...
Bharat Bhushan
1

votes
2

answer
4.3k

Views

Pass other value when checkbox is clicked

I want to pass other value when checkBox is clicked. my code is as below foreach (var item in Model) { @Html.CheckBox("Project", false, new { item.ProjectId}) } Controller is [HttpPost] public ActionResult Test(FormCollection collection) { var test = collection["Project"]; } in Var test i am get...
user2739679
1

votes
3

answer
565

Views

Cannot find DBF file in given path while executing query

I am trying to run the following code to access a DBF file in folder. the name of the file if RF10.dbf: foxpro = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\\Documents and Settings\\xxxxxx\\xxxxx\\xxxxx\\;Extended Properties=dBASE IV;User ID=ADMIN;Password=;"); try { foxpro....
Salik
1

votes
3

answer
10.7k

Views

Request.IsAuthenticated Return False all the time

I am having an issue with my Request.IsAuthenticated always return false. I am setting the AuthCookie CurrentRequest currentRequest = null; if (Url.IsLocalUrl(returnUrl) && returnUrl.Length > 1 && returnUrl.StartsWith("/") && !returnUrl.StartsWith("//") && !returnUrl.StartsWith("/\\")) { return Redi...
Josiane Ferice
1

votes
2

answer
594

Views

Implicit reference to object under construction is not valid when calling another constructor

I am trying following Within my MVC Controller: Private ProductRepoitory As IProductRepository Sub New() Me.New(New productsRepository(New ModelStateWrapper(Me.ModelState))) End Sub Sub New(ByVal repo As productsRepository) ProductRepoitory = repo End Sub However this line throws following Error mes...
highwingers
1

votes
2

answer
23

Views

Requesting a quersystring with a method in a class

I'd like to request a querystring. It's simple to make it work within the aspx file, but when I make a method within a class and are going to use it, I can't use Request.QueryString["id"]; because it doesn't show up.
Adrian
0

votes
2

answer
23

Views

Shopping basket in asp.net WebForm

I am building a small website with some books to sell and need to implement a simple solution to add books to a basket (maybe a Session["buylist"]) and allow the user to place an order with an eMail. In one page i have a gridView filled with a dataReader from the SQL Database and was able to add one...
Rui Ruivo
-1

votes
0

answer
12

Views

'Object reference not set to an instance of an object.'

I am getting this error when i tried to make a put request in my react app. This code snippet is part of my web api. [HttpGet("{id}", Name = "Get")] public Users Get(int id) { var user = _context.Users.Find(id); UserRole userRole = _context.UserRole.FirstOrDefault(c => c.UserId == id); user.RoleID...
Maryum Siddique
0

votes
0

answer
4

Views

Coco dataset to voc dataset for darkflow

I am working on a project of object recognition in darkflow andI want to train it with the coco dataset. Darkflow can only work with the voc dataset so far I know. So I am trying to convert the coco dataset json to multiple xml files darkflow need. I want to create a script in vb.net because I know...
Woebenskie
2

votes
0

answer
19

Views

Asp.Net Core 2 MVC Authentication: Add different session times

I'm new to coding in general and specifically Asp.Net core so excuse my noobiness here. I'm really hoping for some help with my project. I'm at the moment tearing my hair with adding different TimeSpan to different users while logging in. Say for exemple user from company 1 login and will, hopefully...
Kajan_Mff
1

votes
1

answer
398

Views

Difference Between Mouse and Key events ToolStripMenuItem

So I'm having a bit of a problem handling a situation. I have an application, which is an MDI application, which opens custom documents. My MDI parent has a ToolStrip, with a few controls, a text box and a button. The text box holds a qty value for an item, then there is a button to add the item to...
Wanabrutbeer
1

votes
2

answer
664

Views

Set the path from an OpenFileDialog to a variable

I have the following code to set the filename from a OpenFileDialog to a variable: Dim OpenDLG As New OpenFileDialog File = OpenDLG.FileName.ToString() Dim xPath As String = File Dim ArrPath() = xPath.Split("\") Dim wPathLong = ArrPath(ArrPath.Length - 1) But now I want to have the same for the Path...
RalJans
1

votes
2

answer
1.6k

Views

Handling exception at application level

I have a vb.net main desktop application and there are also supporting applications of the main application. I have to do exception handling for all the methods in the application but don't want to put try catch in each and every method or event click. Is there any centralized way of exception handl...
user3060430
1

votes
3

answer
92

Views

Optimization of an MSSQL Database

Briefly I would like to explain my project. I have already built an eCommerce website (ASP.NET C# MSSQL) where users are asked to register before payment (in case if they are not registered). Whenever a user register, 1 table is created automatically using C#. The purpose of this table is to store d...
Facbed
1

votes
1

answer
1.6k

Views

Tinymce 4 toolbar icons not appear

I have an asp.net project and I am using tinymce 4. It was working perfectly but totay my editors buttons suddenly disappeared. I searched for the solution from the internet but I could not find any solution. the icons like on the picture. what should I do. Regards... tinyMCE.init({ forced_root_bloc...
mbultraslan
1

votes
1

answer
416

Views

Runtime error while using Mailchimp in asp.net Application

I am trying to access mailchimp using it's api.I have installed mail chimp using Install-Package MailChimp.NET in package console. I have used the code MailChimpManager mc = new MailChimpManager("44c406b82d7deb236e88b214363368fa-us3"); ListResult lists = mc.GetLists(); While running the application...
Nimmi
1

votes
2

answer
6.8k

Views

Loading javascript with MVC Razor

The following view is giving me "Object doesn't support prop or method jCarouselLite". I have an almost identical page using plain html which works. Am I loading the javascript properly? @using System.Web.Script.Services @{ ViewBag.Title = "Home Page"; } $(function () { // Add Carousel plugin to r...
WhiskerBiscuit
1

votes
2

answer
1k

Views

SQL SELECT Returning the same value twice in GridView

Good Day All, So I'm working on a small application that stores entries into a table (author, short description of paper/book) and then metadata (user's vote, ID of entry, User ID, and comments). I have things working using JOIN's to get the information that I want displayed according to the user wh...
Jobokai
1

votes
3

answer
5.5k

Views

c# drop down list in grid view

I am a grid view that I have that I can edit, update, delete from. I can manually add a drop down and have the selected value populate correctly, but I want to be able to populate the drop down from the database (and show the selected value correctly) when editing it. I have tried a bunch of search...
Brad

View additional questions