asp.net

Programmatically detach SQL Server database to copy mdf file

I have a small SQL Server database that I need to copy on command -- I need to be able to take the mfd and ldf files at any given moment, copy them, zip them, and make them available to an end user. Right now this is possible by manually: 1) Logging onto the SQL server via Remote Desktop 2) Detaching the database via SQL Management St...

How to test asp.net membership, profile, roles with VS Test Framework?

Hey all, We're getting some errors, if we try to test something with the asp.net membership framework. It seems that it can't instantiate the asp.net membership environment and so, it can't access all the profiles, users and so on. Has anybody seen a similar problem? Or is it working for someone? Cheers, Steve ...

How the send a webform by email

Hello, I have a task in hand that requires me to send a form to a client by email as soon as it is submited. My question is: Having an aspx(in order to reuse my form) how can I get the generated html to send it by mail? Thanks in advance EDIT: I know how to send emails, what I am looking for is how to get the html that is generated i...

Jquery tree and asp.net 2.0

I have few specific questions on how to make these two work. I need the tree that can be manipulated on the client side (add/delete nodes, expand/collapse) and that can be saved in the database when the user specifically presses a SAVE button. From the research I have done, I gather that what I need to do is use a callback (asp.net call...

JQuery UI Dialog with Asp .NET button postback..

Hello ... I have a JQuery UI Dialog working great on my Asp .NET page: jQuery(function() { jQuery("#dialog").dialog({ draggable: true, resizable: true, show: 'Transfer', hide: 'Transfer', width: 320, autoOpen: false, minHeight: 10, minwidth: 10 }); }); jQuery(document).ready(function() { jQuery("#button_id").click(function(...

Most Efficient Way To Get A Row Of Data From DB In ASP.NET

Hi guys and girls, I'm writing a method to return an 'asset' row from the database. It contains strings, ints and a byte array (this could be an image/movie/document). Now for most row access I use the following method which returns a NameValueCollection as it is a light weight object, easy to use and cast int and strings. p...

Why does my GridView give me an `allowDefinition='MachineToApplication'` error?

What does this error mean in the context of a GridView? It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS. ...

Which authentication and authorization schemes are you using - and why?

We're beginning to design a whole bunch of new services to create (WCF, ADO.NET Data Services, possibly in the cloud at some point) and one question that pops up is what authentication and authorization scheme to use - there are quite a few! We basically need to be able to identify users (actual people, and "virtual" application/servic...

Integrating Instant Messaging into an ASP.NET application

I was thinking about integrating some instant messaging function into an existing ASP.NET web application, e.g: the web application can display the online-status of users (are they currently logged in with their IM client) users can send messages from the web application to the IM client of other users users can initiate a IM chat from...

What's the best way of displaying thumbnails in ASP.NET?

I'm creating a regular gallery in ASP.NET but I have little experiences with creation of thumbnails. I know the algorithms and the GetThumbnailImage method, but my problem is somewhere else - I'm currently displaying the images (just resized) using the ImageButton control. And that's the point - I have no idea how to hook up the "thumbna...

What is the mechanism that keeps various sections on page from being repositioned when browser resizes

In this web site when you shrink the browser window the white space on the left and right disapear first, following by the shrinking of the right panel, followed by the main container panel. I have recently started to use ASP.NET MVC and in my test case my containers drop below the other containers as I resize the browser window. I am us...

Do you have to call RegisterClientScriptInclude in postback?

I need to register a javascript file from code-behind. I am interested to know whether this just needs to be called at the initial page load, or do I have to call it on each postback too ? string clientUrl = ResolveClientUrl("~/Includes/global.js"); if (!Page.ClientScript.IsClientScriptIncludeRegistered(GetType(), "Global")) Page.Cl...

Internet Explorer's Operation Aborted and Latency Issue

If you don't know what the operation aborted error is, here's a Microsoft KB Article about it, http://support.microsoft.com/default.aspx/kb/927917 . There's also tonnes of posts about it but the simple answer for it's occurrence is this; the error only occurs if you try to manipulate a DOM element via JavaScript before the element you ar...

Get the exact url the user typed into the browser.

Hello, I would like to get the exact url that user typed into the browser. Of course I could always use something like Request.Url.ToString() but this does not give me what i want in the following situation: http://www.mysite.com/rss With the url above what Request.Url.ToString() would give me is: http://www.mysite.com/rss/Default.as...

Why would I want to use RIA Services Shared Code?

In .NET RIA Services you can write code on the server with a suffix of .shared.cs or .shared.vb and it will be available for you on the client. My question is why would I want this? Assuming that I use a DomainModel with proper business objects and a ViewModel wouldn't all the code I would need reside in those classes? This looks like ...

GridView doesn't report an exception

Hello, If I bind GridView to SqlDataSource and also set AutoGenerateEditButton to true, and if I then try to update a field ( this field being a primary key in database ), then database should return an error and thus SqlException should be thrown?! So why doesn’t page report an exception? Instead, all Gridview does is setting all fi...

.net ajax and jquery tree

I need to save a jquery tree in the database. i am using .net web forms, c#. From what I hear, I need to use AJAX to collect the data on the client, package it up, and send it to the server method. WHat are the details involved? If anyone has a simple working example, please share. ...

What sets Page.User.Identity.Name

I keep track of the current logged in userID and base the behavior of my site on this value. My code sets the logged in user ID with this statement: FormsAuthentication.SetAuthCookie(UserID.ToString(), true); Subsequently, I read this value from Page.User.Identity.Name. This works fine on my desktop, but on my server, I set it to 8 a...

HttpRuntime Close does not remove items from the Cache as advertised.

I've created my own cache manager for a web site I'm developing and I was looking to find the best way to clear the cache under certain circumstances. I found many articles saying the proper way to clear the cache is to call HttpRuntime.Close() However, in my unit tests setup I call the encapsulated function HttpRuntime.Close() and the...

ASP.NET deployment and regulatory compliance (SOX, et al)

I have a customer who is being dogged pretty hard by SOX auditors regarding the deployment practices of our ASP.NET applications. Care is taken to be sure to use appropriate file- and folder-level security and authorization. Only those few with deployment privileges can copy an up to the product server (typically done using secure FTP). ...