asp.net

HTTP or SQL Server-based solutions for sql injection

I'm working with SQL Server 2005 and Windows Server 2000 and wonder if there are any 'automated' ways of blocking SQL Injection attacks while I shore up my code. Some have suggested that there are ways to: Put in some kind of ISAPI or HTTP module that filters request post and querystrings for injection-oriented symbols and fails the r...

Is there a benefit to always having an ID property?

In asp.net is there any benefit to including or not including an id property? Assume for this question that there is no programtic reason why we need an ID. (We are not manipulating the control in code behind, nor on the client). My personal preference is only to include an Id property when I have a reason to manipulate the control and ...

How do I link to an ASP:DetailsView's Insert mode via an external page

Unlike many of the ASP.NET documentation and examples, I'm doing a gridview list on one page, and it links to a 2nd page to do the edit/update view, sending the ID for the record in the GET string. On my edit/update view, I'm using an ASP:DetailsView for viewing, editing and inserting records. All of this works fine. On the detailsV...

Is ASP.Net a technology suitable for high-load sites?

That's the question... Do you think ASP.Net is a technology suitable for high-load sites? Do you know any populer sites -apart from stackoverflow, of course- built with this technology? Thanks. ...

SqlDataSource and Oracle DataProvider I can't seem to be able to use the sqlDataprovider with odp.net

I want to be able to run my SqlDataProvider against an oracle stored procedure. I can use Microsoft's Oracle Provider but that wouldn't allow me to call a stored procedure. has anyone been able to get this to work? I particularly want to be able to use declarative data binding. I have been able to programatically create a DataTable but I...

Remove "$" before ASP.Net RangeValidator script executes.

How can I force the input's onchange script to run before the RangeValidator's script? I want to prevent a failed validation when the user enters a dollar sign or comma. function cleanUp(str) { re = /^\$|,/g; return str.replace(re, ""); // remove "$" and "," } <input type="text" id="salary" runat="server" onchange="this.value=clea...

GridView - Show headers on empty data source.

In C# how do I still show the headers of a gridview, even with the data source is empty. I am not auto generating the columns as they are all predefined. Currently what I am doing is the following. Get a DataTable back from a stored procedure, then set the DataSource of the gridview, and then call DataBind(). This works fine when I...

XML Webservice for iSeries

I need to pull item quantity from a DB2 database from an aspx page and then update after the quantity has been changed. I want to create a web service that will send XML data and then parse back to my page. Looking for any good references or examples that anyone has possibly tried. ...

Pass objects to silverlight through server side asp.net code

Is it possible to pass objects (serializable classes or other ways) to a Silverlight control through asp.net server side code? ...

Close a browser window of an ASP.NET and AJAX application

What is the best way to close a browser window of an AJAX ASP.NET application after the server-side has been executed. I found this solution, but it seems a little complex for what I want to accomplish. Or is this the best way to accomplish my task. UPDATE: I have to close the window after the button is pressed UPDATE 1: I tried the ...

What would make a callback request hang?

I am working on a project that uses the asp.net ajax control toolkit and all my callback requests are hanging till the request times out. When I step through the code all my code executes then the hanging occures. Right now I am looking for possible reasons why this might happen. ...

Where can I find a Good Sample ASP.NET Database Driven Web Application?

I would like to learn the best practices to employ when creating a database driven web-application. I prefer to learn from examples. What is a good sample application that I can download and run to learn this: I am looking for: Should be written in C# (preferably) Should contain a complex database design (parent child relations, etc....

Using a DetailsView in ASP.Net when using an ObjectDataSource or a SqlDataSource

How do you use a DetailsView control in Asp.NET? How do you change the labels to something other than the database field name? How do you hide some of the fields from the user? (which you need to query for because they are the identity fields - row-id, which you dont want the user to see)? ...

How do I stop execution going into a UserControls PageLoad Method?

I have a MasterPage, with my Usercontrol inside a div. I can set visible=false to the UserControl and to the containing div, and this works fine. But the Page_Load of the UserControl is always hit. Is this by design, or am I missing how to stop page execution going into the Page_Load method of the UserControl. ...

ASP.NET MVC - How to explain it?

I am trying to teach ASP.NET MVC to students (undergrads) that have been studying ASP.NET for the last 8 weeks (I know that doesn't sound like much time, but the class is 4 hours per day, 5 days per week with Labs, Quizzes, Exams, and Wrestles). I haven't gotten the question yet...but I know it is coming... When would I use MVC instead...

Adding Controls using Javascript and get Their Value from codebehind

Hi, I wanna add server controls by using javascript. The main purpose of why I want is to add controls without any postback and get them in code-behind. ...

ASP.NET MVC Views - Can I use code-behind

I am new to MVC and I notice that the view pages can look pretty nasty with all the intermixed script tags. Does it make sense to generate the HTML in a method in the view code-behind and then just insert the string result of the method as a single bit of script? For example: <div><%= GenerateTonsOfHTMLFromSomeIEnumerable() %></div> Is...

What's the difference between <system.web> and <system.webServer>?

Every time I have to add a handler or module for ASP.NET w/ IIS7, the instructions always tell me to put it into two places, the system.web and system.webserver. <system.web> <httpHandlers> </httpHandlers> <httpModules> </httpModules> </system.web> And this: <system.webServer> <modules> </modules> <handler...

Logging user actions on ASP.NET site?

Hey, What I want is system which is logging methods called by users and their returning values if they have. For example a user logs in and he/she is surfing on my web app. then naturally he/she clicks on somethings and so he/she fires up some event method whatever then my log system must log this method name and time stamp combined wit...

How to pass parameters to a Web Method?

How to pass parameters to [WebMethod] in Asp.Net(C#) ? Can some one please explain the same with the help of an example? ...