asp.net

How can I create a custom Repeater that displays Header, Footer based on properties?

I want to create a Repeater that displays the header/footer based on properties, only if the DataSource is empty. public class Repeater : System.Web.UI.WebControls.Repeater { public bool ShowHeaderOnEmpty { get; set; } public bool ShowFooterOnEmpty { get; set; } [DefaultValue((string)null), PersistenceMode(PersistenceMo...

Need help to Secure an ASP.NET Web Application

I'm working on a internal web application (only employees can log in) and need some help figuring out a good approach to handling an individual users permissions to the system. The system itself is in C# / ASP.NET (4.0 / Webforms / Forms Authentication) / SQL Server 2008 and has several different areas which will have varying sets of p...

Cross-page postbacks and back again retaining data from source page

Is it possible to use cross-page postbacks (or a similar method, perhaps Server.Transfer) to post form data (say, Data-set A) to a page, which then allows the user to add some additional information (say, Data-set B) and then postback to the original page the complete set of data (A+B) which then flows through the normal event execution ...

Help with refreshed ASP.NET page clearing public array

Hey all, i am new at everything VB.net/ASP.net so i need some help with a problem i am currently having. I have an ASCX.vb page that lets the user choose someone from a table. Once they do select someone, the page reloads with that persons information into another table below that one where they can submit an order for that person or re...

Connection string for .DBF file don't work on IIS

I am using this connection string to query some .DBF Driver={Microsoft dBASE Driver (*.dbf)};DriverID=277;Dbq=c:\Dbfs; But if i run the application on IIS (7.5) the connection cannot be opened and i get this OdbcException: ERROR [IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified ...

How to read inputstream from HTML file type in C# ASP.NET without using ASP.NET server side control

I have the following form <form id="upload" method="post" EncType="Multipart/Form-Data" action="reciver.aspx"> <input type="file" id="upload" name="upload" /><br/> <input type="submit" id="save" class="button" value="Save" /> </form> When I look at the file collection it is empty. HttpFileCollection Files ...

How Simulate Left And Right Mouse Click In Asp.net Web Application

hi my dear friends : How can i Simulate Left And Right Mouse Click In Asp.net Web Applications ? i found a thread about this issue for win applications but not work on web app... in right mouse simulation i want to see menu bar... thanks in advance ...

File download problem: filename with spaces truncated!

While I am working on code to download file from server using : Response.AddHeader("Content-Disposition", "attachment; filename=" + Server.UrlPathEncode(Path.GetFileName(_Filename))); The problem is while having spaces in the file name, with this code the server split automatically while finding the first space! I'm hoping to know...

ASP.NET 4 VS2010 Web Application Deployment

I must be missing something quite basic here... Trying to release my site to a test server... click on the publish option... and off it goes. The site is 'successfully' to the webserver... the odd thing is none of the code behind files have been copied. Should they be there? Why aren't they? What have I done wrong!?? I've looked for ...

Request page without .aspx

How can you request the root default.aspx without specifying it in the url for your root application? e.g. http://localhost/MyApp/ instead of http://localhost/MyApp/Default.aspx should be able to do both I'm not sure if this is a setting in IIS 7.5 for the application or what. ...

Copy multiple files from client to server c #

I need to copy "N" number of files from client to server with asp.net c # I've done something like that, but it is useless because it takes only server addresses Somebody help me .. Thanks ..!!! private void btnUpload_Click(object sender, System.EventArgs e) { string fileName = ""; ArrayList List = new ArrayList(); string...

Using app_offline.htm to take an app offline while updating dll's fails while updating dll's

So I sometimes use app_offline.htm to take an app offline while I upload a new version. However, while I am in the process of uploading larger dll's, I get the yellow error-screen saying the dll could not be loaded. This seems to be out of sync with my expectations of what app_offline.htm does (stops the app entirely), and also provide...

Best Practices for mapping MVC Controllers to Views?

What are the best practices when it comes to mapping controllers to views? For example, say for the urls mysite.com/login and mysite.com/register...I can have my LoginController and a RegisterController map to Login/Index.aspx and Register/Index.aspx views. Alternatively, my HomeController could handle both of these and map them to Hom...

phantom 302 causing AJAX errors

I have a page that makes multiple AJAX calls to a generic handler page. 9 times out of 10, every AJAX call completes with a 200 ok. However, that one time out of 10, one of those AJAX calls comes back as a 302 Found. I know that 302s themselves are not errors, but on this page every time a 302 comes back, it causes the AJAX call to er...

Customizing ASP.NET Membership Provider to add logging capabilities

Hello, I need to slightly tweak the functionality of the ASP.NET Membership provider to add custom logging functionality. Instead of creating a wrapper class around the methods I wish to modify, I was toying with the idea or creating a custom Membership Provider and override a few of the methods. All the examples I could find would sho...

set cookie to expire at end of session? asp.net

I'm surprised i couldnt find any answers. How do i set my sessionid in my cookie to expire at the end of session? (when the browser closes or the user has been inactive for a period of tie). The two solutions i found were (httpcookie).Expires = HttpContext.Current.Session.Timeout Which gave me a compile error so i dont know if the ...

How can I place one ASP.NET calendar control beside another?

Is there any way to put Two ASP.NET standard calendar controls on Webform, one beside the other? I have been trying for a while to design a WebForm with two calendars controls, but whatever I try they are standing one above the other. Here is how my aspx looks like: <%@ Page Language="C#" AutoEventWireup="true" CodeFile="JedanDoDruge.a...

Publish Error- VS 2010- Configuration File Changed?

I am publishing a web page to a local server through VS2010- I haven't published anything new in a couple days and I haven't made any config changes(I think). I have been following my same process for 4-5 months. Publish shows as succeeded, and my hosted directory on the local machine is showing my changes(I can also debug in VS w/o iss...

A few question about images uploading

I need to upload images to my website, make some image processing(resize, get image size\resolution, convert to jpg format etc ) and then embed it to page of my website. I have a few question: How to check that uploading file is image? Where is better store images - mssql or just folder? How to detect image type. Is MIME trust source? ...

Dynamically update range value(s) for asp:RangeValidator

Validating a date range in a textbox; need to dynamically update the minimum value of the range. When you use a range validator in ASP.NET, javascript gets generated the first time the page is rendered to set the range, and after postback, setting the range values has no effect on the range used. Other than rewriting the validation a...