asp.net

Mobile Web Development ?

Hi - I have an existing website that I need to develop a small portion of for mobile devices. For reasons that are not in the scope of this entry - I am using the Microsoft platform and tools - VS2008, ASP.Net, VB.net, .Net AJAX Framework, jquery. I have 2 questions: What is the best page size (Height and Width - mostly width) to m...

Adding custom membership to forms

I have a site that uses the asp.net membership tables (ASP 3.5 site). I am going to use an excel sheet to periodically add users to the membership tables and I want to upload all the excel information via a form. I used a little form app to process the excel sheet and am now ready to add the information to the membership tables. Is t...

ASP.NET site map configuration error

I have received this error, but don't know what it means: System.Configuration.ConfigurationErrorsException: Exactly one <siteMapNode> element is required directly inside the <siteMap> element. Can you help me? ...

problem with asp membership

i have the following code: if (Membership.FindUsersByName(username) == null) { Membership.CreateUser(username, password, email); } if (!Roles.RoleExists("USR")) { Roles.CreateRole("USR"); } Roles.AddUserToRole(username,"USR"); Data is being inserted in th...

How do I get javascript onto a control which might be initially hidden in ASP.NET?

I have a control that on 1 page is initially shown, but on another page is initially hidden. For the page that initially shows the control, the javascript in the control works fine, but for the page that initially hides the control, the javascript doesn't work. I've ended up registering the javascript in the code behind using: this.Pa...

Any idea why this ASP.NET C# code to send http request is not working?

Code is below, when I hit the page with: http://ryan.local.testmode.com/timecrunch/bctimepost.ashx?project=2593059&amp;person=2831215&amp;date=04/16/2009&amp;hours=2.5&amp;case=555 it just sort of hangs with the loading bar moving slowly forever till I stop it, did I forget to do something? I can't figure out which line of code is use...

Source control - How to version resources that are shared across projects

We use Team Foundation Server and have numerous ASP.NET Web Application Projects. Each of the Web Apps uses a custom content management system that we've developed in house. The CMS is itself, an ASP.NET web app. When deployed, the CMS resides in a subdirectory, such as "/Admin". The CMS is comprised of .aspx and ascx files, and the ...

Why do controls get populated with postback data twice - during LoadPostBack and during...

Hello, Controls are populated with postback data during LoadPostBack data Stage. If dynamic control is not created and added to control tree during OnInit stage, but later, then control won’t get populated with postback data, as evident by the following code, where Label1 will display an empty string: public partial class _Default ...

How should I detect which delimiter is used in a text file?

I need to be able to parse both CSV and TSV files. I can't rely on the users to know the difference, so I would like to avoid asking the user to select the type. Is there a simple way to detect which delimiter is in use? One way would be to read in every line and count both tabs and commas and find out which is most consistently used in...

Filer DataTable to exclude DBNull.Value

I receive a DataTable from excel file and data in the first Column looks like this: 11129 DBNull.Value 29299 29020 DBNull.Value 29020 I'm using LINQ to select distict and it works if there are no DBNull.Value values as below. albumIds = dt.AsEnumerable().Select(p => (int)p.Field("F1")).Distinct().ToArray(); But if DBNull.Value p...

Server-side Batch process in a shared hosting enviroment

I'm writing a website that will be hosted on a shared hosting environment. As a consequence, I won't have any access to things such as the task scheduler. The website needs to perform various checks on a half-daily basis. What is the best way of firing these tasks in this scenario? The best two things I could think of where: Fire the ...

Is it possible to detect a mobile browser's GPS location?

I am making a web site targeted at mobile phones and would like to get the user's current GPS latitude/longitude when they visit my default page so I can show them results in their area. Is this possible using ASP.NET? See Also Get position data from mobile browser ...

ASP.NET Store uploaded file sql server table

How do you store a file that was uploaded by an ASP.net webform into a sql server 2005 varbinary(max) field? Here is what I have so far: protected void btnUpload_Click(object sender, EventArgs e) { for (int i = 0; i < Request.Files.Count; i++) { StoreFile(Request.Files[i]); } } private void StoreFile(HttpPostedFile...

Is it worth using Debug.Assert in ASP.NET?

It seems like a fairly large hassle to set up a proper debug environment in ASP.NET and I'm just wondering if using Asserts are the way to go or not. I've read a bit and saw that you need to modify your web.config to properly use Asserts. Is this usually the best way to go or are there other methods of debugging that might be easier to u...

when is using Cache is to much ?

hi, i am really struggling finding the best solution, what is really confusing me is as long as .net framework purges low priority cached items why should i worry about memory ( i know it is a dump question) ? can i really constrain an ASP.net Caching to use certain amount of RAM, not from IIS cause my site is on shared hosting, also ...

BinaryWrite vs WriteFile

What should I use for writing a file to the response? There are two different options as I see it. Option one is to read the file into a stream and then write the bytes to the browser with Response.BinaryWrite(new bytes[5]) Next option is to just write the file from the file system directly with Response.WriteFile. Any advantages/disa...

Generated image display vs. download

I have an MVC action that pulls an image from a database and sends it in the response via the File(byte[], string) method. When I navigate to the action in my browser, it downloads the file rather than display it in the browser. I'm setting the file and setting the content type to "image/jpeg". Is there another header that needs to ...

running the build action of web deployment project from final builder

hi, as you know Final builder is an outstanding build automation program, i want to use it, to automate moving the aspx, ascx, image files, css, dlls, etc... after the build of web deployment, this will ease so much the work for me instead of copying the file manually. better yet how can i create a shortcut in visual studio so when i cl...

How can I rotate a line of text each page refresh?

Right now, Reddit is down. Every time you go to it, it displays a logo and below it a funny message. Every time you refresh the page it displays a new message. How could I write something simple that ~rotates~ (not random) a line of text on the page every refresh? I'm using ASP.NET MVC but if there is a JavaScript solution to this ...

Rectifying JScript runtime error

Hi, When i am running the application,i got an error as follows: Microsoft JScript runtime error:Sys.ArgumentTypeException:Object of type 'Sys._Application' cannot be converted to type 'Sys._Application'.Parameter name:instance ...