asp.net

Convert website from webforms to asp.net mvc

I have a webforms website and i would like to convert it to asp.net mvc. Mostly as a learning exercise. What is the best way to start here? ...

Arranging dynamically created controls on a web form

Hi. I am a newbie if it comes to web site development. I would like to create a web form that would contain controls defined in an XML file. This means that I am going to read the XML file within the Page_Load function and dynamically create and name all controls as defined in the file. This seams to be very easy. I have, however, anot...

Using Page.IsPostback Within a USer Control Wrapped in an Update Panel

I have main page into which i load a user control with a grid and add/edit link buttons. If I bind the grid by setting the datasource and calling the datebind() method in the page load event then it sets properly. However, I want to keep the selected row between postbacks, so I wrap the bind code in "if (!Page.IsPostBack) {}" as usual....

I can't find ASP.Net MVC application in VS 2008

When i click on new project, i dont see ASP.NET MVC Web Application as it describes in: http://www.asp.net/learn/mvc/tutorial-21-cs.aspx does anyone know why i wouldn't see this? I have vs 2008 sp1 ...

asp.net handlers and extensions - am I doing it incorrectly?

I have a requirement on my new project to serve up some "hidden" assets (actually just stashed in the App_Data directory) after a certain date. Before then, they should act like they aren't there. I've done this kind of thing a hundred times with Page object, but as I started work on this, I thought I'd look into handlers. Having neve...

Render User control as string template

what do you think of rendering user control as a string template, basically an implementation like Irenderable implementation do you guys think it has any cons. One of the pros that i came across was that i can use my user controls to simply return the required HTML for ajax calls. ...

ASP dropdownlist city selector

Hi, I have an asp dropdownlist loaded with cities/countries. They are loaded directly in code <asp:ListItem Value="MIA">Miami, Florida</asp:ListItem> I would like to extend the control with Ajax in order to allow a user to start typing and show similar matching options from a dropdownlist below. Is this possible using this control and...

How can I print a value in my page from Database

How do I display information in my page (take it from DB) in asp.net 2008 Currently I use GridView, but it display the information in a TABLE. I want to display it in a normal line. for example: I have this table in my DB http://www.rofof.com/img2/4jpqfn26.gif I want to print an information in my page as: You are A and your ID ...

RegularExpressionValidator doesn't detect empty strings.

I have the following regex set as the ValidationExpression property on a RegularExpressionValidator in a web form. When I enter an illegal character in the validated control, the validator detects it and shows an error message. <appSettings> <add key="categoryPattern" value="^[a-zA-Z0-9_+\-() ]{1,50}$" /> </appSettings> My valida...

Can't see my picture that I use in my webSite

hello. I use a template for my website and I fill its cells with an Image control and set that with the URl of picture, but when I upload my website I can't see that Picture. I Created a new folder for all Images and use Master page for this website. LINK : http://www.aalaa.ir/az/ ...

.NET MVC or just plain old ASP.NET?

This is a shoutout as I've been spending the last few days learning about .NET and the process has left me a little confused rather than enlightened. Just as a background info, I have knowledge of PHP (have even used CakePHP to create a whole app rather easily) and Rails. I am wondering if I should pursue ASP.NET or should stick to l...

File imported into App_Code isn’t referenced

Hello, Q1 A) I’ve created a new .cs file, declared a class inside it and then save it on my disc. Now according to my book, I should be able to import this file into App_ Code folder of a website application ( via Website --> Add Existing Item. BTW – since file was copied into root folder of a website, I had to move it into App_Cod...

Website --> Add Reference also creates files with pdb extensions

Hello, Q1 Any assemblies stored in Bin directory will automatically be referenced by web application. We can add assembly reference via Website --> Add Reference or simply by copying dll into Bin folder. But I noticed that when we add reference via Website --> Add Reference, that additional files with .pdb extension are placed inside ...

Is supporting active directory in a web application difficult when currently build with forms auth?

Hi, I have a web application that currently only supports asp.net forms authentication. My user business logic currently is like: Users.GetUserByID(userID); Users.LoginUser(username, password); i.e. it is pretty modular and I hope supporting active directory won't be difficult. Is it possible for me to support both AD and forms? If...

Signon types for a .net web application

Hi, Other than forms authentication, what are other common forms of authentication that an application should ideally support? Is it just active directory or is LDAP a must also? ...

how to validate dates in asp.net

Hi, I have been having this issue with dates since "ever" I live in a country where we use the british date formats e.g. dd/mm/yyyy but everytime I try to do a query to a sql db hosted in a US server, 100% of the time I come accross to errors. Convert.ToDateTime("2007-17-5") produces an error where as Convert.ToDateTime("2007-5-17") ...

FormView on a Master Page can't see databound controls through ContentPlaceHolder boundary

I have a number of similarly structured FormViews. In an effort to avoid duplicate markup, I've created a master page that contains the FormView, and placed a ContentPlaceHolder inside the FormView. The specific databound controls - which are the only thing that change from page to page - are then on the page that uses that master page. ...

How would you send InitParameters to Silverlight in an asp.net mvc app?

Previously, I was passing information to a Silverlight control inside of the Page_Load method. i.e. protected void Page_Load(object sender, EventArgs e) { MainContainer.InitParameters = "info=" + CurrentUserID.ToString(); } In MVC, without the concept of a code-behind, I've passed the user ID as part of the model, but the followin...

Web Deployment Projects tool and Web application project

Hello, Q1 - As far as I know, Visual Studio doesn’t use aspnet_compiler.exe when compiling web application projects. And since Web Deployment Projects (WDP) tool is only used for manipulation the output created by aspnet_compiler.exe, I don’t understand how VS 2008 also has an option for using WDP with web application projects?! Q...

Using Insert throws Exception on Datetime field

When trying to execute an Insert comment using the Insert CLass I get the following Exception: The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value. I am uing the following globalization settings: <globalization uiCulture="en-AU" culture="en-AU"/> And my date format is :"dd/mm/YYYY" ...