IIS क्या है- Internet Information Server

Internet Information Server (IIS) Microsoft के सबसे लोकप्रिय वेब सर्वरों में से एक है जिसका उपयोग ASP.NET और ASP वेब ऍप्लिकेशनो को इंटरनेट-आधारित सेवाओं को होस्ट करने और प्रदान करने के लिए किया जाता है। वेब सर्वर (web server) उपयोगकर्ताओं से आने वाले requests की प्रतिक्रिया (response) प्रदान करने के लिए जिम्मेदार होता है। जब क्लाइंट (client) से सर्वर (server) पर कोई request आता है तो IIS उपयोगकर्ताओं से उस request को लेता है और इसे संसाधित करता है और उपयोगकर्ताओं को प्रतिक्रिया (response) भेजता है।

ASP.NET request को संभालने या हैंडल करने के लिए Internet Information Server (IIS) का अपना ASP.NET Process Engine है। जिस तरह से आप ASP.NET एप्लिकेशन को कॉन्फ़िगर (configure) करते हैं, वह इस बात पर निर्भर करता है कि एप्लिकेशन (application) IIS के किस संस्करण पर चल रहा है।

How to Install IIS

IIS को install करने के लिये निम्‍न Steps का use किया जाता है –

  1. पहले, हम control panel पर जाते हैं और जैसे ही हम इस पर click करते है तो हमारे सामने कई icons display होते है।
  2. इस icons में से हम program and feature पर click करते है।
  3. अब जैसे ही हम program and feature पर click करते है तो हमारे सामने program and feature का dialog box display होता है।
  4. अब हम program and features के left side top, corner, पर एक turn window feature On or Off होता है। इस पर हम click करते है।
  5. जैसे ही हम इस option पर click करते है तो हमारे सामने window feature का dialog box show होता है।
  6. जब हम इस dialog box में से IIS को check करते हैं और window से CD अपने सिस्‍टम में insert करते है।
  7. जैसे ही window की CD loop होने लगती है हम IIS को select करके Ok button पर click करते है।
  8. जैसे ही ok button पर click किया जाता है तो कुछ समय के लिये process चलती है और कुछ समय के बाद IIS हमारे computer में install हो जाता है।
  9. जैसे ही IIS install होता है। इसको check करने के लिये हम browser को open करते है और उसके address bar में http:// localhost लिखते है and enter key press करते है तो हमारे सामने IIS दिखने लगेगा। या हम http://127.0.0.1 लिखकर भी enter key press कर सकते हैं।

What is Internet Information Server

Internet Information Server (IIS) में वेब एप्लीकेशन (Web applications),सर्च इंजनों (search engines) के निर्माण के लिए प्रोग्राम्स का एक सेट शामिल है, और वेब-आधारित ऍप्लिकेशन्स (Web-based applications) को बनाने के लिए भी सुविधा है, जो SQL सर्वर जैसे डेटाबेस को एक्सेस कर सकते हैं। IIS के साथ, आप अपने कंप्यूटर को वेब सर्वर के रूप में काम करने के लिए बना सकते हैं और सर्वर पर ASP.NET वेब एप्लीकेशन (web applications) को विकसित कर सकते हैं। आप किसी विशेष वेबसाइट को अनधिकृत एक्सेस (unauthorized access) से बचाने के लिए विशिष्ट उपयोगकर्ताओं और कंप्यूटर के लिए सुरक्षा (security) भी सेट कर सकते हैं।
IIS, संगठनों (organizations) को सिस्टम प्रशासन (system administration) और परिनियोजन (deployment) की लागत को कम करते हुए वेब साइटों और एप्लिकेशन की उपलब्धता को बढ़ाने में मदद करता है। IIS 7.5 HTTP, HTTPS, FTP, FTPS, SMTP और NNTP को सपोर्ट करता है।

ASP.Net मल्टी फॉर्म इंटरफेस (Multi Form Interface MFI) के बजाय सिंगल फॉर्म इंटरफेस (Single Form Interface (SFI) पर निर्भर करता है, क्योंकि ASP.NET स्टेट मेंटेनेंस फीचर के implementation के लिए SFI एक प्रमुख element है। यदि आप दो या दो से अधिक सर्वर साइड फॉर्म होस्ट करते हैं तो आपको रन-टाइम त्रुटि (run time error) मिलेगी ‘एक पेज में केवल एक सर्वर-साइड फॉर्म टैग हो सकता है’। ASP.NET में, server side form को HtmlForm नामक एक class का उपयोग करके प्रस्तुत किया जाता है। यह class एक्शन प्रॉपर्टी (action property) प्रदान नहीं करता है, न ही यह वैकल्पिक प्रॉपर्टी (alternative property) की आपूर्ति करता है।

जब render method को कॉल किया जाता है, तो पेज ऑब्जेक्ट पहले सर्वर-साइड फॉर्म को संसाधित (render) और प्रस्तुत (process) करता है और यह नोट करने के लिए एक इंटर्नल फ्लैग (internel flag) सेट करता है कि पेज के लिए एक फॉर्म ऑब्जेक्ट को प्रोसेस किया गया है और सर्वर-साइड फॉर्म को बाद में शामिल करने के लिए (subsequent inclusion) यह एक HttpException थ्रो करता है|


लेकिन आप HTML form tag में “runat =server” प्रॉपर्टी सेट किए बिना एक से अधिक HTML फॉर्म शामिल कर सकते हैं।

निम्नलिखित कोड को देखिये:-

  1. अपने aspx page में एक से अधिक फॉर्म कैसे शामिल करें और दूसरे पेज URL को परिभाषित करें।
  2. किसी अन्य aspx page में form controls value कैसे प्राप्त (retrieve) करें।

How IIS Works

[Main.aspx]: यह मुख्य पृष्ठ ( main page) है जिसके दो रूप हैं। पहला फॉर्म सर्वर-साइड फॉर्म (server-side form) है जो डेटा को उसी पेज पर post करेगा। दूसरा रूप ‘runat=server’ विशेषता के बिना plain html-form है जो अपने html controls के डेटा को दूसरे aspx page पर पोस्ट करेगा। इस फॉर्म के अंदर शामिल Html controls को विशेष रूप से नामित किया गया है।

<%@ Page language="c#" Codebehind="Main.aspx.cs" AutoEventWireup="false" Inherits="MultipleForm.Main" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title>Main</title>
<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
<meta content="C#" name="CODE_LANGUAGE">
<meta content="JavaScript" name="vs_defaultClientScript">
<meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
<link type="text/css" href="MyStyle.css" rel="stylesheet">
</HEAD>
<body MS_POSITIONING="GridLayout">
<form id="frmMain" method="post" runat="server">
<table cellSpacing="0" cellPadding="0" width="95%" border="0">
<caption class="tblCaption">Post data to same page [ Main.aspx ]</caption>
<tr class="rowStyle">
<td width="25%">First Name</td>
<td width="25%"><input class="inputformat" type="text" id="txtFName" runat="server" NAME="txtFName"></td
<td width="25%">Last Name</td>
<td width="25%"><input class="inputformat" type="text" id="txtLName" runat="server" NAME="txtLName"></td>
</tr>
<tr class="rowStyle">
<td></td>
<td colspan="2" align="center"><asp:Button CssClass="buttonStyle" id="btnSubmit" runat="server" Text="Post to Main"></asp:Button></td>
<td></td>
</tr>
</table>
</form>
<br>
<!------
The following form is design by using core ASP model which has
action attribute to define the url of the page where we want to
post/send data.
//---------->
 
<form action="A1.aspx" method="post">
<table cellSpacing="0" cellPadding="0" width="95%" border="0">
<caption class="tblCaption">Post data to another page [ A1.aspx ]</caption>
<tr class="rowStyle">
<td width="25%">First Name</td>
<!---
define name of the control so that you can access its
value by using its name in A1.aspx page
//--->
<td width="25%"><input class="inputformat" type="text" name="fname"></td>
<td width="25%">Last Name</td>
<td width="25%"><input class="inputformat" type="text" name="lname"></td>
</tr>
<tr class="rowStyle">
<td></td>
<td colspan="2" align="center"><input class="buttonStyle" type="submit" value="Post to A1"></td>
<td></td>
</tr>
</table>
</form>
</body>
</HTML>
[Main.aspx.cs]
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
 
namespace MultipleForm
{
/// <summary>
/// Summary description for Main.
/// </summary>
public class Main : System.Web.UI.Page
{
protected System.Web.UI.WebControls.Button btnSubmit;
protected System.Web.UI.HtmlControls.HtmlInputText txtFName;
protected System.Web.UI.HtmlControls.HtmlInputText txtLName;
protected System.Web.UI.WebControls.TextBox txtfname;
 
 
private void Page_Load(object sender, System.EventArgs e)
{
// Put user code to initialize the page here
Response.Write("<font>First Name : " + txtFName.Value  + "<br>");
Response.Write("Last Name   : " + txtLName.Value  + "</font><br>");
}
 
#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent();
base.OnInit(e);
}
 
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
 
private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);
 
}
#endregion
}
}
 
[A1.aspx.cs]
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Collections.Specialized;
/* The System.Collections.Specialized namespace has
* NameValueCollection class which will be used to
* retrieve form fields data by defined name
*
*/
 
namespace MultipleForm
{
/// <summary>
/// Summary description for A1.
/// </summary>
public class A1 : System.Web.UI.Page
{
private void Page_Load(object sender, System.EventArgs e)
{
// Put user code to initialize the page here
Response.Write("<font>Data posted to A1.apsx page <br>");
// declare object of NameValueCollection class
NameValueCollection userdata;
// The form property of Request class returns a collection of form variables
// thus 'userdata' contains data in the form of Name-Value
userdata = Request.Form;
// now we can retrieve value of any form field by its name
Response.Write("First Name : " + userdata["fname"].ToString() + "<br>");
Response.Write("Last Name : " + userdata["lname"].ToString() + "</font><br>");
}
 
#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent();
base.OnInit(e);
}
 
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
 
private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);
}
 
#endregion
}
}


error: Content is protected !!