asp.net

Silverlight 3 released - Has the time come to take Silverlight seriously?

As an ASP.NET developer, I've been eyeing Silverlight from a distance for a while now. But I've been burned by jumping on the Microsoft bandwagon too early in the past when their projects get radically overhauled or binned. I've been reading some good reviews about Silverlight 3.0 recently. So have we reached the point where, as a mai...

Running ASP.Net on a Linux based server

For a developer with a Java background, I am interested in exploring software development using the ASP.NET tools/platform as well. Java web applications (.jsp and servlets) can run on many server platforms. Question: Will a .NET web application be able to run in a Linux based server? Considering the scenario of not being able to use ...

Why does my DataTable always returns "true/false" but never a string?

I'm trying to use a DataTable, filled by a MySqlDataAdapter, which contains a list of comments for a blog entry. For some reasons, if the field "anonymous" is set to "1", the username field is empty and should be replaced with a specified string. The problem I have is that whenever I try to get the value of the field, I get either "true...

Break line in label every X chars

Is it possible to break label to new lines if the contents exceeds label's width? (like it happens in multiline textbox) I know there is a word wrap css, but it's not cross-browser. Or I need to break it manually, by inserting <br> tag every x chars like I do it now (maybe there is a better method): string content = HttpUtility.Html...

better way to find controller name from masterpage view in asp.net mvc

is any better way to find controller name from masterpage view in asp.net mvc? thanks achu. ...

CSS file not getting downloaded in Visual Studio 2008 SP?

Hi guys, This might sound a little wierd, but all of a sudden the CSS and Javascript files referenced in my master page are not being downloaded while the page is being rendered. I am working on a ASP.NET MVC project and things were all fine like half an hour ago! Here is what I have in head section of the master page, <link href="/Cont...

how to handle long text in dropdownlist control in ASP.NET

i have one dropdown list which is pouplated by database . Its value feild contain records id and option feild contain the text of record . But the record text entries are very long and makes my dropdown so long that it totally chnage the outlook of my webpage. when i cut down the width it also cut down the text displayed . Is there any ...

Flash XML config file problems with asp.net MVC

I'm creating an asp.net MVC app, first time I've done this. I have a flash component I need to use in a view. I have included the SWF files etc in the Contents folder and referenced it from my view, the flash file loads when you get to the view, great. The problem occurs because the flash file references and XML file for its configurati...

Incorrect page Render

I trying create a class derivated from System.Web.UI.Page and in override Render i set this code: writer.WriteLine("<![CDATA["); base.Render(writer); writer.WriteLine("\r\n]]>"); My problem is when i try see code generated <![CDATA[ ><form name="form1" method="post" action="Default.aspx" id="form1"> ... </form> ]]> first > after...

Reducing roundtrips to the server/database

When writing ASP.NET pages, what signs do you look for that your page is making too many roundtrips to a database or server? (This is a general question but I say ASP.NET as the majority of my coding is on the web side of things). ...

Log4Net ADO.net Info Buffer

Is there a way I can configure the AdoNetAppender to log every time a value of type 'Error' is reached, and log only the last 10 statements of lower threshold (i.e. info) prior to that statement. Is that possible? I'm running up hundreds of .Info statements for each individual error and I don't need that many... just enough to see what...

ASP.NET MVC Model List in controller

I'm using ajax and trying to pass the Model back, which is a generic List < T >. I tried Model.ToList() but I don't think I'm going about this correctly. I think it is already setup but I just need to find the method or property name to get the List that was posted, which might not work since my Model from the controller contains a cou...

ASP.NET Web Service inside Forms Authentication Application

I have an existing ASP.NET application that implements Forms Authentication site-wide. The application is deployed in multiple instances (e.g., customer1, customer2, test, dev, etc...), with a separate database per instance. SSL is in play. Instance configuration is via an XML config file. I have a new requirement to allow upload/downlo...

Apply CSS to Content Page in Asp.NET

Hi Guys, Normally when we are using Master/Content style pages, we apply the css to Master page so every page child of the master page can use the style but I don't want this,I want I wanna apply css to content page directly instead of master page. Where should I put <link rel="stylesheet" href="css/lightbox.css" type="text/css" media...

What is the best or recommended way to upload an image into db in asp.net mvc?

I am working on an application which will store some entities which have name, price, and an associated image into the database? The image will be a byte field? I googled around, most examples involve upload image into server, and store the file path name into the db, is this the recommended way to do this? From my persptive, it seems m...

Is there a way to bind textboxes in a webform so the data is save as the user types in?

Hello! I have in my webform many TBs bound to a property in the code behind: <asp:TextBox ID="tbFirstName" Text="<%# Contact.FirstName %>" runat="server" /> <script language="c#"> public Contact Contact { get { return (Contact)ViewState["Contact"]; } } </script> <script language="VB"> ...

display the calendar value

how to display the selected calendar value on a text box? i want the help in asp.net or c# ...

Post file directly from byte array in ASP.net.

How do you replicate a traditional POST form (file post) in code, the end goal is to stream a byte array as the file into the posted form, the example below is the form that I am trying to replicate in code. <form method="POST" action="http://export.writer.zoho.com/remotedoc.im?apikey=[apikey]&amp;output=editor" enctype="multipart/f...

Page`_IsValid is set to true if OnClientClick is set

I wrote a UserControl that attaches a Javascript function to a form's submit button. The Javascript function ensures that the page is valid by calling Page_IsValid and then proceeds to execute some code. For the problematic pages, the Page_IsValid is set to true on first load. If I don't set the OnClientClick, Page_IsValid is correctly...

Confirm message at run time in asp.net

Hello, I need to show confirm message box but after some calculations in code? how can I show confirm message at run time? thanks ...