Click here to Skip to main content
15,892,537 members
Everything / Web Development / ASP.NET / ASP.NET4.0

ASP.NET4.0

ASP.NET4

Great Reads

by defwebserver
You can easily create a Bot and deploy it on Facebook.
by Florian Rappl
Crawling tons of (individual) web information and creating statistics using Windows Azure.
by kannankeril
This article is an attempt at splitting out the controller layer to reduce its complexity and improve quality and maintainability of the resulting code.
by Sami Pylkkänen
Article shows how to setup ASP.NET 4.5.2 and ASP.NET 5 projects for Angular 2 application and how to enable Angular 2 typescript debugging in Visual Studio.

Latest Articles

by Lance Ford
Use an IIS module to identify the node that served a request in a web farm environment.
by Herman.Instance
AjaxControlToolkit Accordeon's bad influence on Gridview PagerTemplate
by Zijian
Generate strongly typed client API in C# for ASP.NET Web API and .NET Core Web API supporting desktop, Universal Windows, Android and iOS
by Chris A. Johnson
Drag and Drop between Multiple Trees in Jquery using jstree

All Articles

Sort by Score

ASP.NET4.0 

2 Jul 2016 by defwebserver
You can easily create a Bot and deploy it on Facebook.
9 Jun 2013 by Florian Rappl
Crawling tons of (individual) web information and creating statistics using Windows Azure.
25 Nov 2016 by kannankeril
This article is an attempt at splitting out the controller layer to reduce its complexity and improve quality and maintainability of the resulting code.
7 Mar 2016 by Wonde Tadesse
You will need to implement a centralized role management and use across the applications. This article will be a starting point. Introducing Single Sign-on to an existing ASP.NET MVC application[^]
5 Jul 2012 by Wonde Tadesse
Before you calling the actual WebClient DownloadString functionality, You may have to set the Credentials Property to the WebClientobject. i.eWebClient client = new WebClient();client.Credentials = CredentialCache.DefaultCredentials;// Use ASP.Net default credential// Do Download or...
7 Apr 2016 by Sami Pylkkänen
Article shows how to setup ASP.NET 4.5.2 and ASP.NET 5 projects for Angular 2 application and how to enable Angular 2 typescript debugging in Visual Studio.
11 Jun 2012 by Manfred Rudolf Bihy
There is a web site that does code conversion for you: Developer Fusion: Convert VB.NET to C#[^]This is the result from feeding it what you pasted into your question:protected void Menu1_MenuItemClick(object sender, MenuEventArgs e){ MultiView1.ActiveViewIndex =...
13 Jun 2012 by VJ Reddy
The code can be converted by with http://converter.telerik.com/[^] or using the link given in solution 1 by Manfred R. Bihy. The converted code is as follows:protected void Menu1_MenuItemClick(object sender, MenuEventArgs e){ MultiView1.ActiveViewIndex =...
28 Jun 2012 by Wonde Tadesse
Take a look at the FaceBook API(Authentication[^]) documentation. It's been clear described the things need to be used in order to integrate the FaceBook API to your website. However you may not get all the information that the user has in FaceBook account.Facebook Developers document saysBy...
21 May 2012 by Mohamed Mitwalli
Hi , You can use Session //for assign DataSet ds = new DataSet(); Session.Add("Name", ds); // for retrieve ds = (DataSet)Session["Name"];Exploring Session in ASP.NET[^]Session management options in ASP.NET[^]Session Management in...
3 Apr 2013 by Nithesh AN
Printing an RDLC file in ASP.NET MVC3 automatically by converting into PDF and using Acrobat Reader.
26 Oct 2013 by defwebserver
You can consume your backend OData Visual Studio LightSwitch services in AngularJs
28 Dec 2015 by Dhruti90
MVC functionalities with web service with simple integration
7 Mar 2016 by Wonde Tadesse
See this SO answer.Entity framework - EF is throwing an error. Schema specified is not valid [^]
26 Jan 2012 by Dalek Dave
Use HostIp.Info[^] and get the Geo API.Or use any of the webservices available.This[^] may help.
27 Dec 2012 by Oleksandr Kulchytskyi
So , in your web config make next changes :Add Global.asax class file in root of your application or website. This method works only if Global.asax is present in application.you can also put this code in in a class and inherit all pages of application from this class...
1 Feb 2013 by S. M. Ahasan Habib
.NET TransactionScope and its default Transaction Isolation level issue.
26 Jan 2016 by yehia2amer
This method will use jQuery Ajax to POST and GET Handsontable JSON data from/to Controller in ASP.NET MVC.
10 May 2012 by Monjurul Habib
OpenContacts.N...
11 May 2012 by Maciej Los
Try thisSELECT t1.ID, t1.Name, t1.ImageUrl, t2.ID, t2.EmpID, t2.NameFROM Table1 AS t1 LEFT JOIN Table2 AS t2 ON t1.Id = t2.EmpIdWHERE t1.Id = 2but carefully read answer 1.
14 May 2012 by Prasad_Kulkarni
It's really a matter of how you define "platform".E.g. .NET is platform independent as long as the platform is .NET, the same way that Java is platform independent as long as the platform is Java. That is to say, .NET (and Java) are, in part, platforms in themselves (CLR, JVM). As long as...
17 May 2012 by Monjurul Habib
Try following:SQL Network Interfaces, error: 26 - Error Locating Server/Instance SpecifiedSQL Network Interfaces, error: 26 - Error Locating Server/Instance Specifiedprovider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified
10 Jul 2012 by Rahul Rajat Singh
I think this comprehensive guide on cookies is worth reading. this is very explanatory and will really help you.Beginner's Guide to ASP.NET Cookies[^]
17 Jul 2012 by Prasad_Kulkarni
Try this:ALTER TABLE Production.TransactionHistoryArchive ADD CONSTRAINT PK_TransactionHistoryArchive_TransactionID PRIMARY KEY CLUSTERED (TransactionID);From: http://msdn.microsoft.com/en-us/library/ms189039.aspx[^]Note: Before using the ALTER TABLE command to add a primary key, you'll...
31 Jul 2012 by Volynsky Alex
Please look following links to your topic:http://forums.asp.net/t/1071783.aspx/1[^]can i convert my usercontrol website into dll...
16 Aug 2012 by Rahul Rajat Singh
If you have to check for some session variable in all the pages then perhaps you can do this in AcquireRequestState event in global.asax file. here you can check if the session variable exist or not, if not then you can push the user to a the default page.void...
23 Feb 2013 by Maksud Saifullah Pulak
HTTP HandlerHTTP Handler is the process which runs in response to a HTTP request. So whenever user requests a file it is processed by the handler based on the extension. So, custom http handlers are created when you need to special handling based on the file name extension. Let's consider an...
22 Aug 2013 by OriginalGriff
Because if it didn't, resources would not get cleaned up. That's the blunt answer and it's pretty much all you need. The thing is, whenever you exit a try...finally block, by whatever means, the code in the finally block is always executed. That means if you leave because you:1) Got to...
5 Feb 2014 by Sergey Alexandrovich Kryukov
Just remove var; it is only needed to resolve ambiguity between variables given the same name in outer and inner context: in inner context, outer variable is accessible and can be used, but if you want to use a local variable with the same name, introduce it with var.In your case, you have...
3 May 2014 by Malik_Usman
Add the following line in Web.Config file and it will work.....it works in my case coz i had same problem.
19 Oct 2015 by F-ES Sitecore
You can't verify that an email is valid, the only way to verify the address is to send it an email with an activation code\link that the user clicks to verify their account.
6 Nov 2015 by Sergey Alexandrovich Kryukov
There are absolutely no any cookbook recipes to be used to identify design problems. Perhaps except one: take the whole problem to be solved from scratch and try to sketch some best designs you can invent. If your plan looks much better than existing design, that existing design flawed. But be...
18 Apr 2016 by F-ES Sitecore
You could checkRequest.UrlReferrerIf it's empty it's likely they navigated straight to the page, if they came from a link on another page that page will be in there and you can check that it's a valid "from" page.Pretty bad idea in my opinion though, I'd just let them access the page...
19 Dec 2011 by OriginalGriff
This is probably to do with how you connect to SQL server. When you were running in development, you probably connected using Windows Authentication, rather than a specific user and password, and this works fine.Now, you are running on a remote, production SQL server instance, and it looks at...
29 Dec 2011 by Nikhil_S
Best Link to understand From basics with all the Conceptshttp://www.wpftutorial.net/[^]
29 Dec 2011 by Rajesh Anuhya
see this video tutorials[^]
29 Dec 2011 by Sergey Alexandrovich Kryukov
Whatever you do, it's never too easy and never too fast.I would advise to start here: http://msdn.microsoft.com/en-us/library/ms754130.aspx[^].Surprise? Yes, this is trivial: MSDN.—SA
25 Jan 2012 by thatraja
Check this articleLearn SQL to LINQ (Visual Representation)[^]
29 Jan 2012 by thatraja
Google? :sigh:Three Tier Architecture in ASP.NET[^]
4 Feb 2012 by OriginalGriff
It's pretty easy:
13 Apr 2012 by uspatel
On textChange Event of textboxTextBox2.Text = TextBox1.Text;or use javascript Onchange event in Javascript
19 Apr 2012 by Prasad_Kulkarni
Please refer following threads:Using jQueryUI accordion to create a vertical menu[^]Vertical Menu[^]Menu Control Example[^]Dynamic jQuery Menu[^]
21 Apr 2012 by Abhinav S
Meduim sized application - i think you could consider using MVC if you are confident about learning it quickly.This article[^] would convince you in the favour of using MVC.If you don't have too much development time or are not confident about learning quickly at all - you can drop the idea.
11 May 2012 by Wendelius
No trick, if you do this in your SQL statement, you use a join (most likely an inner join in this case).For a tutorial, see: SQL Joins[^]
14 May 2012 by Rahul Rajat Singh
The answer to this is YES and NO. let me explain how. first lets talk about the cross platform JAVA. java is said to be cross platform and the real reason for this is the availability of the JVM for various platforms. .net framework basically is equivalent to the JVM and supports many...
17 May 2012 by Monjurul Habib
I am providing you and example for toggling your div but you can use this approach for only show/hide.For example you have a Div within MasterPage like the following: For hiding and showing your div dynamically via...
21 May 2012 by P.Salini
Go through State Management TechniquesState Management in ASP.NET[^]how to pass the more textbox value from one form to another form in asp.net?[^]
21 May 2012 by Prasad_Kulkarni
Client Side:View State – Asp.Net uses View State to track the values in the Controls. You can add custom values to the view state. It is used by the Asp.net page framework to automatically save the values of the page and of each control just prior to rendering to the page. When the page is...
1 Jun 2012 by Prasad_Kulkarni
Please refer some links with code which auto generates password:How can i autogenerate the password for the use[^]How To: Generate a Random Password (C#/VB.NET)[^]Membership.GeneratePassword Method[^]Creating auto generated string password in ASP.NET[^]ASP.Net MembershipProvider :...
3 Jun 2012 by Manas Bhardwaj
Look at how custom formats are used in C# for DateTime:http://msdn.microsoft.com/en-us/library/8kb3ddd4.aspx[^]DateTime.Now.ToString("yyyyMMdd");
4 Jun 2012 by Sebastian T Xavier
please change your code as follows....cmd.Parameters.AddWithValue("@name",TextBox1.Text);cmd.Parameters.AddWithValue("@address", TextBox2.Text);cmd.Parameters.AddWithValue("@password", TextBox3.Text);cmd.Parameters.AddWithValue("@confirmpassword", TextBox4.Text);RegardsSebastian
4 Jun 2012 by taha bahraminezhad Jooneghani
you have to set the text of a texbox not a control, the correct is:cmd.Parameters.AddWithValue("@name",TextBox1.Text);
4 Jun 2012 by OriginalGriff
Look at your code:string commandText = "INSERT INTO Document VALUES(@FileName, @ContentType,@Size,@Document)";commandText = commandText + "@Document";You end up with SQL Command string:INSERT INTO Document VALUES(@FileName, @ContentType,@Size,@Document)@DocumentWhich is clearly...
7 Jun 2012 by OriginalGriff
Never, ever, accept code from a insecure website to handle anything to do with real money.You do not know who is giving you the code, you do not know what it does, you do not know that it places the monies correctly into the appropriate account, without passing the details to any third...
7 Jun 2012 by Ankur\m/
Salary for the month = Monthly Salary / Total no. of days in the month * (days worked + paid leaves)paid leaves can be calculated as,if Leaves taken > available leaves Paid Leaves = Available Leaveselse Paid leaves = Leave TakenNow you need to update the available...
7 Jun 2012 by Manas Bhardwaj
Looks like homework. And by the way it has nothing to with C# or .Net for that matter. You need the formula to calculate salary and write it in C# which shouldn't be difficult anyways.Apart from that, what you wrote is also not logical. Out of 31 days, someone comes to office for 20 days and...
7 Jun 2012 by RDBurmon
Hello Gowtham ,My suggestion is to divide basic salary by number of days in a month and then multiply it by number of non-paid leaves and deduct that amount from total salary.For Example Employee "John Kerry" has salary stucture as (Basic 5000.00 + HRA 2500.00 + Allowances 1500.00 +...
8 Jun 2012 by abhinavvijay
if you have passed it as value type then it will not be closed, but you passed it as referenced type then it will closed.
14 Jun 2012 by Sandeep Mewara
I just think, posting such issues about a 3rd party control at telerik Forum would be more useful.Here:TELERIK Forum[^]Try looking here: Telerik RadGrid Forum[^]Posting here is fine but it might be already discussed there!I had found that specific questions related to 3rd party is...
17 Jun 2012 by OriginalGriff
"Don't encrypt passwords" is the simple answer.See here: Password Storage: How to do it.[^]
17 Jun 2012 by Prosan
on button click when you redirect to next page use session or querystring and set data to them. and acces session or querystring data on next page and using these data create your query and bind this query result to datlist.using...
20 Jun 2012 by Prasad_Kulkarni
Refer similar discussion: the fusion Chart in C#[^]CP Search: Click here[^]
20 Jun 2012 by Manas Bhardwaj
SQL Server 2008 databases are version 655. SQL Server 2008 R2 databases are 661. You are trying to attach an 2008 R2 database (v. 661) to an 2008 instance and this is not supported. Once the database has been upgraded to an 2008 R2 version, it cannot be downgraded. You'll have to either upgrade...
1 Jul 2012 by OriginalGriff
Via Interop is probably the safest way - but it does require an office installation:http://msdn.microsoft.com/en-us/library/dd264733.aspx[^]http://social.msdn.microsoft.com/forums/en-US/tfsworkitemtracking/thread/c15ca99b-5aae-459c-ad26-0c0800999fc8/[^]
12 Jul 2012 by Volynsky Alex
Hi,The application attempted to perform an operation not allowed by the security policy. To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file.Try to replace in the machine.config the ASPNET...
17 Jul 2012 by Sandeep Mewara
Sounds like following article will help you out: Partial update of parent page via AJAX (ASP.NET 2.0) on close of a child window - conditionally[^]Have a look at it and pick the things you need.
17 Jul 2012 by Espen Harlinn
Have a look at ASP.NET Popup Control[^]It's quite good looking and fairly easy to use.[Update]Then there is, as Sergey mentions, jQuery UI. For asp.net Juice UI[^] simplifies jQuery UI development.Best regardsEspen Harlinn
21 Jul 2012 by Volynsky Alex
Please see following page:http://stackoverflow.com/questions/6167805/using-rails-3-1-where-do-you-put-your-page-specific-javascript-code[^]
15 Aug 2012 by Prasad_Kulkarni
You might get some help, have a look on following threads:http://haryoktav.wordpress.com/2009/03/21/webcam-in-c-aforgenet/[^]access Webcam through .Net[^]http://channel9.msdn.com/forums/TechOff/68027-Webcam-Capture-C/[^]CP archives:Dynamic Webcam Image[^]Your First Step to the...
28 Aug 2012 by Abhinav S
If you read here you will understand that the entity framework is essentially neither - it has nothing to do with holding connections. It is the underlying ADO.Net model that provides the appropriate connectionless framework.
5 Sep 2012 by Andrei Straut
The solution comes from your own error message:To grant ASP.NET access to a file, right-click the file in Explorer, choose "Properties" and select the Security tab. Click "Add" to add the appropriate user or group. Highlight the ASP.NET account, and check the boxes for the desired...
26 Jan 2013 by OriginalGriff
Don't concatenate strings to build your command.For example, if your code is:MySqlCommand cmd = new MySqlCommand("INSERT INTO myTable (myColumn) VALUES('" + myTextBox.Text + "')", con);and your text box containsIt's cold todayThe the command as seen by SQL is:INSERT INTO myTable...
5 Mar 2013 by willington.d
Hi KavithaleYou have to remove the '=' in the for loop. b'cos "i" value is starting from 0. for example, if u have 10 records in a gridview. you have to consider 0 to 9for (int i = 0; i
20 Mar 2013 by Sergey Alexandrovich Kryukov
All you need is this: http://www.w3schools.com/cssref/sel_hover.asp[^].—SA
13 Apr 2013 by Gabriel Sas
this is the solution :)
10 May 2013 by vijay4mgvrm
Hi Ganesh,I got same issue at clint apllication. But it worked when i change property in service interface like below: [WebInvoke(Method = "GET", ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare)]
7 Sep 2013 by Ron Beyer
Well without reading your mega-code dump, here is your problem:Quote:[UnauthorizedAccessException: Access to the path 'C:\Inetpub\vhosts\rechargeerp.com\httpdocs\temp\zttux5i5h0iyhb452dctuhe2_photo.jpg' is denied.]You are trying to access a path that is denied.
10 Sep 2013 by Sergey Alexandrovich Kryukov
This is not easy and will hardly ever work perfectly and not irritate the user. So, the best approach would be this: use the DateTimePicker like the one provided in this CodeProject library: DateTimePicker Web Control[^].One more:...
4 Oct 2013 by Member 10331745
try thishttp://www.codeproject.com/KB/printing/[^]http://stackoverflow.com/questions/15612370/printing-to-non-default-printer-from-c-sharp[^]
5 Oct 2013 by Sergey Alexandrovich Kryukov
First of all, you probably don't understand what is resolution. As it is pretty much irrelevant, I don't wont to explain it much; will just tell you: resolution is dots-per-mm, dots-per-inch, lines-per-mm or lines-per-inch, depends on physical media, so you cannot control it.What you mean is...
8 Oct 2013 by thatraja
Googled?For Vs Foreach - Benchmark 2013[^]If you expect answers for your upcoming interviews then it's not right way to learn. You should start to learn C# from start.Here more than couple of ways to learn anything in internet.Education Needed[^]
28 Oct 2013 by Thomas Daniels
You can't put variables in a namespace, you need to put them in a class or method.If you want to make these variables global accessible, put them in a static class GlobalVariables:using System;using System.Collections.Generic;using System.Linq;using System.Web;using...
23 Jan 2014 by OriginalGriff
First off, don't try to save anything in the root folder of any drive, and particularly not in the root of your boot drive: From Vista onwards it takes special permission to avoid virus tampering, and it will not get any easier.Second, if this is really a ASP.NET application, you will almost...
7 Nov 2014 by Sergey Alexandrovich Kryukov
What's wrong with System.Web.UI.WebControls.TreeView:http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.treeview%28v=vs.110%29.aspx[^]?—SA
7 Nov 2014 by Maciej Los
Have a look here:MSDN - Walkthrough: Displaying Hierarchical Data in a TreeView Control[^]Dynamic Binding Of Hierarchy Data Structure To Treeview Control[^]Parent/Child (Hierarchical) Relational Treeview User Control Development in ASP.NET[^]simple-talk: Rendering Hierarchical Data with...
10 Sep 2015 by Sergey Alexandrovich Kryukov
What you are trying to do is simply one big abuse. What user will want to see 7000 records? You need to create some alternative design. Say, the query can be designed to allow only limited number of records at a time. One very usual solution is paging:How To Implement Paging in GridView...
8 Oct 2015 by OriginalGriff
Well... it's pretty obvious! :laugh:The second one first:From a collection of ABC objects, select the return value - which is string - and convert it to a list of strings. Nothing funny there.The first one though just takes a look at the MSDN documentation: List.ForEach Method[^] and...
19 Oct 2015 by Maciej Los
If by "validate" you mean you want to check if an email address exists, there's no chance to do it, unless... an email has been successfully send and email server does not return an information about errors.Please, read past questions and answers[^].
28 Oct 2015 by Zoltán Zörgő
Wait a second.1) IIS does not connect to any RDBMS, except for storing session state - it is only a setting you can use in your application2) SQL Express does not enable TCP/IP connector by default, you need to enable it[^].3) For this to work, you need to have specific port level...
5 Nov 2015 by Richard Deeming
You'll need to update your regular expression to allow characters from the Devanagari character block[^]:sjunk = System.Text.RegularExpressions.Regex.Replace(sjunk, @"[^\u0000-\u007F\u0900-\u097f]", "");
22 Dec 2015 by Sergey Alexandrovich Kryukov
No way. It's not because this is impossible, this is because the whole idea makes no sense. There is no such concept as "add application", and cannot be. Moreover, using any kind of Windows (Linux, Android — you name it) code in a Web application is complete nonsense, and it should be obvious to...
22 Dec 2015 by Duncan Edwards Jones
In C# equality is indicated with a double == operator.[^]if (DataReader.GetInt32["trials_num"] == 0)
31 Jan 2016 by dan!sh
Like this: dvPoTrans.Item[0].Item["LI_NO"]
12 Feb 2016 by lakhdarr
Different ways to export a grid contents to different file formats csv, excel, pdf using ASP MVC
7 Mar 2016 by Maciej Los
Well... hard to guess till the definition of database model is unknown.In general, there can be - at least - few possible reasons of this error:Enum is not supported in EF 5.0 for .NET 4.0. This feature is available for EF 5 in .NET 4.5Model Checker fails to check the current Database...
19 Mar 2016 by Dave Kreskowiak
That's easy. They don't.Code that is written in C# or VB.NET, or any of the other managed languages, doesn't run in the browser.In an ASP.NET application, all that code runs on the server, not the browser.In a Silverlight application that runs in a browser, the browser is just a...
24 May 2016 by F-ES Sitecore
Use a varchar field and come up with a format for your data such as "radiovalue|dropdown1value|dropdown2value" and store that in the field as normal. When you read the field do a string.Split on the '|' to separate the values. You could also store the data as xml, or maybe in JSON format, it...
14 Sep 2016 by STalha.Munir
This article explains the security concerns in respect to URLs with plain ids and unique identifiers and presents a solution using custom attributes in ASP.NET MVC 5.