... Web Controls 6 34 SiteMapPath 6 34 Menu 635TreeView 640 HTML Server Controls 643 HtmlAnchor Control 644 HtmlButton Control 644 HtmlForm Control 645 HtmlGeneric Control 646 HtmlImage Control 647 HtmlInputButton ... 613viii Build YourOwn ASP. NET 2.0 Web Site Using C# & VBSummary of ContentsPreface xi1. Introducing ASP. NET and the .NET Platform 12. ASP. NET Basics 333. VB and C# Programming Basics 51 4. ... View 42 7 Using the GridView Control 42 8Customizing the GridView Columns 43 5Styling the GridView with Templates, Skins, and CSS 43 6Selecting Grid Records 44 0 Using the DetailsView Control 44 5Styling...
... JavaScript, and CSS. The server is entirely responsible for processing the server-side code. Build YourOwn ASP. NET 3.5 Web Site Using C# & VB (www.sitepoint.com) 14 BuildYourOwn ASP. NET ... access using ADO .NET s data source controls. We’ll then compare this approach with that of using data sets to access data in a disconnected fashion. In this section, you’ll Build YourOwn ASP. NET ... execute the project again, and see the current date and time, as depicted in Fig-ure 1.16. Build YourOwn ASP. NET 3.5 Web Site Using C# & VB (www.sitepoint.com) 2 BuildYourOwn ASP. NET...
... . . . . . . . . 245 Build YourOwn ASP. NET 3.5 Web Site Using C# & VB (www.sitepoint.com) 18 BuildYourOwn ASP. NET 3.5 Web Site Using C# & VB If you’re using VB .NET, you’ll need to ... your database server Figure 1.6. Changing server settings with SQL Server Management Studio Build YourOwn ASP. NET 3.5 Web Site Using C# & VB (www.sitepoint.com) 4BuildYourOwn ASP. NET ... . . 701 Build YourOwn ASP. NET 3.5 Web Site Using C# & VB (www.sitepoint.com) 5 Introducing ASP. NET and the .NET Platform ■ ASP. NET makes it easy to reuse common User Interface elements...
... which includes special characters such as semicolons (;), curly braces ({}), and backward slashes (\). Fortunately, once you get accustomed to C# , these details will quickly melt into the background. ... the Common Language Runtime (CLR) recognizes. When you create the code for an ASP. NET web form, it’s changed into IL using the C# compiler (csc.exe) or the VB compiler (). Although you can ... only exception is if you choose to stack multiple case vi■ Contents At A GLAnCePart 4: Working with Data 42 3 ■Chapter 14: ADO .NET Fundamentals ■ 42 5Chapter 15: Data Binding ■ 47 3Chapter...
... you cannot enter the currency symbol. If these limitations concern you, you can use either the RegularExpression or CustomValidator controls to perform a more flexible data type check.You can ... against which to compare.. ControlToCompare—The ID of a control against which to compare.The page in Listing 3.10 illustrates how you can use the CompareValidator to perform a data type check. The ... you build an auction website, you can use the CompareValidator to check whether a new minimum bid is greater than the previous minimum bid.Finally, you can use the CompareValidator to compare...
... Instance=True”;public void ProcessRequest (HttpContext context) { context.Response.ContentType = “application/msword”;SqlConnection con = new SqlConnection(conString);SqlCommand cmd = new SqlCommand(“SELECT ... context of the NETWORK SERVICE account. In the case of every other operating system, an ASP. NET page executes in the security context of the ASPNET account.To enable ASP. NET Framework to save an ... </FooterTemplate>< /asp: Repeater>< ;asp: SqlDataSource id=”srcFiles” ConnectionString=”Server=.\SQLExpress;Integrated Security=True;AttachDbFileName=|DataDirectory|FilesDB.mdf;User Instance=True” SelectCommand=”SELECT...
... eBookptg 41 5 Using ASP. NET Parameters with the SqlDataSource Control9 Using the ASP. NET CookieParameter ObjectThe CookieParameter object represents a browser-side cookie. The CookieParameter includes ... eBookptg 41 7 Using ASP. NET Parameters with the SqlDataSource Control9<hr />< ;asp: GridView id=”grdVote” DataSourceID=”srcVote” Runat=”server” />< ;asp: SqlDataSource id=”srcVote” ... /></InsertItemTemplate> < /asp: FormView> From the Library of Wow! eBookptg 42 0 CHAPTER 9 Using the SqlDataSource Control Using the ASP. NET ProfileParameter ObjectThe ProfileParameter object enables you...
... DropDownList control is bound to the srcMovieCategories SqlDataSource control, and the GridView control is bound to the srcMovies SqlDataSource control. The srcMovies SqlDataSource control includes ... eBookptg 44 4 CHAPTER 10 Using List ControlsLISTING 10.3 ProgrammaticDataBinding.aspx<%@ Page Language= C# ” %> <%@ Import Namespace=”System.Collections.Generic” %> <!DOCTYPE html ... id=”srcMovieCategories”SelectCommand=”SELECT Id, Name FROM MovieCategories” ConnectionString=”<%$ ConnectionStrings:Movies %>” Runat=”server” />< ;asp: SqlDataSource id=”srcMovies”SelectCommand=”SELECT...
... Objects with the ObjectDataSource Controlpublic SqlDataReader GetMovies() {// Create ConnectionSqlConnection con = new SqlConnection(_conString);// Create CommandSqlCommand cmd = new SqlCommand(); ... ObjectDataSource ControlYou can use parameters when calling a method with the ObjectDataSource control. The ObjectDataSource control includes five parameter collections:. SelectParameters—Collection ... SqlCommand(); cmd.Connection = con; cmd.CommandText = “SELECT Id,Title,Director FROM Movies”;// Return DataReader con.Open(); return cmd.ExecuteReader(CommandBehavior.CloseConnection);}public MovieDataReader()...
... CHAPTER 18 Using the ObjectDataSource Controlpublic static int GetMovieCount() {HttpContext context = HttpContext.Current; if (context.Cache[“MovieCount”] == null)context.Cache[“MovieCount”] ... commandSqlCommand cmd = new SqlCommand(); cmd.Connection = con; cmd.CommandText = “SELECT Count(*) FROM Movies”;// Execute command using (con) {con.Open(); result = (int)cmd.ExecuteScalar();} ... GetMovieCountFromDB(); return (int)context.Cache[“MovieCount”];}private static int GetMovieCountFromDB() {int result = 0;// Initialize connectionSqlConnection con = new SqlConnection(_conString);//...
... Standard\App_Code\Movie.cs using System; using System.Web; using System.Collections.Generic; using System.Linq; using System.Data.Linq;public partial class Movie {public static int Insert(Movie ... Movie class in Listing 20.20 contains a SelectCached() method that successfully caches database data with a LINQ to SQL query.LISTING 20.20 Standard\App_Code\Movie.cs using System; using System.Web; ... MyDatabaseDataContext(); return db.Movies;}public static IEnumerable<Movie> SelectCached() {HttpContext context = HttpContext.Current;List<Movie> movies = (List<Movie>)context.Cache[“Movies”];...
... WCF Data Service because your infra-structure prevents direct SQL access or because another team has decided to expose its data that way, it’s incredibly simple to create a service reference ... concurrency checking, which comes in handy for high-volume intranet applications.To add a new creature to the system and update a kill using the service reference, we can just use the code ... <siteMapNodeurl=”~/Service/FirstService.aspx” title=”First Service” description=”The first service” /><siteMapNode url=”~/Products/SecondService.aspx” title=”Second Service” description=”The second...