asp.net

in ASp.NET MVC, How do you remember a dropdownlists state?

I have this action: public ActionResult Add([Bind(Include = "Title,Description")] product product2Add){ --SNIP-- } I'm using a view model pattern where I've created a special "AddProduct_ViewModel" class that contains my product class and anything else I need in my view. That includes 2 dropdownlists; one that does a DB lookup of all ...

Couldn't load File or Assembly

I have a web application in .Net in which I use Ajax controls in some pages. Those pages are working in localhost, but when hosted, the pages in which Ajax included shows following error. Server Error in '/Allforkids' Application. Security Exception Description: The application attempted to perform an operation not allowed by the secu...

How do you refer to a membership provider user in a SQL table?

When I create SQL tables and I want to refer to a membership provider user in ASP.NET, what type of field do I use and how do I get the value from the user? ...

Is there a way to find out the age of an asp.net session?

How do I find out how old an asp.net (3.5) session is? ...

Catch 404 exception from StaticFileModule in IIS7 integrated pipeline mode

Hi ! Does anyone know if there is a good programatic way (not using the CustomError settings) to catch / handle an 404 error coming from the StaticFileModule in integrated pipeline mode on a IIS7 ? /b ...

How can I use a session in an ASP class file?

I'm binding a menu from a database. In the SQL query, I am passing where userid="System.Web.HttpContext.Current.Session["uid"].ToString()" It is working, but for every login it is the same. What can I do, please? ...

selected value does not change in asp:Dropdownlist

I have a simple dropdownlist(ffg)... <asp:DropDownList ID="DropDownList2" runat="server" AutoPostBack="true" BackColor="LightSteelBlue" Font-Size="X-Small" OnSelectedIndexChanged="DropDownList2_SelectedIndexChanged1" Style="z-index: 102; left: 37px; position: absolute; top: 85px" Width="331px" </asp:DropDownList> which I b...

ASP.NET Membership Provider - Specify settings in database rather than Web.config

I'm using the ASP.NET membership provider for authentication of users in my web app. I want to do two things To enable the client to configure settings such as maxInvalidPasswordAttempts and passwordAttemptWindow without having to know about the web.config (e.g. through a UI) To have the ability to share these settings across several ...

Dynamic Data Entities ID Column visible false?

There are Two kind of template in asp.net 3.5 1) Dynamic Data Web App. 2) Dynamic Data Web App. Entities My SQL database has got Customer Table ; Columns : ID, Name,Surname vs. if you use first one(Dynamic Data Web App); you can not see ID column(Customer Table) (Linq to Sql) But if you use second one(Dynamic Data Web App. Entities)...

GridView no column present even after DataBind()

Hi Guys, I have a DataView that was already populated with data (Verified this to be true). I then set the DataSource of my GridView to that DataView and called the .DataBind() Function. Right after binding, I checked the column count of my GridView (grid.Columns.Count) and it shows 0. But it is showing the right output with 15 column...

Linq update record

how update a record on specific id in linq + asp.net c# ...

How to separate model, view and controller in an ASP.NET MVC app into different assemblies

Hi, At the moment I am trying to get into the ASP.NET MVC framework. For most of my test applications I used a single assembly/project. This worked fine for some smaller applications. Then I wondered how I could place my model, controller and view classes into separate assemblies? In really big web-applications it is not very realistic ...

CS0016: Directory invalid error... I solved it but I don't understand the solution

I've been battling for two days tracking down a mysterious error when compiling an ASP.NET website. The error is the (quite famous) CS0016: "Unable to write to output file [filename] - directory is invalid". I have discovered after two days of debugging that the cause of my problem is that the NetworkService somehow does not have the ne...

How to extract data from an online API?

It's a novice question so be kind to me :) How can I consume a php API in ASP.NET? This API returns an XML document. It is also capable of returning JSON. The output is shown below XML <?xml version="1.0" encoding="UTF-8"?> <Address> <Country>US</Country> <City>Seattle</City> <Result>Done</Result> </Addre...

Asp.net: Custom Role and Membership Provider, LoginStatus Control not reacting

Hi All Involved in a project where one half of the team are building the db and web services layer and we are builing a separate, front end, web service consuming site. We are building a custom role and membership provider which will operate via the web services layer. Just doing some early prototyping, setting roles, checking page pe...

iis 7.0, module order change

"the entries cannot be reordered because one or more of them have been locked in the parent file " in iis 7.0 manager when i try to change the order of modules in my application it gives this message. how can i change the order of the modules ? is it possible? ...

Avoiding SQL injection without parameters

We are having another discussion here at work about using parametrized sql queries in our code. We have two sides in the discussion: Me and some others that say we should always use parameters to safeguard against sql injections and the other guys that don't think it is necessary. Instead they want to replace single apostrophes with two ...

How to generate fake postback with javascript?

I have Dropdownlist on my page and its selectedindexchanged method created in code behind file (.cs). I wanted to create fake postback with A tag (onmouseover event). First i viewed source of html. <select name="ctl00$cpholder_ana$ddlFaturaNolar" onchange="javascript:setTimeout('__doPostBack(\'ctl00$cpholder_ana$ddlFaturaNolar\',\'\')...

ASP.NET + Write Response to File

Hello, I have an ASP.NET web page that I want to write the contents out to a static .html page. The code to do this is being added to a web service that is part of the same application as the ASP.NET web page. My question is, how do I create a static .html page from a ASP.NET page request? Preferably, I would like to do this without usi...

Data Access Application Block and Transaction Scope will separate database objects use the same connection

I'm using System.Transactions and Transaction scope for my transaction handling in conjunction with the Enterprise Library Data Access Application Block. In some cases I'm using separate instances of the Database class within the transaction. The connection is to the same database though. I'm wondering if the application block will re...