asp.net

Assigning a value (or any other parameter) to asp:checkbox

i'm pretty sure it's not possible, but i'll throw this out there anyways. I have about 10 asp:checkbox controls on the page, and I need to go and update the database every time any of them gets checked/unchecked. Right now i have all of them tied to one event handler that fires on CheckedChanged, then i cast the sender to Checkbox a...

Where does an uploaded file in ASP.Net 2 go?

I'm building a portal that will allow users to upload files. I need to make sure that these files do not contain viruses. My ideal solution would be to have the host OS AV keep a watch on temporary folders and scan any incoming files. When a file is uploaded in ASP.Net 2, does it get written to disk in a temp folder, or is it persiste...

Parse String to Integer (come hell or high water)

I need to maintain a legacy VB.Net web application. Data typing is, I would say, inconsistent. Especially, there are data that is stored sometimes as integers and sometimes as strings and I have to parse strings to integers reliably. If parsing goes wrong it should always return 0. The problem is, I can't use any of the .NET/VB.Net pars...

SQL Server (2008) Pass ArrayList or String to SP for IN()

Hi All, I was wondering how I can pass either an ArrayList, List<int> or StringBuilder comma delimited list to a stored procedure such that I find a list of IDs using IN(): @myList varchar(50) SELECT * FROM tbl WHERE Id IN (@myList) In C# I am currently building the list as a string which is comma delimeted; however when using...

ASP.NET AJAX - Check for async postback via JavaScript

Does anyone know the script necessary to check to see if you are in a anync postback via JavaScript? Thanks. ...

ajaxified auto suggest

I have a search module with Auto Suggest feature to build in ASP.Net The search criteria is Training Name and there is a table in database that stores trainings. The size would be as large as 30,000 trainings in the table so I have to be very careful in selecting the approach keeping in mind the performance. There could be about 3000 u...

Passing eventArgs to javascript from ASP.NET C# from OnClientClick

Hi, I have an asp button on my page, in the Page_Load on the code behind, I am binding some javascript calls as follows. btnExample.OnClientClicking = "functionOne(1,2);"+"function2()"; The problem is I would like to be able to pass the EventArgs passed to the Page_Load as in function2() I wish to call... eventArgs.set_cancel(true)....

Turn off request validation programmatically

I have a control that I'm writing where I want to turn off .NET's inbuilt request validation that prevents XSS attacks and similiar sort of nasties. The control allows the owner of a web-site to adjust the content on that page. They can potentially enter markup if they want to. Since it's their site to edit, they must be able to stick w...

How to Integrate ASP.Net Webforms website with an ASP.Net MVC web application?

How would I run both of them under one main website, say www.example.com, which is written and deployed using a Visual Studio ASP.Net MVC web application project, and where an ASP.Net Web Forms website, would run from a subdirectory of the main site, say www.example.com/myapp? ...

How to modify Bind("MyValue") in asp.net

Hi, I'm having headache with Time values and multiple time zones. I'm storing new DateTime values in UTC time, but I face problem when I try to modify them using LinqDataSource and GridView. I can easily show correct time in <ItemTemplate> <asp:Label ID="Label1" runat="server" Text='<%# TimeManager.ToLocalTime((DateTime)Eval("Order...

Organizing classes into namespace in the App_Code folder not working as expected.

I have a couple of classes that I have created for my web project and I am going to store them in the App_Code folder. I don't want to store all the classes in the top level (no namespace) but want to organize them into namespaces. So far this does not seem possible because when I use the "using XXXX;" namespace statement it still can't ...

Can I modify/extend a production web service without affecting existing clients?

I am currently calling a web service that returns a service defined class which I am interpreting in my application. I'm considering asking the vendor of this web service to add a property to this class which will make my life as well as their other clients lives a lot easier. To be clear I'm not asking them to modify existing behaviou...

SQL Server 2005 and APP_DATA

I was once told that instead of having to have my host register a SQL Server database file + user/password it is possible instead to put my MDB file into my website's APP_DATA and connect to it directly. How do I do this? I tried using the SqlConnection's connection wizard and set DataSource : Microsoft SQL Server Database File (SqlCli...

Grab code behind property in Javascript?

I would like to burn in a c# code behind property into the javascript alert(<%= someProperty%>); . For some reason it is not working. Is there a way you can burn the codebehind property into the javascript? thanks ...

How do you clear your Visual Studio Cache on Windows Vista

I have a problem where my ASP.NET controls are not able to be referenced from the code behind files. I found this solution: http://stackoverflow.com/questions/38670/asp-net-controls-cannot-be-referenced-in-code-behind-in-visual-studio-2008 But I cannot seem to find my Visual Studio Cache to clear it. I am using Visual Studio 2005 o...

Nested Usercontrols and ViewState

I have a UserControlParent that dynamically loads UserControlChild. In the UserControlChild, I store a value using the ViewState object by doing a ViewState["count"] = myCount; On Postbacks, the ViewState returns a null. Is this because the UserControlChild is being loaded dynamically? If it helps, the UserControlParent is loaded dy...

Organizing a Web Application

How do you guys organise your asp.net web applications? Do you have you classes in the applicaiton, or in a seperate class library? How do you split your classes into name spaces, by type, function, tier? I've got a great working applicaiton, but the codes a bit messsy, I want to look at the best way to organise it. ...

Display loading message while Exporting a results set to Excel

Hi Everyone, I'm using ASP.NET and C# and am exporting a very large results set to Excel. While my export code is running I would like to show a "loading" animated gif so the users will know their request is processing. I've been trying to do this with multithreading, but I am not very familiar with it. Can anyone guide me in the rig...

Extracting embedded Query in crystal reports in ASP.net

Is there a way or a DLL using which we an extract an embedded query from crystal reports. I was able to do the same using CRAXDRT in windows based application, but when i try to do the same thing in ASP.net, entire application hangs. ...

DropDownList Postback on ENTER Keypress Not Firing the Server-Side Event

Greetings! I have a simple navigation menu consisting of an asp:DropDownList and an asp:Button. Users select an item from the dropdown and click the button to go to the new URL. I'd like to be able to able to support when users hit the ENTER key when a dropdown list item is selected so that it replicates the behavior as if they've cli...