Questions tagged [asp.net]

168584 questions
1

votes
1

answer
698

Views

Can I have a FileUpload control inside the Complete step of a Wizard that is surrounded by an UpdatePanel?

I have a Wizard control surrounded with an UpdatePanel and I want a FileUpload control within the complete step. I am aware that a FileUpload control will only work inside an UpdatePanel if a trigger is added to the UpdatePanel, but, my UpdatePanel cannot find the Button1 control in the example bel...
sourkrause
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
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
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
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
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
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
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
1

votes
2

answer
154

Views

Testing response time in Asp.net mvc4 application

I have an asp.net mvc4 application , in which i have this class public class Arbre { public int id_resp = -1; Admin notre_admin = new Admin(); List _la_liste = new List(); public Arbre(int id) { id_resp = id; } public List GetTasksOfExpert(int id_user) { List liste = notre_admin.GetTasksOfExpert(id...
Lamloumi Afif
1

votes
3

answer
1.9k

Views

how to restrict html table row height in WebGrid

html table one column contains lot of text and table looks ugly, there is too much space between rows. How to make table better so that there is not so much space, long column should be wider and maybe some of content not visible? I tried to use max-height , but it is ignored. Table is generated aut...
Andrus
1

votes
1

answer
2.7k

Views

Kendo UI DropDownList - Html Helper (Razor) - Hardcode list options

I'm setting up a project with Kendo Ui for the first time, and I'm trying to create Kendo UI dropdown lists, but am getting: ArgumentNullException was unhandled by user code. --Value cannot be null. My code is: @(Html.Kendo().DropDownList() .DataTextField("Text") .DataValueField("Value") .BindTo(new...
Mark
1

votes
1

answer
1.8k

Views

Html.RenderAction fails in page after RedirectToAction()

I have a page "ViewUser". with this structure //display something about the user @{Html.RenderAction("UpdateUser", new { UserId = @Model.UserId });} //display some more stuff In the controller method for UpdateUser I have public ActionResult UpdateUser(int UserId){//populate form vars [HttpPost] pub...
user2472565
1

votes
1

answer
1.1k

Views

Ninject - Injecting singleton

I have this error when clicking a link on a site I'm creating Error activating IEntityCache using binding from IEntityCache to EntityCache No constructor was available to create an instance of the implementation type. Activation path: 4) Injection of dependency IEntityCache into parameter entityCach...
Sachin Kainth
1

votes
1

answer
3k

Views

ASP.NET MVC 4 Redirecting the Response in ActionFilterAttribute

so basically I have a custom ActionFilterAttribute and in it I override one method which looks something like this public override void OnActionExecuting(System.Web.Mvc.ActionExecutingContext filterContext) { bool shouldEnter = true; string redirUrl = "SomeController/SomeAction"; // some checks here...
Dimitri
1

votes
3

answer
2.3k

Views

Umbraco, POST when inheriting from RenderMVCController

I have set up a document type in Umbraco, and have created a custom controller & model for this document type. The custom controller inherits from : RenderMvcController class and the views inherit the model through @inherits Umbraco.Web.Mvc.UmbracoViewPage This all works fine for any HttpGet request...
JanR
1

votes
2

answer
1.3k

Views

Input tag of type button is not changing color in an ASP.NET MVC view

In our ASP.NET MVC 4 app, we are using following HTML tag of type button in a partial view but the button is still showing the default background color instead of the one we define in the style attribute as shown below: We have checked that the class "myClass" is not doing anything related to CSS. I...
nam
1

votes
1

answer
107

Views

filterexpression returns “wrong” result

I have a filterexpression that enables you to filter the results from a gridview. I have two dropdownlists (5 and 6 in the filterexpression, the rest is textboxes and works ine) where you can select a specific predefined range to filter your results by. My filterexpression is as follows: FilterEx...
dQlle
1

votes
1

answer
457

Views

Linq ToArray in ToArray error

I'm trying to make a array of my model (Basket) with Linq and in that model i have another array, so when i'm creating that model with link i got this error: An error has occurred. LINQ to Entities does not recognize the method 'HTTP.Webshop.API.WebAPI.Models.BasketLine[] ToArray[BasketLine](System....
jfamvg
1

votes
2

answer
2.4k

Views

Asp.net MVC RedirectToAction Show Parameter in URL

I need to Redirect to Action with a model object from another action method. It is ok but when i do this, i can see all the parameters in the URL address bar. Since it is about payment, it is not ok for me ? I can do this basicly passing ID but my model is viewmodel and there is no Key. How can i...
umki
1

votes
1

answer
83

Views

parse an xml for a particular element value

i have a xml like { . . . . . . } Similarly, I have many train Numbers and their details. I want to parse the xml for a particular train number and get all the details related to it. Like if I want to get the details for train number 2. I am using xpath as: {xPath = "//Train[@number='1'/trainData/st...
Silver

View additional questions