asp.net

How to populate an updateable FormView from an EntityDataSource with filter.

I'm trying to create a member page for updating account details. I want to populate a form with the member's data, but I don't know how to set a filter on the EntityDataSource to limit the query. When I set the select statement based on the member ID, I get the error Select cannot be set if EnableDelete, EnableInsert, or EnableUpdate...

Any reason why this LINQ to SQL update query is not working . . .

Somehow this update code is not working: Here is my Controller code: private UserRepository repo = new UserRepository(); [AcceptVerbs(HttpVerbs.Post)] public ActionResult Edit(int id, UserInfo user_) { try { repo.UpdateUser(user_); return RedirectToAction("Index"); } ...

How many characters to create a byte array for my AES method?

Hi, I am using the AES methods here: http://msdn.microsoft.com/en-us/library/system.security.cryptography.rijndaelmanaged.aspx I want to have a string value that I will convert to byte array and pass it to the AES encrypt method. How many characters should the string be to produce the correct byte array size that the method expects? ...

Using ASP.NET label as SSRS report parameter

I have SSRS report with its own datasets coming straight from the database. I have the report on ASP.NET application page. The application page header has the username and user region details defined in the master page. Now, I want to read this region id label from the ASP.NET page and build my report accordingly. Basically build...

Questions on passing and formatting JSON to HttpResponse

I just wanted to clarify a few questions I have. I'm building a JSON string and returning it using context.response. I'm just calling a url to an .ashx handler and trying to return JSON. Here's how I have approached it so far: List products = GetCarolProducts(); List images = new List(); foreach(Product p in products) { stri...

Formatting JSON in ASP.NET HttpResponse

I'm sending back a bunch of image tags via JSON in my .ashx response. I am not sure how to format this so that the string comes back with real tags. I tried to HtmlEncode and that sort of fixed it but then I ended up with this stupid \u003c crap: ["\u003cimg src=\"http://www.sss.com/image/65.jpg\" alt=\"\"\u003e\u003c/li\u003e","...

HttpContext.Current.User.Identity.Name is always string.Empty

Hi I use a custom MembershipProvider. I want to know the current username during an application scenario, but when I try accessing HttpContext.Current.User.Identity.Name it always returns string.Empty. if (Membership.ValidateUser(tbUsername.Text, tbPassword.Text)) { FormsAuthentication.SetAuthCookie(tbUsername.Text, true); bool...

HtmlEncode in my .ashx

How can I HtmlEncode my JSON from within my .ashx? context.Response.Write(HtmlEncode(jsonString)); I added System.Web.HttpUtility using to the top of my .ashx but no luck ...

ASP.NET Dynamic Data setting the default value of a Dropdown list

I have a dropdown list (FK) which I would like to set and display a default value based on a login userid. Can you please tell me how to do it? I only want to affect the dropdown filter that appear at the top above the Gridview. Thanks Nikos ...

Web Deployment

Hi, We had an asp.net 1.1 application that we recently migrated to 3.5. We are facing some problems when we do code modification on the migrated application. Here is what is happening In the asp.net 1.1 application we have the page directive codebehind="ePC.aspx.cs". This migrated fine. We made some code changes to the .cs file. Say fo...

What are the best sites to download decent free sample/demo websites in vb.net, asp.net, c#

I want to have a look at the code in sample/demo websites to improve my knowledge. it would be great to see a function of a website and then be able to see how the code makes it happen. I am not so concerned with the css or html more the vb.net or c#. Are there any good sites that have a selection of different types of websites that can...

web application projects v.s. web site projects

Hello everyone, I am reading from the following link, http://reddnet.net/code/asp-net-web-site-vs-web-application-project-part-2/ My two confusions, What is the so-called issue "No control over your namespaces" cons from a web site project? Could anyone show me a sample to illustrate this issue please? What is the so-called issue "I...

Webforms Routing ignore Elmah

I am having some trouble getting Elmah to work with url routing in an asp.net webforms application. Elmah is mapped to "elmah.aspx" and I have tried a couple of variations on: routes.Add(new Route("elmah.aspx", new StopRoutingHandler())); Is there a way I can ignore all .aspx pages? ...

Forcing ASP.NET GridView's pager to show

Hello, is there some way to force the gridview's pager to show up, even when there is only one page of data on screen? I'm building a gridview-based control with a custom pager (w/dropdown for pagesize) and everything is working fine, except when user selects pagesize that is larger than the current row count of the grid. At that point...

Precautions when developing ASP.NET application on x86 computers but target computer is 64 bit (Windows Server 2008)

We have to deploy our application on a Windows 2008 64 bit server. As the application is already running for over one year on a Windows 2003 server installation, we know everything is working fine. We are still developing on Windows XP. But installing it on a Windows 2008 64 bit system make me feel a little bit uneasy. So are there any...

SessionState out of memory exception

Hi, I am getting "Out of memory exception" when assigning values in session variables. The session values are maintained in stateserver. How to increase the size of the session stateserver memory? or any other option? Thanks, P.Gopalakrishnan. ...

db4o running in asp.net Medium Trust environment

I am using the embedded client/server version of db4o (I called OpenServer() instead of OpenFile() method) so that I can host an asp.net website that will have several users reading and writing to the database simultaneously. The only issue is that the webhost that we use is a medium trust environment so it's throwing an error stating t...

ASP.Net MVC - Posting dynamically created fields to an action

Hi, I have a page that has fields dynamically loaded via JQuery. It allows a user to add additional fields and data on the fly. Currently that data is collected via JQuery and sent via an Ajax request to be dealt with. But is there anyway of doing this in a normal action post? Currently it seems that the dynamically inserted fields are ...

Log4Net doesnt log or error

I have been attempting to get log4net logging in my asp.net web application with no success or any noticable errors. I am attempting to use the ADONetAppender appender with the following config: <log4net> <appender name="ADONetAppender" type="log4net.Appender.ADONetAppender"> <bufferSize value="1" /> <connectionType value="System.Da...

Is there a elegant way to implement selectable tabs/menus in ASP.net

I am struggling to find a way of implementing a tab style menu system in ASP.net. The tabs look great from the HTML/CSS standpoint and are implemeted in the Master page so I don't have access to the body tag from the content page. what I am trying to work out is how to vary the "active tab" based upon the page the user is accessing. I c...