DirectoryTechnologyBlog Details for "Code Libary of e-July"

Code Libary of e-July

Code Libary of e-July
Just Blog About Programming issues and solutions
Articles: 1, 2

Articles

Web.config for VS2005 is rejected by IIS as Badly Formed
2008-04-25 17:40:00
I created a very simple website using VS .NET 2005. When I am trying to bring up my web page, I keep getting the following error message as shown below.Server Error in '/APS_WebSetup' Application. ________________________________________C onfiguration ErrorDescription: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.Parser Error Message: Unrecognized configuration section 'xhtmlConformance'Source Error:Line 89: -->Line 90: <globalization requestEncoding="utf-8" responseEncoding="utf-8"/>Line 91: <xhtmlConformance mode="Legacy"/>Line 92: <pages>Line 93: <namespaces>Source File: C:inetpubwwwrootAPS_WebSetupweb.config Line: 91_______________________________________ _Version Information: Microsoft .NET Framework Version: 1.1.4322.2407; ASP.NET Version: 1.1.4322.2407**************************** ******************...
More About: Rejected , Config
PlaceHolder control in ASP .NET
2008-04-18 16:23:00
PlaceHolder control acts as a container to store other web controls to a web page dynamically. It does not produce any output; its main function is used as a container for other controls. You can use the Control s.Controls collection to add, insert or remove controls from a PlaceHolder control.Here is an example of how to add a web control to PlaceHolder control.HTML<form id="Form1" method="post" runat="server"><asp:placeholder id="placeHolder" runat="server"> </asp:placeholder></form>CODE BEHINDDim newLbl As New LabelnewLbl.ID = "Label1"newLbl.Text = "This is a label control. "placeHolder.Controls.Add(newLbl)Dim newBtn As New ButtonnewBtn.ID = "Button1"newBtn.Text = "This is a button control. "placeHolder.Controls.Add(newBtn)' To remove the controls placeHolder.Controls.Remove("Label1")plac eHolder.Controls.Remove("Button1")Cheers!  Subscribe in a reader
Authentication and Authorization in ASP .NET
2008-04-18 16:10:00
Authentication and authorization are two tightly-coupled concepts to form the core of security for .NET applications.Authentication is the process of determining and verifying the identity of users based on the users? credentials. Authorization is the process of determining what level of access an authenticated identity should be granted to a given resource.Whenever a user logs on to a system, he/she will be authenticated first before he/she is authorized.AuthenticationThere are three types of authentication in ASP .NET:1. Form authentication2. Windows authentication3. Passport authenticationForm AuthenticationYou can handle authentication using your own custom logic depends on code written in your .NET application. After a user is authenticated, the credentials will be stored in a cookie to handle subsequent processes.Windows AuthenticationWindows authentication is the default authentication mode in ASP .NET. By using this mode, a user is authenticated based on his/her Windows acco...
More About: Authentication
Differences between SqlDataAdapter and SqlDataReader
2008-04-16 11:38:00
When I went for an interview last few weeks, the interviewers threw me some technical questions about .NET. Luckily I still can get some correct ideas on those questions. Here I will share with you one of the interview questions "What is the differences between SqlDataAdapter and SqlDataReader?"For SqlDataReader, you need to call the ExecuteReader method of the SqlCommand object.You can use SqlDataReader when your data access operations is mainly for fetching and displaying all the records in the database, which does not involve insert, update or delete actions, and other manipulations actions e.g. forward-only and read-only.If the data from database is mainly for displaying in data grid, labels or other web controls, you can go for SqlDataReader.However, when the SqlDataReader is in use, it requires the connection with the database remains open until its operation is completed.In short, SqlDataReader can be used when:- To deal with large volumes of data- To optimize data access- To...
More About: Differences
Disable Right-Click for Your Website
2008-04-12 14:48:00
NO RIGHT-CLICK for ImagesHave you ever tried so hard on your website to stop someone stolen your graphics as their own.Here is an extra step in protecting your graphics/images from being saved. But there is no foolproof method to stop someone from copy your images. If they really want something from your web site, they can find ways around it. But at least you can eliminate some proportion of visitors stealing images from your web site.It is very simple. Whenever someone right clicks his/her mouse, a message will popped up to show him/her that he/she do not have permission to do so. Place the script below within the head tags of your html.<script language="JavaScript"><!--var msg="Right-click is disabled!";function rightclick(go) {    if (document.all) {      &nbs p; if (event.button == 2) {      &nbs p;     alert(msg );      &nb sp; &...
More About: Website , Click
Remove a Visual Studio from Source Control
2008-04-01 10:07:00
To remove an item from source control, the first thing that you need to do is to select all items in your project and uncheck the Read-Only property. Click Apply then OK. Do these steps for both folder of your project (MyDocumentsVisual Studio Projects and wwwroot).In your Solution Directory, delete all the files with the extension .vssscc or .scc (includes all child folders in your solution directory). Next, right click on your .sln file and select Open with? Select Notepad.In your .sln file, find the GlobalSection(Source CodeControl ) = preSolution part. Select the whole part of it until EndGlobalSolution and remove it. Save and close the file.For each of the .vbproj in your project, open it with Notepad. Under <VisualBasic> you can find the following attributes: SccProjectName, SccLocalPath, SccAuxPath, and SccProvider as shown below. Remove it, save and close the file.Now, the source control had completely removed from the project. Hope you will find this helpful. Sub...
Add a Drop Down List into Excel File using C# .NET
2008-03-27 05:33:00
Here I will demonstrate to you how to add a drop down list into an Excel File using C# .NET. Before you adding this codes, make sure you have add the Microsoft Excel Object Library as reference into your project.Here are the codes:Excel.Application xlsApp = new Excel.ApplicationClass();Excel.Workbook xlsWorkbook;Excel.Worksheet xlsWorksheet;object oMissing = System.Reflection.Missing.Value;//Create new workbookxlsWorkbook = xlsApp.Workbooks.Add(true);//Get the first worksheetxlsWorksheet = (Excel.Worksheet)(xlsWorkbook.Worksheets[ 1]);string[] ddl_item ={"Answers","Autos","Finance","Games","Gr oups","HotJobs","Maps","Mobile Web","Movies","Music","Personals","Real Estate","Shopping","Sports","Tech","Trave l","TV","Yellow Pages"};Range xlsRange;xlsRange = xlsWorksheet.get_Range("A1","A1");Excel.D ropDowns xlDrop Downs;Excel.DropDown xlDropDown;xlDropDowns = ((Excel.DropDowns)(xlsWorksheet.DropDowns (oMissing)));xlDropDown=xlDropDowns.Add(( double)xlsRange.Left,(double)xlsRange.Top ,(double)xl...
More About: List
Add a Project or Solution to Source Control
2008-03-25 08:16:00
You can add projects and solutions to source control through Solution Explorer in Visual Studio. Follow the steps as below:1. On the Tools menu, click Options. In the Options dialog box, select Source Control . Select Visual Studio Team Foundation Server from the Current source control plug-in list. 2. In Solution Explorer, right-click the solution, choose Add Solution to Source Control.3. In the Add Solution to Source Control dialog box, navigate to where you want to add the project or solution. You can either accept default values, or click Make New Folder and enter the desired folder name.4. Click OK. Subscribe in a reader
More About: Project
15 Date Formats in SQL Server 2000
2008-03-24 14:04:00
--'YYYYMMDD'SELECT CONVERT(CHAR(8), GETDATE(), 112)--'YYYY-MM-DD'SELECT CONVERT(CHAR(10), GETDATE(), 23)--'YYYY-MMM-DD'SELECT STUFF(CONVERT(CHAR(10), GETDATE(), 23), 6, 2, LEFT(DATENAME(m, GETDATE()), 3))--'YYMMDD'SELECT CONVERT(VARCHAR(8), GETDATE(), 12)--'YY-MM-DD'SELECT STUFF(STUFF(CONVERT(VARCHAR(8), GETDATE(), 12), 5, 0, '-'), 3, 0, '-')--'YY-MMM-DD'SELECT STUFF(STUFF(STUFF(CONVERT(VARCHAR(8), GETDATE(), 12), 3, 2, LEFT(DATENAME(m, GETDATE()), 3)), 6, 0, '-'), 3, 0, '-')--'MM-DD-YY'SELECT CONVERT(CHAR(8), GETDATE(), 10)--'MMDDYY'SELECT REPLACE(CONVERT(CHAR(8), GETDATE(), 10), '-', SPACE(0))--'MM/DD/YY'SELECT CONVERT(CHAR(8), GETDATE(), 1)--'MM/DD/YYYY'SELECT CONVERT(CHAR(10), GETDATE(), 101)--'DD-MM-YY'SELECT REPLACE(CONVERT(CHAR(8), GETDATE(), 3), '/', '-')--'DD-MMM-YY'SELECT STUFF(REPLACE(CONVERT(CHAR(8), GETDATE(), 3), '/', '-'), 4, 2, LEFT(DATENAME(m, GETDATE()), 3))--'DDMMYY'SELECT REPLACE(CONVERT(CHAR(8), GETDATE(), 3), '/', S...
More About: Server
Differences between VARCHAR and NVARCHAR
2008-03-13 14:25:00
VARCHAR is an abbreviation for variable-length character string with a maximum limit of 8000 bytes.NVARCHAR are the Unicode equivalents of VARCHAR. Unicode uses two bytes per character, which allows the storage of multilingual characters with a maximum length of 4000 bytes. The most common use of NVARCHAR is to store character data that is a mixture of English and non-English symbols, such as English and Chinese. Other languages have an extended set of character codes that need to be saved and this datatype allows for this extension. If your database will not be storing multilingual data you should use the VARCHAR datatype instead. This is because to store the extended character codes for other languages, NVARCHAR requires twice as much space as VARCHAR.VARCHAR and NVARCHAR in SQL SERVER 2005One major change to both of the datatypes in SQL SERVER 2005 is the creation of VARCHAR(MAX) and NVARCHAR(MAX) which allows you to stored up to 2GB in a single variable. And it also allows you t...
More About: Differences
How to get IP Address of a computer in C#
2008-03-07 03:25:00
To get the IP address of the local machine in C#, system.net namespace is needed. From the IPHostEntry class, we can get the address list in a string array.using System.Net;private string GetIP() {     string strHostName = "";      strHostName = System.Net.Dns.GetHostName();      IPHostEntry ipEntry = System.Net.Dns.GetHostEntry(strHostName);      IPAddress [] addr = ipEntry.AddressList;      return addr[addr.Length-1].ToString();} Sub scribe in a reader
More About: Computer
ASP .NET File Upload Problem
2008-03-04 06:36:00
When I upload a large file (> 4MB), I started getting error - "The page cannot be displayed". It took me 15 minutes before I realized that maxRequestLength is causing this problem.By default, the maxRequestLength will be 4MB. If you are uploading a file which is larger than 4MB, please be sure to edit your web.config file by using httpRuntime attribute.httpRuntime attribute has several properties, but the attributes that you need to take note are executionTimeout and maxRequestLength. The executionTimeout is the maximum time in seconds a request is allowed to execute before being shut down by ASP .NET automatically, default is 110s. While maxRequestLength is maximum file length that will be uploaded, in kilobytes, default is 4MB.To set this in your web.config, it should look like as below:<httpRuntime executionTimeout="600" maxRequestLength="1024000000" />Hope this can help someone. Cheers! Subscribe in a reader
More About: File , Problem , Upload
Filtering and Sorting in ADO .NET
2008-03-03 07:18:00
There are many ways to filter data. One way is to filter data by using a WHERE clause on your database query. In ADO .NET, there is some additional functionality that you can use to filter data in a dataset. Two fundamental approaches of it:(i) DataTable Select Method(ii) DataView ObjectFiltering with Select MethodImagine that a dataset contains data about Students and Grades tables. To filter on those data with the Grade of A, you can use Select method, which will return an array of rows.VBDim ds_Student As New DataSetDim drows() As DataRowdrows = ds_Student.Tables(0).Select("Grade = 'A'")C#DataSet ds_Student = new DataSet();DataRow[] drows;drows = ds_Student.Tables(0).Select("Grade = 'A'");Select method does not return filtered tables object as expected, it returns an array of DataRow objects instead. Namely, the returned object cannot be bind directly to a datagrid or other data bound controls.You can iterate through the array using the foreach statement or for loop.VBFor i ...
More About: Sorting
Hidden Worksheet in an Excel File
2008-02-29 07:28:00
I am automating a report where I have to pull data from excel file to database. When doing this, sometimes I get an error keep telling me that I get the wrong report format.After debug on my program, I found out that some of the excel files do have a few hidden worksheet with different report format. That?s why I keep getting this error.Assume that only visible worksheet will be used to pull data into database, so I need to know which worksheet is visible and which is not. This can be done by using Worksheet.Visible property, which can determine whether the worksheet is visible or hide. ...Excel .Application xlsApp = new Excel.ApplicationClass();Excel.Workbook xlsWorkbook;Excel.Worksheet xlsWorksheet;xlsWorkbook = xlsApp.Workbooks.Open("C:\test.xls",0,fal se,5,"","",true,Excel.XlPlatform.xlWindow s," ",false,false,0,true,1,0);// get the collection of sheets in the workbookExcel.Sheets sheets = xlsWorkbook.Worksheets; foreach(Worksheet sht in sheets) {   &nbs...
More About: File , Hidden
Comparison of ADO .NET DataSet and ADO RecordSet
2008-02-27 08:39:00
1. Number of Tables. Dataset can hold several tables which are called data tables at once. A dataset also stores relationships and constraints on the tables. For example, if a dataset contains a table about customers and another table about customers? product, it could also contain a relationship connecting each row of the customers table with the corresponding rows of the product table. A recordset contains only the rows returned by the corresponding query. For example, if a recordset want to retrieve data from several tables, it must use a JOIN query to assemble those data into a single result table.2. Data Navigation. In ADO you loop through the rows of the recordset using MoveNext method. In ADO.NET, rows are represented as collections, so you can loop through a table as you would through any collection, or access particular rows via ordinal or primary key index.3. Minimized Open Connections. Dataset is designed to work connectionless to the original data sourc...
More About: Comparison
Access is denied in ASP .NET
2008-02-25 10:05:00
Description: An unhandled exception occurred during the execution of the current web request. Exception Details: System.UnauthorizedAccess Exception: Access is denied. ASP.NET is not authorized to access the requested resource. Solution: 1. Consider granting access rights to the resource to the ASP.NET request identity. ASP.NET has a base process identity (typically {MACHINE}ASPNET on IIS 5 or Network Service on IIS 6) that is used if the application is not impersonating. If the application is impersonating via <identity impersonate="true"/ >, the identity will be the anonymous user (typically IUSR_MACHINENAME) or the authenticated request user. 2. To grant ASP.NET write access to a file, right-click the file in Explorer, choose "Properties" and select the Security tab. Click "Add" to add the appropriate user or group. Highlight the ASP.NET account, and check the boxes for the desired access. Subscribe in a reader
Timeout expired error in ASP .NET
2008-02-21 04:52:00
Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was reached. Had you seen this Timeout expired error in your application before?I have an application which will do a lot of database reads and updates. While the application is running to update records into database, suddenly I am getting this error.I tried to add max pool size to a bigger size (Max Pool Size, default = 100), but in the end I still getting the same error, so I suspect that I am leaking connections.public object Execute(string SQLStmt){   try {       m_cmd = new SqlCommand(SQLStmt, Connection);       object a = m_cmd.ExecuteNonQuery();       m_cmd.Dispose();       return a;   }   catch (Exception e) {       m_oErr = e;       return null;  &n...
More About: Error , Timeout
Excel Drop Down List
2008-02-18 09:25:00
When inputting data into Excel , often you will find yourself have to type the same data into cells. And now, in Excel, you can create a drop down list for the cell, instead of typing the same data over and over again. A drop down list in Excel makes data entry easier, avoids typo error in a cell, and limit entries to certain items.Next, I will show you how to create a drop down list step by step.Imagine that we want to create a drop down list which contains a list of sections as below:Now we have the source for the drop down list. Highlight cells E2 to E10 to create a drop down list for each cell within this range.Click the Data | Validation. A Data Validation dialog box will pop out. Go to Settings tab. Choose List from the Allow drop down menu. Click on the icon from the Source field.Highlight the sources from cell A1 to A18. Press Enter and click OK. Now all of the selected cells in the Section column should have a drop down list, as below:That?s it. Cheers! Subscribe i...
More About: Drop
How to Highlight a row in DataGrid
2008-02-14 07:28:00
In this post I will discuss about how to highlight a row in datagrid when mouse moves over a row, by using onmouseover and onmouseout javascript events.Datagrid has two events, ItemCreated and ItemDataBound, which allow us to access the data items and create an event handler for the events. ItemCreated event is raised when an item in the datagrid control is created, while ItemDataBound event is raised after an item in the datagrid control is created.In this example, I will work with the ItemDataBound event, adding handlers for onmouseover and onmouseout javascript events for each of the row in the datagrid.As you can see from the code snippet below, a row will be highlighted when mouse over and switched to normal when mouse out.private void dgRows_ItemDataBound(object sender, System.Web.UI.WebControls.DataGridItemEve ntArgs e){      ListItemType itemType;      itemType = (ListItemType)e.Item.ItemType;      if(ite...
More About: Highlight
Excel in a .NET Application
2008-01-31 15:32:00
It has been a really hard work week after too many hours of coding. Thankfully I can get a whole week rest after tomorrow.Last week, after a meeting with my project manager and my users, I had been assigned to build an application which includes import/export data from/to an excel spreadsheet functionality.VS .NET allows us to add Excel reference. Once Excel reference is added into an application, you can take control of every aspect of Excel by using a rich library of objects provided by Excel itself, e.g. add formatting, additional worksheets and so on.Previously, I had written a few posts related with import and export data from/to excel file, and I will summarized all of them in this post by using C#.Connection StringTo read data from Excel file, you will need a connection string to connect to the Excel file, as following:string sfile = "C:Book1.xls";string strConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + sfile + ";" + "Extended Properties=Excel 8.0;";sfile represent...
More About: Application
ASP .NET DataGrid with fixed headers
2008-01-29 07:43:00
When dealing with data grid in ASP .NET, a very common design request for it is having a data grid which has a horizontal scrollbar and fixed column header.Adding a ScrollbarA vertical scrollbar is very useful when your data grid contains of many rows that cannot fit into a web page. This can be done by using DIV tag. Enclose your data grid into a <div> tag and set the overflow style to scroll or auto. Look at the example as below:<DIV id=?div-datagrid? style=?OVERFLOW: auto;?>    <asp :datagrid runat=server?.> </asp:datagrid></DIV>Fixed HeaderA fixed header will stick on the top of your data grid and never scroll out of view, in this case, users will not get confuse which column represent which field.To achieve this, add a style as below in your CSS file.<style type="text/css"><!--.DataGridFixedH eader {    FONT: menu;    COLOR: black;    background- color: #CCFFCC;&n...
DoCmd.HourGlass Method in MS Access
2008-01-21 14:36:00
In MS Access , when a macro action takes a long time to run, you can use DoCmd.HourGlass to change your mouse pointer to an image of an hourglass or any icon that you like, by using the code as below:DoCmd.HourGlass TrueorDoCmd.HourGlass FalseIt has the following argument: True/False, or 0/-1. Subscribe in a reader
More About: Method , Hourglass
Export Data to Excel (Not HTML Tables)
2008-01-19 15:53:00
Recently I working with export data to an excel file, but had faced a lot of problems. The main problem of it: The exported file is saved as HTML tables with XLS extension, not the actual XLS format. In this way, I can?t re-import the data using the OleDbConnection.I have been searching around the net, but no exact solution that suit my situation. Finally, I had found another way to export data into the actual XLS format, by using Excel .Application.First thing that you need to do is to add Excel dll (Microsoft Excel 11.0 Object Library) as a reference.Here are the codes.Private Function Export ToExcel(ByVal dt As System.Data .DataTable)   & nbsp;Dim xlsApp As New Excel.Application     Dim xlsWorkbook As Excel.Workbook    Dim xlsWorksheets As Excel.Worksheets    D im xlsWorksheet As Excel.Worksheet    Di m strhdr As String    Dim row As Integer    Dim drow ...
More About: Tables , Html
Simple error log files in ASP .NET
2008-01-16 14:57:00
In some circumstances, you may not be able to debug your web application to determine what exception had occurred in it. So to create an error log file is very important to keep track of the occurred exception.In this post, I will show you how to write an error log files by using a class file (.cs).First of all, a class called CreateLogFiles needs to be created. In this class file, add in the codes as following:using System;using System.IO;using System.Text;namespace CSharpWeb{     public class CreateLogFiles     {         ; private string sFormat;         ; private string sTime;         ; public CreateLogFiles()         ; {         ;     sFormat = DateTime.Now.ToShortDateString().ToString ()+"...
More About: Simple , Error
Can I use .NET Framework 2.0 from VS .NET 2003?
2008-01-15 07:02:00
Currently I am working with VS .NET 2003 with .NET framework 1.1. But recently I found out that some features that only available in .NET framework 2.0 is needed in my project. I had downloaded the .NET framework 2.0 package and think of want to use it within the VS .NET IDE. Problem arose. I do not know how I can achieve to it. And after a few searches on net, I found out that each release of Visual Studio is only tied to a specific version of the .NET framework. I found the following comment on the VS 2005 Express FAQ:Can I develop application using the Visual Studio Express Editions to target the .NET Framework 1.1?No, each release of Visual Studio is tied to a specific version of the .NET Framework. The Express Edition can only be used to create applications that run on the .NET Framework 2.0VS .NET 2002 => .NET 1.0VS .NET 2003 => .NET 1.1VS .NET 2005 => .NET2.0VS .NET 2007 (codenamed Orcas) => .NET3.0 Subscribe in a reader
Sending mail in ASP .NET
2008-01-13 07:53:00
Sending e-mails from a website is very common nowadays, especially while registering on a website, an automated e-mail will be sent to your mailbox for verification and confirmation purpose.ASP .NET simplified the work of developers with the introduction of a namespace called System.Web.Mail . By using this namespace, developers can easily sending a plain text mail, HTML mail, or sending attachments.Sending Plain Text MailLet?s start with a simple plain text mail first. See the codes below.using System.Web.Mail;...string To = "youremailaddress@yahoo.com";string From = "webmail@mail.com";string Subject = "Hi";string Body = "Hello World!";SmtpMail.Send(From, To, Subject, Body);The output of this will look like the screenshot below.This is very simple since it only uses SmtpMail.Send method in the System.Web.Mail namespace. SmtpMail.Send method contains 4 parameters: From, To, Subject and BodyText.Sending HTML MailIn sending a HTML mail, we need to use MailMessage class, which provides ...
More About: Sending
SQL Server function for datetime - DATEADD
2008-01-10 16:05:00
DATEADD is a date function that will return a datetime value based on the number interval add to the particular date part of the specified date. Here is the syntax for DATEADD:DATEADD(date_part, number_interval, specified_date)date_part is the parameter that specifies on which part of the date to be manipulated with the number interval. You can add month, year, day and etc. You can useMONTH, MM or M for monthYEAR, YYYY, YY for yearDAY, DD, D for dayHH for hourSS, S for SecondFor example :SELECT DATEADD(D, -1, GETDATE())AS [Yesterday]SELECT DATEADD(MM, 3, GETDATE())AS [FourMonthsFromNow]SELECT DATEADD(YEAR, -2, GETDATE())AS [TwoYearsAgo] Subscribe in a reader
More About: Server , Function
How to use the LIKE clause in SQL Query in MS Access
2008-01-07 14:58:00
This article will show you how to use the LIKE clause in SQL to search all the related records in a table that begin with, end with or contain a certain letter.Normally for LIKE statement, the wildcard character is ?%?, but please take note that, in MS Access , you have to use the wildcard ?*? instead of ?%?, else it is not working.Here are some examples using the LIKE clause:LIKE [First character that you want to search] & ?*?LIKE ?*? & [Certain character that you want to search] & ?*? Subscribe in a reader
More About: Query , Clause
Stored Procedures in MySQL 5.0
2008-01-03 14:41:00
Some people resisted to use MySQL because it had no support for stored procedures. But with MySQL 5.0, it has its new functionality for Stored Procedures. What are stored procedures actually? They are collections of SQL query and procedures that stored and run on the database server.Before MySQL provides this new feature, MySQL developers need to store their procedures on the application, there hasn?t been an option anyway. And now, this new feature is available on version 5.0, and I am going to discuss why we would want to use stored procedures and place logic on the database server, instead of just put the procedures on the application.Why use Stored Procedures?§ They can run in all environments. Since stored procedures are stored in database server, so it doesn?t matter what application environment is used ? the logic just remains in one place.§ Less network traffic. For complex application, it may require complex queries or looped queries to get the desired resul...
More About: Mysql
Page.RegisterHiddenField Method
2008-01-02 15:24:00
This article explains the Page .RegisterHiddenField Method .From MSDN library?s explanation, Page.RegisterHiddenField method allows server controls to automatically register a hidden field on the form. The field will be sent to the page when the HTML Form servers control is rendered.This method takes 2 parameters:hiddenFieldName ? The unique name of the hidden field to be renderedhiddenFieldInitialValue ? The value to be emitted in the hidden formPlease take note that if you use this method twice with the same id with different value in your page, it will only register the first one.For example:Page.RegisterHiddenField(?field_1 ?, ?value_1?);Page.RegisterHiddenField(?fiel d_1?, ?value_2?);Value_1 will be rendered while the second call is ignored.On postback, you can use Request. Form(?field_1?) to get the data of the string result.Cheers! Subscribe in a reader
More articles from this author:
1, 2
81256 blogs in the directory.
Statistics resets every week.


Contact | About
© Blog Toplist 2009 - Supported by Web Catalog - SEO by FeWorks
eXTReMe Tracker