Questions tagged [asp.net-3.5]

asp.net-3.5 is the 3.5 version of web development framework asp.net, part of .Net. It features: ASP.NET AJAX as a part of the runtime, new LINQ data capabilities, improved support for CSS.

asp.net-3.5
Filter by
Sorted by
Tagged with
859 votes
22 answers
1.0m views

How can I deserialize JSON to a simple Dictionary<string,string> in ASP.NET?

I have a simple key/value list in JSON being sent back to ASP.NET via POST. Example: { "key1": "value1", "key2": "value2"} I AM NOT TRYING TO DESERIALIZE INTO STRONGLY-TYPED .NET OBJECTS I simply ...
richardtallent's user avatar
100 votes
11 answers
158k views

Unable to convert MySQL date/time value to System.DateTime

I get this error: Unable to convert MySQL date/time value to System.DateTime while I am trying to fetch the data from a MySQL database. I have the date datatype in my MySQL database. But while ...
Ankit Chauhan's user avatar
79 votes
2 answers
81k views

Create Text File Without BOM

I tried this aproach without any success the code I'm using: // File name String filename = String.Format("{0:ddMMyyHHmm}", dtFileCreated); String filePath = Path.Combine(Server.MapPath("App_Data"),...
balexandre's user avatar
  • 74.3k
66 votes
2 answers
103k views

Forms Authentication Timeout vs Session Timeout

In my asp.net website i am using asp.net form authentication with following configuration <authentication mode="Forms"> <forms loginUrl="~/Pages/Common/Login.aspx" defaultUrl="...
Hemant Kothiyal's user avatar
45 votes
3 answers
61k views

How to make update panel in ASP.NET MVC

How do I make an update panel in the ASP.NET Model-View-Contoller (MVC) framework?
ibrahimyilmaz's user avatar
41 votes
7 answers
144k views

how to solve Error cannot add duplicate collection entry of type add with unique key attribute 'value' in iis 7

I created a asp.net website and published it in iis 7. I deleted the default website option in the iis 7 and created the new website in the iis 7. When i click the default document I got the error ...
satya's user avatar
  • 411
41 votes
6 answers
158k views

How to initialize a list with constructor?

I have a type: public class Human { public int Id { get; set; } public string Address { get; set; } public string Name { get; set; } public List<ContactNumber> ContactNumbers { ...
haansi's user avatar
  • 5,600
38 votes
6 answers
36k views

Check that email address is valid for System.Net.Mail.MailAddress

Currently, to avoid errors from being thrown up due to invalid email addresses, I do the following: Dim mailAddress As MailAddress Try mailAddress = New MailAddress("testing@[email protected]") ...
Curtis's user avatar
  • 102k
34 votes
1 answer
21k views

creating a user in Active Directory: A device attached to the system is not functioning

Consider this code attempting to create an Active Directory account. It's generating an exception here with a certain set of data. It's not clear right now what's causing the exception. var user = ...
p.campbell's user avatar
  • 99.5k
31 votes
2 answers
28k views

How the session work in asp.net?

Please any one suggest me how the session is actually work in asp.net? I am confuse in part of session and want to briefly knowledge of it so please guide me
coolbudy's user avatar
  • 311
30 votes
5 answers
312k views

Convert a string to a datetime

I am developing asp.net site using vb framework 3.5. Im having difficulties converting string data into Date I tried using cdate function, I have a variable sdate which is a string variable and ...
Ishan's user avatar
  • 4,018
30 votes
5 answers
75k views

Stopping onclick from firing when onclientclick is false?

Is it possible to use the onclientclick property of a button to do a clientside check. If the check returns true, then fire the onclick event. If the clientside check returns false, don't fire the ...
oshirowanen's user avatar
  • 15.7k
24 votes
3 answers
85k views

Get item count of a list<> using Linq

I want to query a List<> and find out how MANY items match the selection criteria. using LINQ and c# /.net 3.5. How would I modify the query to return an int count. var specialBook = from n in ...
Geeth's user avatar
  • 5,322
24 votes
6 answers
80k views

The SELECT permission was denied on the object 'Address', database 'CNET_85731', schema 'dbo'

I have been working away for the last 7 months on a C# ASP.NET using Visual Studio 2008 and SQL Server 2008. Today, I was running part of my application which was previously running and I got the ...
Walter Lockhart's user avatar
24 votes
2 answers
44k views

Store and Retrieve values from web.config

I built a small website and there will be only one admin, so in the admin panel I am asking for a password with a value that I do not retrieve from a database, I just hard coded it in the function in ...
Maen's user avatar
  • 1,030
24 votes
3 answers
15k views

How to make per- http Request cache in ASP.NET 3.5

We using ASP.NET 3.5 (Controls-based approach) and need to have storage specific for one http request only. Thread-specific cache with keys from session id won't work because threads are supposed to ...
Artem's user avatar
  • 7,335
24 votes
7 answers
54k views

The Just-In-Time debugger was launched without necessary security permission

We are working on vs 2010 windows 7, 32 bit and the project is running under target framework 3.5. Now we are implementing credit card process in the website project in signup page. It's running ...
praveenb's user avatar
  • 10.6k
23 votes
5 answers
42k views

Access a control inside a the LayoutTemplate of a ListView

How do I access a Control in the LayoutTemplate of a ListView control? I need to get to litControlTitle and set its Text attribute. <asp:ListView ID="lv" runat="server"> <LayoutTemplate&...
craigmoliver's user avatar
  • 6,529
22 votes
5 answers
27k views

Reading system.net/mailSettings/smtp from Web.config in Medium trust environment

I have some inherited code which stores SMTP server, username, password in the system.net/mailSettings/smtp section of the Web.config. It used to read them like so: Configuration c = ...
Carson63000's user avatar
  • 4,222
22 votes
12 answers
28k views

LINQ to SQL -- Can't modify return type of stored procedure

When I drag a particular stored procedure into the VS 2008 dbml designer, it shows up with Return Type set to "none", and it's read only so I can't change it. The designer code shows it as returning ...
Kyle Ryan's user avatar
  • 4,361
22 votes
2 answers
19k views

How to catch HttpRequestValidationException in production

I have this piece of code to handle the HttpRequestValidationException in my global.asax.cs file. protected void Application_Error(object sender, EventArgs e) { var context = HttpContext.Current; ...
bruno's user avatar
  • 1,840
21 votes
4 answers
30k views

What Causes "Internal connection fatal errors"

I've got a number of ASP.Net websites (.Net v3.5) running on a server with a SQL 2000 database backend. For several months, I've been receiving seemingly random InvalidOperationExceptions with the ...
Chad Gilbert's user avatar
  • 36.2k
20 votes
7 answers
114k views

Showing number in 2 decimal places in GridView

I have one GridView in a .aspx page, and am showing dynamic data in this grid, setting AutoGenerateColumns="True". Depending upon which of the options the user selects in a combo box, I am ...
gofor.net's user avatar
  • 4,258
20 votes
2 answers
10k views

Can I split system.serviceModel into a separate .config file?

I want to separate my system.serviceModel section of the web.config into a separate file to facilitate some environment settings. My efforts have been fruitless. When I attempt it using this method. ...
Mr Bell's user avatar
  • 9,288
20 votes
4 answers
23k views

Asp.net checkbox and html data attribute

In asp.net, if you use a custom attribute, usually it is rendered as-is. Considering this markup (note: attributes such as id, name and for were removed in all examples as their generated id/names ...
Ortiga's user avatar
  • 8,611
19 votes
3 answers
21k views

Making user login persistant with ASP .Net Membership

I have a website that is built in ASP.NET 3.5 & SQL Server 2005, using the sql membership provider, and presumably forms authentication. Since security needs on my site are very low, I would like ...
Tom Halladay's user avatar
  • 5,731
19 votes
1 answer
11k views

Is there a way to render Partial Views in WebForms?

I'm touching an old WebForms project but I'm long gone from it and I'm now to used to MVC. I'm trying to refractor the project and come up with a simple issue that is making me crazy... What would be ...
balexandre's user avatar
  • 74.3k
19 votes
3 answers
24k views

ASP.NET MVC Master Pages

What's the difference between the ASP.NET Master Page, and the MVC Master Page? And the AJAX Master Page for that matter?
Ash's user avatar
  • 25k
19 votes
2 answers
35k views

difference in physical path, root path, virtual path, relative virtual path, application path and absolute path?

I have some confusion in understanding what is different in various paths available in .Net for a resource. I only guess Physical path is OS directory path for a resource. I am confuse and event can'...
user576510's user avatar
  • 5,847
17 votes
3 answers
39k views

CS0103: The name 'Encoding' does not exist in the current context

I have a webapplication running on framework 3.5 and is installed on multiple clients, working perfectly. Except this one client... where all webservices that the application provide fail with the ...
Sergio's user avatar
  • 8,213
16 votes
10 answers
71k views

Returning a single row

I'm trying to return a single row from a database: using (connection = new SqlConnection(ConfigurationManager.AppSettings["connection"])) { using (command = new SqlCommand(@"select top 1 col_1, ...
oshirowanen's user avatar
  • 15.7k
16 votes
8 answers
5k views

Resources for learning LINQ?

I'm looking to learn LINQ, but I'm finding that there is a lot more to it then what I initally expected. In fact, there's so much that I'm not sure where is the best place to start. I know that there'...
The Beaver's user avatar
16 votes
3 answers
84k views

ASP.Net textbox onblur event

I have a textbox, whose values I need to validate (if value of textbox is 50, then display message in lblShowMsg) when the user tabs out of the textbox (onBlur event). I can't seem to get the syntax ...
LearningCSharp's user avatar
16 votes
5 answers
4k views

jQuery success callback called with empty response when WCF method throws an Exception

I'm tearing my hair out over this one, so bear with me (it's a long post). Basic Info ASP.NET 3.5 with WCF service in ASP.NET compatibility mode Using jQuery with this service proxy for AJAX ...
Cᴏʀʏ's user avatar
  • 106k
15 votes
3 answers
26k views

The type or namespace name UpdatePanel does not exist in the namespace System.Web.UI

I'm working on a website built by another developer that targets ASP.NET 3.5. I'm trying to add an update panel around a bit of code, but whenever I attempt to do so I get the error posted in the ...
Kyle's user avatar
  • 699
15 votes
7 answers
22k views

log4net - Appenders not working in IIS7.5

I am able to write to a log file using log4net and Cassini/IIS dev server, but when I use IIS7.5, I can't write out to a file. Initially, I got a security exception, so I added requirePermission="...
Steve's user avatar
  • 5,872
15 votes
3 answers
34k views

How do I convert a Bitmap to byte[]?

Basically I am inserting an image using the listviews inserting event, trying to resize an image from the fileupload control, and then save it in a SQL database using LINQ. I found some code to ...
the-undefined's user avatar
15 votes
5 answers
4k views

Which is a better method for storing images - folder or SQL Server as binary?

I am planning the development of a photo gallery application for a client. I am developing the app in asp.net 3.5 and would like to develop it so that I can re-use the application across multiple ...
TGuimond's user avatar
  • 5,475
14 votes
4 answers
7k views

Is it possible to speed this method up?

I have a method that uses loops through 7,753+ objects and Gets the value of each property for each object. Each object has 14 properties. private void InitializeData(IList objects, PropertyInfo[] ...
Xaisoft's user avatar
  • 46.1k
14 votes
6 answers
13k views

Can I negate the value in an attribute that uses an "Eval"?

I'd like to set a button's enabled state to be the negation of a value. So given this code: <asp:CheckBox ID="DefaultChecked" Checked='<%# Bind("IsDefaultMessage") %>' ...
KevDog's user avatar
  • 5,783
14 votes
6 answers
57k views

sql server express connection string

Is there a difference between sql server connection string and the express vesion?!
jDeveloper's user avatar
  • 2,106
13 votes
6 answers
33k views

ASP.net DropDownList with no selected item

I have a ASP DropDownList with items added to it. All what I want is to make the selection after the page loaded empty so there is no a selected item. How can I do that?
Eyla's user avatar
  • 5,761
13 votes
4 answers
16k views

How to call a webservice programmatically in asp.net

How to call webservice programmatically in asp.net without using add web reference? My webservice url keeps on changing. Hence i need to capture the url at runtime and display the results. Please ...
DJ.'s user avatar
  • 131
12 votes
9 answers
20k views

None of my "code behind" code is being called

I have just created an ASP.NET C# project and a virtual directory for it in IIS in (as far as I know) the normal way, but I am seeing very strange behavior that I have never seen before. It seems ...
finnw's user avatar
  • 48.3k
12 votes
3 answers
11k views

Can ASP.NET MVC 3 run inside a ASP.NET 3.5 web site?

I would like to know if it is at all possible to get an MVC3 solution wrapped in a CWAB (Composite Web Application Block) solution built in 3.5? I'm aware that in IIS, 2.0/3.5 and 4.0 sites can run ...
Wizard of Oz's user avatar
12 votes
6 answers
62k views

how to get URL path on local host and on server?

Plase guide me how to get URL path excluding page name on localhost and server. for example for the page Active.aspx local path that I want to get is here in bold. *http://localhost:1532/WebFolder/*...
user576510's user avatar
  • 5,847
12 votes
3 answers
2k views

Why does my SqlCacheDependency HasChanged come back false but almost immediately after changes to true?

I cannot figure out why the HasChanged value of my SqlCacheDependency object is coming back originally from the command execution as false, but somewhere almost immediately after it comes back from ...
The Evil Greebo's user avatar
11 votes
4 answers
14k views

Linq: Get a list of all tables within DataContext

I have a DataContext (Linq to Sql) with over 100 tables, is it possible to get a list of all those tables and lets say print them to the console? This might be a silly question. Thanks.
Sergey's user avatar
  • 3,214
11 votes
4 answers
19k views

Forcing ASP.Net to use TCP/IP to connect to SQL Server instead of named pipes

How can I force my ASP.Net application to connect to a SQL Server using TCP/IP, not Named Pipes? I read somewhere putting "tcp:" in front of the server name in the connectionstring should do ...
Kjensen's user avatar
  • 12.6k
11 votes
2 answers
10k views

Binding a List<string> to a Listview in asp.net 3.5

How do I bind a List to a in ASP.NET 3.5 <asp:ListView ID="lvDiagnosisCodes" runat="server"> <LayoutTemplate> <ul> <asp:...
Sash's user avatar
  • 3,525

1
2 3 4 5
23