public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender,EventArgs e)
{
if(!IsPostBack)
{
string ip = "192.168.1.55";//the restrictive ip
if (Page.Request.UserHostAddress.Equals(ip))
{
Response.Redirect("Error.aspx");
}
}
}
}
But would like to know if and how I can add more ip address,
ie
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender,EventArgs e)
{
if(!IsPostBack)
{
string ip = "192.168.1.55";//the restrictive ip
or
string ip = "192.168.1.56";//the restrictive ip
or
string ip = "192.168.1.57";//the restrictive ip
if (Page.Request.UserHostAddress.Equals(ip))
{
Response.Redirect("Error.aspx");
}
}
}
}
the second code will not work so is there another way this should be set out?
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
public partial class IT_Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
var blockedIps = new List<string>() {"192.168.1.2", "192.168.1.56", "192.168.1.57"};
if(blockedIps.Contains(Page.Request.UserHostAddress))
Response.Redirect("NoAccess.aspx");
}
}
}
But get a error,
Server Error in '/' Application.
Compilation Error
Description:
An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: CS0246: The type or namespace name 'List' could not be found (are you missing a using directive or an assembly reference?) Source Error:
Line 19: {
Line 20:
Line 21: var blockedIps = new List<string>() {"192.168.1.2", "192.168.1.56", "192.168.1.57"}; Line 22:
Line 23: if(blockedIps.Contains(Page.Request.UserHostAddress))
c:\windows\system32\inetsrv> "C:\Windows\Microsoft.NET\Framework\v4.0.30319\csc.exe" /t:library /utf8output /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Windows.Forms\v4.0_4.0.0.0__b77a5c561934e089\System.Windows.Forms.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_32\System.Web\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Web.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Activities\v4.0_4.0.0.0__31bf3856ad364e35\System.Activities.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.ServiceModel.Activation\v4.0_4.0.0.0__31bf3856ad364e35\System.ServiceModel.Activation.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Xml.Linq\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.Linq.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.Extensions\v4.0_4.0.0.0__31bf3856ad364e35\System.Web.Extensions.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Data.DataSetExtensions\v4.0_4.0.0.0__b77a5c561934e089\System.Data.DataSetExtensions.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.Extensions.Design\v4.0_4.0.0.0__31bf3856ad364e35\System.Web.Extensions.Design.dll" /R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\mscorlib.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_32\System.EnterpriseServices\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.EnterpriseServices.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Core\v4.0_4.0.0.0__b77a5c561934e089\System.Core.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.WorkflowServices\v4.0_4.0.0.0__31bf3856ad364e35\System.WorkflowServices.dll" /R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\ed3fe93a\1e2f81e4\App_Web_xxb1hhy3.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_32\System.Data\v4.0_4.0.0.0__b77a5c561934e089\System.Data.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System\v4.0_4.0.0.0__b77a5c561934e089\System.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Drawing\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Runtime.Serialization\v4.0_4.0.0.0__b77a5c561934e089\System.Runtime.Serialization.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.ComponentModel.DataAnnotations\v4.0_4.0.0.0__31bf3856ad364e35\System.ComponentModel.DataAnnotations.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.ServiceModel.Web\v4.0_4.0.0.0__31bf3856ad364e35\System.ServiceModel.Web.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.ApplicationServices\v4.0_4.0.0.0__31bf3856ad364e35\System.Web.ApplicationServices.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.Entity\v4.0_4.0.0.0__b77a5c561934e089\System.Web.Entity.dll" /R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\ed3fe93a\1e2f81e4\assembly\dl3\94ec11a1\d2a6f5b8_656dcd01\AjaxControlToolkit.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Configuration.Install\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Configuration.Install.dll" /R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\ed3fe93a\1e2f81e4\App_Web_odlgilp5.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.IdentityModel\v4.0_4.0.0.0__b77a5c561934e089\System.IdentityModel.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.ServiceModel\v4.0_4.0.0.0__b77a5c561934e089\System.ServiceModel.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.ServiceModel.Activities\v4.0_4.0.0.0__31bf3856ad364e35\System.ServiceModel.Activities.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Configuration\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.DynamicData\v4.0_4.0.0.0__31bf3856ad364e35\System.Web.DynamicData.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.DirectoryServices.Protocols\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.DirectoryServices.Protocols.dll" /R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\ed3fe93a\1e2f81e4\App_Web_rtxz4yar.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Xml\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.WebPages.Deployment\v4.0_1.0.0.0__31bf3856ad364e35\System.Web.WebPages.Deployment.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Design\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Design.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.DirectoryServices\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.DirectoryServices.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.Services\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Web.Services.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.CSharp\v4.0_4.0.0.0__b03f5f7f11d50a3a\Microsoft.CSharp.dll" /out:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\ed3fe93a\1e2f81e4\App_Web_cokfolm2.dll" /D:DEBUG /debug+ /optimize- /win32res:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\ed3fe93a\1e2f81e4\cokfolm2.res" /w:4 /nowarn:1659;1699;1701 /warnaserror- "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\ed3fe93a\1e2f81e4\App_Web_cokfolm2.0.cs" "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\ed3fe93a\1e2f81e4\App_Web_cokfolm2.1.cs" "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\ed3fe93a\1e2f81e4\App_Web_cokfolm2.2.cs"
Microsoft (R) Visual C# 2010 Compiler version 4.0.30319.1
Copyright (C) Microsoft Corporation. All rights reserved.
d:\Intranet\IT\Default.aspx.cs(21,34): error CS0246: The type or namespace name 'List' could not be found (are you missing a using directive or an assembly reference?)
d:\Intranet\IT\Default.aspx.cs(21,49): error CS1925: Cannot initialize object of type 'List<string>' with a collection initializer
Line 1: #pragma checksum "D:\intranet\IT\Default.aspx" "{406ea660-64cf-4c82-b6f0-42d48172a799}" "6E1D7040BA783812E5178A7D4BDDDD13"
Line 2: //------------------------------------------------------------------------------
Line 3: // <auto-generated>
Line 4: // This code was generated by a tool.
Line 5: // Runtime Version:4.0.30319.269
Line 6: //
Line 7: // Changes to this file may cause incorrect behavior and will be lost if
Line 8: // the code is regenerated.
Line 9: // </auto-generated>
Line 10: //------------------------------------------------------------------------------
Line 11:
Line 12:
Line 13:
Line 14: public partial class IT_Default : System.Web.SessionState.IRequiresSessionState {
Line 15:
Line 16:
Line 17: #line 11 "D:\intranet\IT\Default.aspx"
Line 18: protected global::System.Web.UI.HtmlControls.HtmlTableCell tdHeader;
Line 19:
Line 20: #line default
Line 21: #line hidden
Line 22:
Line 23:
Line 24: #line 35 "D:\intranet\IT\Default.aspx"
Line 25: protected global::ASP.controls_loginpersoncontrol_ascx LoginPersonControl1;
Line 26:
Line 27: #line default
Line 28: #line hidden
Line 29:
Line 30:
Line 31: #line 36 "D:\intranet\IT\Default.aspx"
Line 32: protected global::ASP.controls_keylinkscontrol_ascx KeyLinksControl1;
Line 33:
Line 34: #line default
Line 35: #line hidden
Line 36:
Line 37:
Line 38: #line 37 "D:\intranet\IT\Default.aspx"
Line 39: protected global::ASP.controls_itlinkscontrol_ascx ITLinksControl1;
Line 40:
Line 41: #line default
Line 42: #line hidden
Line 43:
Line 44: protected System.Web.Profile.DefaultProfile Profile {
Line 45: get {
Line 46: return ((System.Web.Profile.DefaultProfile)(this.Context.Profile));
Line 47: }
Line 48: }
Line 49:
Line 50: protected System.Web.HttpApplication ApplicationInstance {
Line 51: get {
Line 52: return ((System.Web.HttpApplication)(this.Context.ApplicationInstance));
Line 53: }
Line 54: }
Line 55: }
Line 56: namespace ASP {
Line 57:
Line 58: #line 7 "D:\intranet\IT\Default.aspx"
Line 59: using System.Web.UI.WebControls.Expressions;
Line 60:
Line 61: #line default
Line 62: #line hidden
Line 63:
Line 64: #line 385 "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\web.config"
Line 65: using System.Collections;
Line 66:
Line 67: #line default
Line 68: #line hidden
Line 69:
Line 70: #line 391 "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\web.config"
Line 71: using System.Text;
Line 72:
Line 73: #line default
Line 74: #line hidden
Line 75:
Line 76: #line 7 "D:\intranet\IT\Default.aspx"
Line 77: using System.Web.UI;
Line 78:
Line 79: #line default
Line 80: #line hidden
Line 81:
Line 82: #line 386 "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\web.config"
Line 83: using System.Collections.Generic;
Line 84:
Line 85: #line default
Line 86: #line hidden
Line 87:
Line 88: #line 390 "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\web.config"
Line 89: using System.Linq;
Line 90:
Line 91: #line default
Line 92: #line hidden
Line 93:
Line 94: #line 403 "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\web.config"
Line 95: using System.Xml.Linq;
Line 96:
Line 97: #line default
Line 98: #line hidden
Line 99:
Line 100: #line 7 "D:\intranet\IT\Default.aspx"
Line 101: using System.Web.UI.WebControls;
Line 102:
Line 103: #line default
Line 104: #line hidden
Line 105:
Line 106: #line 396 "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\web.config"
Line 107: using System.Web.SessionState;
Line 108:
Line 109: #line default
Line 110: #line hidden
Line 111:
Line 112: #line 387 "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\web.config"
Line 113: using System.Collections.Specialized;
Line 114:
Line 115: #line default
Line 116: #line hidden
Line 117:
Line 118: #line 392 "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\web.config"
Line 119: using System.Text.RegularExpressions;
Line 120:
Line 121: #line default
Line 122: #line hidden
Line 123:
Line 124: #line 393 "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\web.config"
Line 125: using System.Web;
Line 126:
Line 127: #line default
Line 128: #line hidden
Line 129:
Line 130: #line 7 "D:\intranet\IT\Default.aspx"
Line 131: using System.Web.DynamicData;
Line 132:
Line 133: #line default
Line 134: #line hidden
Line 135:
Line 136: #line 394 "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\web.config"
Line 137: using System.Web.Caching;
Line 138:
Line 139: #line default
Line 140: #line hidden
Line 141:
Line 142: #line 398 "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\web.config"
Line 143: using System.Web.Profile;
Line 144:
Line 145: #line default
Line 146: #line hidden
Line 147:
Line 148: #line 388 "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\web.config"
Line 149: using System.ComponentModel.DataAnnotations;
Line 150:
Line 151: #line default
Line 152: #line hidden
Line 153:
Line 154: #line 397 "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\web.config"
Line 155: using System.Web.Security;
Line 156:
Line 157: #line default
Line 158: #line hidden
Line 159:
Line 160: #line 384 "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\web.config"
Line 161: using System;
Line 162:
Line 163: #line default
Line 164: #line hidden
Line 165:
Line 166: #line 7 "D:\intranet\IT\Default.aspx"
Line 167: using System.Web.UI.WebControls.WebParts;
Line 168:
Line 169: #line default
Line 170: #line hidden
Line 171:
Line 172: #line 389 "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\web.config"
Line 173: using System.Configuration;
Line 174:
Line 175: #line default
Line 176: #line hidden
Line 177:
Line 178: #line 5 "D:\intranet\IT\Default.aspx"
Line 179: using ASP;
Line 180:
Line 181: #line default
Line 182: #line hidden
Line 183:
Line 184: #line 402 "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\web.config"
Line 185: using System.Web.UI.HtmlControls;
Line 186:
Line 187: #line default
Line 188: #line hidden
Line 189:
Line 190:
Line 191: [System.Runtime.CompilerServices.CompilerGlobalScopeAttribute()]
Line 192: public class it_default_aspx : global::IT_Default, System.Web.IHttpHandler {
Line 193:
Line 194: private static bool @__initialized;
Line 195:
Line 196: private static object @__stringResource;
Line 197:
Line 198: private static object @__fileDependencies;
Line 199:
Line 200: [System.Diagnostics.DebuggerNonUserCodeAttribute()]
Line 201: public it_default_aspx() {
Line 202: string[] dependencies;
Line 203:
Line 204: #line 912304 "D:\intranet\IT\Default.aspx.cs"
Line 205: ((global::System.Web.UI.Page)(this)).AppRelativeVirtualPath = "~/IT/Default.aspx";
Line 206:
Line 207: #line default
Line 208: #line hidden
Line 209: if ((global::ASP.it_default_aspx.@__initialized == false)) {
Line 210: global::ASP.it_default_aspx.@__stringResource = this.ReadStringResource();
Line 211: dependencies = new string[12];
Line 212: dependencies[0] = "~/Controls/KeyLinksControl.ascx";
Line 213: dependencies[1] = "~/Controls/LoginPersonControl.ascx";
Line 214: dependencies[2] = "~/Controls/KeyLinksControl.ascx.cs";
Line 215: dependencies[3] = "~/Intranet.master.cs";
Line 216: dependencies[4] = "~/IT/Default.aspx.cs";
Line 217: dependencies[5] = "~/Intranet.master";
Line 218: dependencies[6] = "~/Controls/ITLinksControl.ascx";
Line 219: dependencies[7] = "~/Controls/MenuControl.ascx";
Line 220: dependencies[8] = "~/IT/Default.aspx";
Line 221: dependencies[9] = "~/Controls/MenuControl.ascx.cs";
Line 222: dependencies[10] = "~/Controls/LoginPersonControl.ascx.cs";
Line 223: dependencies[11] = "~/Controls/ITLinksControl.ascx.cs";
Line 224: global::ASP.it_default_aspx.@__fileDependencies = this.GetWrappedFileDependencies(dependencies);
Line 225: global::ASP.it_default_aspx.@__initialized = true;
Line 226: }
Line 227: this.Server.ScriptTimeout = 30000000;
Line 228: }
Line 229:
Line 230: [System.Diagnostics.DebuggerNonUserCodeAttribute()]
Line 231: private void @__BuildControlContent1(System.Web.UI.Control @__ctrl) {
Line 232: System.Web.UI.IParserAccessor @__parser = ((System.Web.UI.IParserAccessor)(@__ctrl));
Line 233:
Line 234: #line 7 "D:\intranet\IT\Default.aspx"
Line 235: @__parser.AddParsedSubObject(new System.Web.UI.LiteralControl("\r\n\r\n"));
Line 236:
Line 237: #line default
Line 238: #line hidden
Line 239: }
Line 240:
Line 241: [System.Diagnostics.DebuggerNonUserCodeAttribute()]
Line 242: private global::System.Web.UI.HtmlControls.HtmlTableCell @__BuildControltdHeader() {
Line 243: global::System.Web.UI.HtmlControls.HtmlTableCell @__ctrl;
Line 244:
Line 245: #line 11 "D:\intranet\IT\Default.aspx"
Line 246: @__ctrl = new global::System.Web.UI.HtmlControls.HtmlTableCell("td");
Line 247:
Line 248: #line default
Line 249: #line hidden
Line 250: this.tdHeader = @__ctrl;
Line 251: @__ctrl.TemplateControl = this;
Line 252:
Line 253: #line 11 "D:\intranet\IT\Default.aspx"
Line 254: @__ctrl.ID = "tdHeader";
Line 255:
Line 256: #line default
Line 257: #line hidden
Line 258:
Line 259: #line 11 "D:\intranet\IT\Default.aspx"
Line 260: ((System.Web.UI.IAttributeAccessor)(@__ctrl)).SetAttribute("class", "contentHeading");
Line 261:
Line 262: #line default
Line 263: #line hidden
Line 264: System.Web.UI.IParserAccessor @__parser = ((System.Web.UI.IParserAccessor)(@__ctrl));
Line 265:
Line 266: #line 11 "D:\intranet\IT\Default.aspx"
Line 267: @__parser.AddParsedSubObject(new System.Web.UI.LiteralControl("\r\n <span class=\"contentHeading\">IT Department\r\n </span>" +
Line 268: "\r\n "));
Line 269:
Line 270: #line default
Line 271: #line hidden
Line 272: return @__ctrl;
Line 273: }
Line 274:
Line 275: [System.Diagnostics.DebuggerNonUserCodeAttribute()]
Line 276: private void @__BuildControlContent2(System.Web.UI.Control @__ctrl) {
Line 277: System.Web.UI.IParserAccessor @__parser = ((System.Web.UI.IParserAccessor)(@__ctrl));
Line 278:
Line 279: #line 10 "D:\intranet\IT\Default.aspx"
Line 280: @__parser.AddParsedSubObject(new System.Web.UI.LiteralControl("\r\n"));
Line 281:
Line 282: #line default
Line 283: #line hidden
Line 284: global::System.Web.UI.HtmlControls.HtmlTableCell @__ctrl1;
Line 285:
Line 286: #line 10 "D:\intranet\IT\Default.aspx"
Line 287: @__ctrl1 = this.@__BuildControltdHeader();
Line 288:
Line 289: #line default
Line 290: #line hidden
Line 291:
Line 292: #line 10 "D:\intranet\IT\Default.aspx"
Line 293: @__parser.AddParsedSubObject(@__ctrl1);
Line 294:
Line 295: #line default
Line 296: #line hidden
Line 297:
Line 298: #line 10 "D:\intranet\IT\Default.aspx"
Line 299: @__parser.AddParsedSubObject(this.CreateResourceBasedLiteralControl(0, 920, true));
Line 300:
Line 301: #line default
Line 302: #line hidden
Line 303: }
Line 304:
Line 305: [System.Diagnostics.DebuggerNonUserCodeAttribute()]
Line 306: private global::ASP.controls_loginpersoncontrol_ascx @__BuildControlLoginPersonControl1() {
Line 307: global::ASP.controls_loginpersoncontrol_ascx @__ctrl;
Line 308:
Line 309: #line 35 "D:\intranet\IT\Default.aspx"
Line 310: @__ctrl = new global::ASP.controls_loginpersoncontrol_ascx();
Line 311:
Line 312: #line default
Line 313: #line hidden
Line 314: this.LoginPersonControl1 = @__ctrl;
Line 315:
Line 316: #line 35 "D:\intranet\IT\Default.aspx"
Line 317: @__ctrl.InitializeAsUserControl(this.Page);
Line 318:
Line 319: #line default
Line 320: #line hidden
Line 321:
Line 322: #line 35 "D:\intranet\IT\Default.aspx"
Line 323: @__ctrl.ID = "LoginPersonControl1";
Line 324:
Line 325: #line default
Line 326: #line hidden
Line 327: return @__ctrl;
Line 328: }
Line 329:
Line 330: [System.Diagnostics.DebuggerNonUserCodeAttribute()]
Line 331: private global::ASP.controls_keylinkscontrol_ascx @__BuildControlKeyLinksControl1() {
Line 332: global::ASP.controls_keylinkscontrol_ascx @__ctrl;
Line 333:
Line 334: #line 36 "D:\intranet\IT\Default.aspx"
Line 335: @__ctrl = new global::ASP.controls_keylinkscontrol_ascx();
Line 336:
Line 337: #line default
Line 338: #line hidden
Line 339: this.KeyLinksControl1 = @__ctrl;
Line 340:
Line 341: #line 36 "D:\intranet\IT\Default.aspx"
Line 342: @__ctrl.InitializeAsUserControl(this.Page);
Line 343:
Line 344: #line default
Line 345: #line hidden
Line 346:
Line 347: #line 36 "D:\intranet\IT\Default.aspx"
Line 348: @__ctrl.ID = "KeyLinksControl1";
Line 349:
Line 350: #line default
Line 351: #line hidden
Line 352: return @__ctrl;
Line 353: }
Line 354:
Line 355: [System.Diagnostics.DebuggerNonUserCodeAttribute()]
Line 356: private global::ASP.controls_itlinkscontrol_ascx @__BuildControlITLinksControl1() {
Line 357: global::ASP.controls_itlinkscontrol_ascx @__ctrl;
Line 358:
Line 359: #line 37 "D:\intranet\IT\Default.aspx"
Line 360: @__ctrl = new global::ASP.controls_itlinkscontrol_ascx();
Line 361:
Line 362: #line default
Line 363: #line hidden
Line 364: this.ITLinksControl1 = @__ctrl;
Line 365:
Line 366: #line 37 "D:\intranet\IT\Default.aspx"
Line 367: @__ctrl.InitializeAsUserControl(this.Page);
Line 368:
Line 369: #line default
Line 370: #line hidden
Line 371:
Line 372: #line 37 "D:\intranet\IT\Default.aspx"
Line 373: @__ctrl.ID = "ITLinksControl1";
Line 374:
Line 375: #line default
Line 376: #line hidden
Line 377: return @__ctrl;
Line 378: }
Line 379:
Line 380: [System.Diagnostics.DebuggerNonUserCodeAttribute()]
Line 381: private void @__BuildControlContent3(System.Web.UI.Control @__ctrl) {
Line 382: System.Web.UI.IParserAccessor @__parser = ((System.Web.UI.IParserAccessor)(@__ctrl));
Line 383:
Line 384: #line 34 "D:\intranet\IT\Default.aspx"
Line 385: @__parser.AddParsedSubObject(new System.Web.UI.LiteralControl("\r\n "));
Line 386:
Line 387: #line default
Line 388: #line hidden
Line 389: global::ASP.controls_loginpersoncontrol_ascx @__ctrl1;
Line 390:
Line 391: #line 34 "D:\intranet\IT\Default.aspx"
Line 392: @__ctrl1 = this.@__BuildControlLoginPersonControl1();
Line 393:
Line 394: #line default
Line 395: #line hidden
Line 396:
Line 397: #line 34 "D:\intranet\IT\Default.aspx"
Line 398: @__parser.AddParsedSubObject(@__ctrl1);
Line 399:
Line 400: #line default
Line 401: #line hidden
Line 402:
Line 403: #line 34 "D:\intranet\IT\Default.aspx"
Line 404: @__parser.AddParsedSubObject(new System.Web.UI.LiteralControl("\r\n "));
Line 405:
Line 406: #line default
Line 407: #line hidden
Line 408: global::ASP.controls_keylinkscontrol_ascx @__ctrl2;
Line 409:
Line 410: #line 34 "D:\intranet\IT\Default.aspx"
Line 411: @__ctrl2 = this.@__BuildControlKeyLinksControl1();
Line 412:
Line 413: #line default
Line 414: #line hidden
Line 415:
Line 416: #line 34 "D:\intranet\IT\Default.aspx"
Line 417: @__parser.AddParsedSubObject(@__ctrl2);
Line 418:
Line 419: #line default
Line 420: #line hidden
Line 421:
Line 422: #line 34 "D:\intranet\IT\Default.aspx"
Line 423: @__parser.AddParsedSubObject(new System.Web.UI.LiteralControl("\r\n "));
Line 424:
Line 425: #line default
Line 426: #line hidden
Line 427: global::ASP.controls_itlinkscontrol_ascx @__ctrl3;
Line 428:
Line 429: #line 34 "D:\intranet\IT\Default.aspx"
Line 430: @__ctrl3 = this.@__BuildControlITLinksControl1();
Line 431:
Line 432: #line default
Line 433: #line hidden
Line 434:
Line 435: #line 34 "D:\intranet\IT\Default.aspx"
Line 436: @__parser.AddParsedSubObject(@__ctrl3);
Line 437:
Line 438: #line default
Line 439: #line hidden
Line 440:
Line 441: #line 34 "D:\intranet\IT\Default.aspx"
Line 442: @__parser.AddParsedSubObject(new System.Web.UI.LiteralControl("\r\n <br />\r\n"));
Line 443:
Line 444: #line default
Line 445: #line hidden
Line 446: }
Line 447:
Line 448: [System.Diagnostics.DebuggerNonUserCodeAttribute()]
Line 449: private void @__BuildControlContent4(System.Web.UI.Control @__ctrl) {
Line 450: System.Web.UI.IParserAccessor @__parser = ((System.Web.UI.IParserAccessor)(@__ctrl));
Line 451:
Line 452: #line 40 "D:\intranet\IT\Default.aspx"
Line 453: @__parser.AddParsedSubObject(new System.Web.UI.LiteralControl("\r\n"));
Line 454:
Line 455: #line default
Line 456: #line hidden
Line 457: }
Line 458:
Line 459: [System.Diagnostics.DebuggerNonUserCodeAttribute()]
Line 460: private void @__BuildControlTree(it_default_aspx @__ctrl) {
Line 461:
Line 462: #line 1 "D:\intranet\IT\Default.aspx"
Line 463: @__ctrl.Title = "Home Intranet -IT";
Line 464:
Line 465: #line default
Line 466: #line hidden
Line 467:
Line 468: #line 1 "D:\intranet\IT\Default.aspx"
Line 469: @__ctrl.MasterPageFile = "~/Intranet.master";
Line 470:
Line 471: #line default
Line 472: #line hidden
Line 473:
Line 474: #line 1 "D:\intranet\IT\Default.aspx"
Line 475: this.InitializeCulture();
Line 476:
Line 477: #line default
Line 478: #line hidden
Line 479:
Line 480: #line 7 "D:\intranet\IT\Default.aspx"
Line 481: this.AddContentTemplate("PlaceHolderMenuItems", new System.Web.UI.CompiledTemplateBuilder(new System.Web.UI.BuildTemplateMethod(this.@__BuildControlContent1)));
Line 482:
Line 483: #line default
Line 484: #line hidden
Line 485:
Line 486: #line 10 "D:\intranet\IT\Default.aspx"
Line 487: this.AddContentTemplate("MainContent", new System.Web.UI.CompiledTemplateBuilder(new System.Web.UI.BuildTemplateMethod(this.@__BuildControlContent2)));
Line 488:
Line 489: #line default
Line 490: #line hidden
Line 491:
Line 492: #line 34 "D:\intranet\IT\Default.aspx"
Line 493: this.AddContentTemplate("SideContent", new System.Web.UI.CompiledTemplateBuilder(new System.Web.UI.BuildTemplateMethod(this.@__BuildControlContent3)));
Line 494:
Line 495: #line default
Line 496: #line hidden
Line 497:
Line 498: #line 40 "D:\intranet\IT\Default.aspx"
Line 499: this.AddContentTemplate("FooterContent", new System.Web.UI.CompiledTemplateBuilder(new System.Web.UI.BuildTemplateMethod(this.@__BuildControlContent4)));
Line 500:
Line 501: #line default
Line 502: #line hidden
Line 503: System.Web.UI.IParserAccessor @__parser = ((System.Web.UI.IParserAccessor)(@__ctrl));
Line 504:
Line 505: #line 1 "D:\intranet\IT\Default.aspx"
Line 506: @__parser.AddParsedSubObject(new System.Web.UI.LiteralControl("\r\n"));
Line 507:
Line 508: #line default
Line 509: #line hidden
Line 510:
Line 511: #line 1 "D:\intranet\IT\Default.aspx"
Line 512: @__parser.AddParsedSubObject(new System.Web.UI.LiteralControl("\r\n"));
Line 513:
Line 514: #line default
Line 515: #line hidden
Line 516:
Line 517: #line 1 "D:\intranet\IT\Default.aspx"
Line 518: @__parser.AddParsedSubObject(new System.Web.UI.LiteralControl("\r\n"));
Line 519:
Line 520: #line default
Line 521: #line hidden
Line 522:
Line 523: #line 1 "D:\intranet\IT\Default.aspx"
Line 524: @__parser.AddParsedSubObject(new System.Web.UI.LiteralControl("\r\n\r\n"));
Line 525:
Line 526: #line default
Line 527: #line hidden
Line 528: }
Line 529:
Line 530:
Line 531: #line 912304 "D:\intranet\IT\Default.aspx.cs"
Line 532: [System.Diagnostics.DebuggerNonUserCodeAttribute()]
Line 533: protected override void FrameworkInitialize() {
Line 534: base.FrameworkInitialize();
Line 535: this.SetStringResourcePointer(global::ASP.it_default_aspx.@__stringResource, 0);
Line 536: this.@__BuildControlTree(this);
Line 537: this.AddWrappedFileDependencies(global::ASP.it_default_aspx.@__fileDependencies);
Line 538: this.Request.ValidateInput();
Line 539: }
Line 540:
Line 541: #line default
Line 542: #line hidden
Line 543:
Line 544: [System.Diagnostics.DebuggerNonUserCodeAttribute()]
Line 545: public override int GetTypeHashCode() {
Line 546: return 436284461;
Line 547: }
Line 548:
Line 549: [System.Diagnostics.DebuggerNonUserCodeAttribute()]
Line 550: public override void ProcessRequest(System.Web.HttpContext context) {
Line 551: base.ProcessRequest(context);
Line 552: }
Line 553: }
Line 554: }
Line 555:
proviewmedia
Member
3 Points
6 Posts
Black user by IP
Jul 29, 2012 01:24 PM|LINK
Hi I have a code which I have placed in my page
public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender,EventArgs e) { if(!IsPostBack) { string ip = "192.168.1.55";//the restrictive ip if (Page.Request.UserHostAddress.Equals(ip)) { Response.Redirect("Error.aspx"); } } } }But would like to know if and how I can add more ip address,
ie
public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender,EventArgs e) { if(!IsPostBack) { string ip = "192.168.1.55";//the restrictive ip or string ip = "192.168.1.56";//the restrictive ip or string ip = "192.168.1.57";//the restrictive ip if (Page.Request.UserHostAddress.Equals(ip)) { Response.Redirect("Error.aspx"); } } } }the second code will not work so is there another way this should be set out?
CPrakash82
All-Star
18284 Points
2841 Posts
Re: Black user by IP
Jul 29, 2012 02:26 PM|LINK
You should put this list of IP addresses in a list and then check if current ip address exist in the list. Something like this.
var blockedIps = new List<string>() {"192.168.1.55", "192.168.1.56", "192.168.1.57"};
if(blockedIps.Contains(Page.Request.UserHostAddress))
Response.Redirect("Error.aspx");
proviewmedia
Member
3 Points
6 Posts
Re: Black user by IP
Jul 29, 2012 02:32 PM|LINK
I have Just tried this,
using System; using System.Collections; using System.Configuration; using System.Data; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.HtmlControls; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; public partial class IT_Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { var blockedIps = new List<string>() {"192.168.1.2", "192.168.1.56", "192.168.1.57"}; if(blockedIps.Contains(Page.Request.UserHostAddress)) Response.Redirect("NoAccess.aspx"); } } }But get a error,
Server Error in '/' Application.
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: CS0246: The type or namespace name 'List' could not be found (are you missing a using directive or an assembly reference?)
Source Error:
Line 19: { Line 20: Line 21: var blockedIps = new List<string>() {"192.168.1.2", "192.168.1.56", "192.168.1.57"}; Line 22: Line 23: if(blockedIps.Contains(Page.Request.UserHostAddress))Source File: d:\Intranet\IT\Default.aspx.cs Line:21
<div class="expandable">Show Detailed Compiler Output:</div> <div style="display: none;" id="compilerOutputDiv">Line 1: #pragma checksum "D:\intranet\IT\Default.aspx" "{406ea660-64cf-4c82-b6f0-42d48172a799}" "6E1D7040BA783812E5178A7D4BDDDD13" Line 2: //------------------------------------------------------------------------------ Line 3: // <auto-generated> Line 4: // This code was generated by a tool. Line 5: // Runtime Version:4.0.30319.269 Line 6: // Line 7: // Changes to this file may cause incorrect behavior and will be lost if Line 8: // the code is regenerated. Line 9: // </auto-generated> Line 10: //------------------------------------------------------------------------------ Line 11: Line 12: Line 13: Line 14: public partial class IT_Default : System.Web.SessionState.IRequiresSessionState { Line 15: Line 16: Line 17: #line 11 "D:\intranet\IT\Default.aspx" Line 18: protected global::System.Web.UI.HtmlControls.HtmlTableCell tdHeader; Line 19: Line 20: #line default Line 21: #line hidden Line 22: Line 23: Line 24: #line 35 "D:\intranet\IT\Default.aspx" Line 25: protected global::ASP.controls_loginpersoncontrol_ascx LoginPersonControl1; Line 26: Line 27: #line default Line 28: #line hidden Line 29: Line 30: Line 31: #line 36 "D:\intranet\IT\Default.aspx" Line 32: protected global::ASP.controls_keylinkscontrol_ascx KeyLinksControl1; Line 33: Line 34: #line default Line 35: #line hidden Line 36: Line 37: Line 38: #line 37 "D:\intranet\IT\Default.aspx" Line 39: protected global::ASP.controls_itlinkscontrol_ascx ITLinksControl1; Line 40: Line 41: #line default Line 42: #line hidden Line 43: Line 44: protected System.Web.Profile.DefaultProfile Profile { Line 45: get { Line 46: return ((System.Web.Profile.DefaultProfile)(this.Context.Profile)); Line 47: } Line 48: } Line 49: Line 50: protected System.Web.HttpApplication ApplicationInstance { Line 51: get { Line 52: return ((System.Web.HttpApplication)(this.Context.ApplicationInstance)); Line 53: } Line 54: } Line 55: } Line 56: namespace ASP { Line 57: Line 58: #line 7 "D:\intranet\IT\Default.aspx" Line 59: using System.Web.UI.WebControls.Expressions; Line 60: Line 61: #line default Line 62: #line hidden Line 63: Line 64: #line 385 "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\web.config" Line 65: using System.Collections; Line 66: Line 67: #line default Line 68: #line hidden Line 69: Line 70: #line 391 "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\web.config" Line 71: using System.Text; Line 72: Line 73: #line default Line 74: #line hidden Line 75: Line 76: #line 7 "D:\intranet\IT\Default.aspx" Line 77: using System.Web.UI; Line 78: Line 79: #line default Line 80: #line hidden Line 81: Line 82: #line 386 "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\web.config" Line 83: using System.Collections.Generic; Line 84: Line 85: #line default Line 86: #line hidden Line 87: Line 88: #line 390 "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\web.config" Line 89: using System.Linq; Line 90: Line 91: #line default Line 92: #line hidden Line 93: Line 94: #line 403 "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\web.config" Line 95: using System.Xml.Linq; Line 96: Line 97: #line default Line 98: #line hidden Line 99: Line 100: #line 7 "D:\intranet\IT\Default.aspx" Line 101: using System.Web.UI.WebControls; Line 102: Line 103: #line default Line 104: #line hidden Line 105: Line 106: #line 396 "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\web.config" Line 107: using System.Web.SessionState; Line 108: Line 109: #line default Line 110: #line hidden Line 111: Line 112: #line 387 "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\web.config" Line 113: using System.Collections.Specialized; Line 114: Line 115: #line default Line 116: #line hidden Line 117: Line 118: #line 392 "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\web.config" Line 119: using System.Text.RegularExpressions; Line 120: Line 121: #line default Line 122: #line hidden Line 123: Line 124: #line 393 "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\web.config" Line 125: using System.Web; Line 126: Line 127: #line default Line 128: #line hidden Line 129: Line 130: #line 7 "D:\intranet\IT\Default.aspx" Line 131: using System.Web.DynamicData; Line 132: Line 133: #line default Line 134: #line hidden Line 135: Line 136: #line 394 "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\web.config" Line 137: using System.Web.Caching; Line 138: Line 139: #line default Line 140: #line hidden Line 141: Line 142: #line 398 "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\web.config" Line 143: using System.Web.Profile; Line 144: Line 145: #line default Line 146: #line hidden Line 147: Line 148: #line 388 "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\web.config" Line 149: using System.ComponentModel.DataAnnotations; Line 150: Line 151: #line default Line 152: #line hidden Line 153: Line 154: #line 397 "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\web.config" Line 155: using System.Web.Security; Line 156: Line 157: #line default Line 158: #line hidden Line 159: Line 160: #line 384 "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\web.config" Line 161: using System; Line 162: Line 163: #line default Line 164: #line hidden Line 165: Line 166: #line 7 "D:\intranet\IT\Default.aspx" Line 167: using System.Web.UI.WebControls.WebParts; Line 168: Line 169: #line default Line 170: #line hidden Line 171: Line 172: #line 389 "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\web.config" Line 173: using System.Configuration; Line 174: Line 175: #line default Line 176: #line hidden Line 177: Line 178: #line 5 "D:\intranet\IT\Default.aspx" Line 179: using ASP; Line 180: Line 181: #line default Line 182: #line hidden Line 183: Line 184: #line 402 "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\web.config" Line 185: using System.Web.UI.HtmlControls; Line 186: Line 187: #line default Line 188: #line hidden Line 189: Line 190: Line 191: [System.Runtime.CompilerServices.CompilerGlobalScopeAttribute()] Line 192: public class it_default_aspx : global::IT_Default, System.Web.IHttpHandler { Line 193: Line 194: private static bool @__initialized; Line 195: Line 196: private static object @__stringResource; Line 197: Line 198: private static object @__fileDependencies; Line 199: Line 200: [System.Diagnostics.DebuggerNonUserCodeAttribute()] Line 201: public it_default_aspx() { Line 202: string[] dependencies; Line 203: Line 204: #line 912304 "D:\intranet\IT\Default.aspx.cs" Line 205: ((global::System.Web.UI.Page)(this)).AppRelativeVirtualPath = "~/IT/Default.aspx"; Line 206: Line 207: #line default Line 208: #line hidden Line 209: if ((global::ASP.it_default_aspx.@__initialized == false)) { Line 210: global::ASP.it_default_aspx.@__stringResource = this.ReadStringResource(); Line 211: dependencies = new string[12]; Line 212: dependencies[0] = "~/Controls/KeyLinksControl.ascx"; Line 213: dependencies[1] = "~/Controls/LoginPersonControl.ascx"; Line 214: dependencies[2] = "~/Controls/KeyLinksControl.ascx.cs"; Line 215: dependencies[3] = "~/Intranet.master.cs"; Line 216: dependencies[4] = "~/IT/Default.aspx.cs"; Line 217: dependencies[5] = "~/Intranet.master"; Line 218: dependencies[6] = "~/Controls/ITLinksControl.ascx"; Line 219: dependencies[7] = "~/Controls/MenuControl.ascx"; Line 220: dependencies[8] = "~/IT/Default.aspx"; Line 221: dependencies[9] = "~/Controls/MenuControl.ascx.cs"; Line 222: dependencies[10] = "~/Controls/LoginPersonControl.ascx.cs"; Line 223: dependencies[11] = "~/Controls/ITLinksControl.ascx.cs"; Line 224: global::ASP.it_default_aspx.@__fileDependencies = this.GetWrappedFileDependencies(dependencies); Line 225: global::ASP.it_default_aspx.@__initialized = true; Line 226: } Line 227: this.Server.ScriptTimeout = 30000000; Line 228: } Line 229: Line 230: [System.Diagnostics.DebuggerNonUserCodeAttribute()] Line 231: private void @__BuildControlContent1(System.Web.UI.Control @__ctrl) { Line 232: System.Web.UI.IParserAccessor @__parser = ((System.Web.UI.IParserAccessor)(@__ctrl)); Line 233: Line 234: #line 7 "D:\intranet\IT\Default.aspx" Line 235: @__parser.AddParsedSubObject(new System.Web.UI.LiteralControl("\r\n\r\n")); Line 236: Line 237: #line default Line 238: #line hidden Line 239: } Line 240: Line 241: [System.Diagnostics.DebuggerNonUserCodeAttribute()] Line 242: private global::System.Web.UI.HtmlControls.HtmlTableCell @__BuildControltdHeader() { Line 243: global::System.Web.UI.HtmlControls.HtmlTableCell @__ctrl; Line 244: Line 245: #line 11 "D:\intranet\IT\Default.aspx" Line 246: @__ctrl = new global::System.Web.UI.HtmlControls.HtmlTableCell("td"); Line 247: Line 248: #line default Line 249: #line hidden Line 250: this.tdHeader = @__ctrl; Line 251: @__ctrl.TemplateControl = this; Line 252: Line 253: #line 11 "D:\intranet\IT\Default.aspx" Line 254: @__ctrl.ID = "tdHeader"; Line 255: Line 256: #line default Line 257: #line hidden Line 258: Line 259: #line 11 "D:\intranet\IT\Default.aspx" Line 260: ((System.Web.UI.IAttributeAccessor)(@__ctrl)).SetAttribute("class", "contentHeading"); Line 261: Line 262: #line default Line 263: #line hidden Line 264: System.Web.UI.IParserAccessor @__parser = ((System.Web.UI.IParserAccessor)(@__ctrl)); Line 265: Line 266: #line 11 "D:\intranet\IT\Default.aspx" Line 267: @__parser.AddParsedSubObject(new System.Web.UI.LiteralControl("\r\n <span class=\"contentHeading\">IT Department\r\n </span>" + Line 268: "\r\n ")); Line 269: Line 270: #line default Line 271: #line hidden Line 272: return @__ctrl; Line 273: } Line 274: Line 275: [System.Diagnostics.DebuggerNonUserCodeAttribute()] Line 276: private void @__BuildControlContent2(System.Web.UI.Control @__ctrl) { Line 277: System.Web.UI.IParserAccessor @__parser = ((System.Web.UI.IParserAccessor)(@__ctrl)); Line 278: Line 279: #line 10 "D:\intranet\IT\Default.aspx" Line 280: @__parser.AddParsedSubObject(new System.Web.UI.LiteralControl("\r\n")); Line 281: Line 282: #line default Line 283: #line hidden Line 284: global::System.Web.UI.HtmlControls.HtmlTableCell @__ctrl1; Line 285: Line 286: #line 10 "D:\intranet\IT\Default.aspx" Line 287: @__ctrl1 = this.@__BuildControltdHeader(); Line 288: Line 289: #line default Line 290: #line hidden Line 291: Line 292: #line 10 "D:\intranet\IT\Default.aspx" Line 293: @__parser.AddParsedSubObject(@__ctrl1); Line 294: Line 295: #line default Line 296: #line hidden Line 297: Line 298: #line 10 "D:\intranet\IT\Default.aspx" Line 299: @__parser.AddParsedSubObject(this.CreateResourceBasedLiteralControl(0, 920, true)); Line 300: Line 301: #line default Line 302: #line hidden Line 303: } Line 304: Line 305: [System.Diagnostics.DebuggerNonUserCodeAttribute()] Line 306: private global::ASP.controls_loginpersoncontrol_ascx @__BuildControlLoginPersonControl1() { Line 307: global::ASP.controls_loginpersoncontrol_ascx @__ctrl; Line 308: Line 309: #line 35 "D:\intranet\IT\Default.aspx" Line 310: @__ctrl = new global::ASP.controls_loginpersoncontrol_ascx(); Line 311: Line 312: #line default Line 313: #line hidden Line 314: this.LoginPersonControl1 = @__ctrl; Line 315: Line 316: #line 35 "D:\intranet\IT\Default.aspx" Line 317: @__ctrl.InitializeAsUserControl(this.Page); Line 318: Line 319: #line default Line 320: #line hidden Line 321: Line 322: #line 35 "D:\intranet\IT\Default.aspx" Line 323: @__ctrl.ID = "LoginPersonControl1"; Line 324: Line 325: #line default Line 326: #line hidden Line 327: return @__ctrl; Line 328: } Line 329: Line 330: [System.Diagnostics.DebuggerNonUserCodeAttribute()] Line 331: private global::ASP.controls_keylinkscontrol_ascx @__BuildControlKeyLinksControl1() { Line 332: global::ASP.controls_keylinkscontrol_ascx @__ctrl; Line 333: Line 334: #line 36 "D:\intranet\IT\Default.aspx" Line 335: @__ctrl = new global::ASP.controls_keylinkscontrol_ascx(); Line 336: Line 337: #line default Line 338: #line hidden Line 339: this.KeyLinksControl1 = @__ctrl; Line 340: Line 341: #line 36 "D:\intranet\IT\Default.aspx" Line 342: @__ctrl.InitializeAsUserControl(this.Page); Line 343: Line 344: #line default Line 345: #line hidden Line 346: Line 347: #line 36 "D:\intranet\IT\Default.aspx" Line 348: @__ctrl.ID = "KeyLinksControl1"; Line 349: Line 350: #line default Line 351: #line hidden Line 352: return @__ctrl; Line 353: } Line 354: Line 355: [System.Diagnostics.DebuggerNonUserCodeAttribute()] Line 356: private global::ASP.controls_itlinkscontrol_ascx @__BuildControlITLinksControl1() { Line 357: global::ASP.controls_itlinkscontrol_ascx @__ctrl; Line 358: Line 359: #line 37 "D:\intranet\IT\Default.aspx" Line 360: @__ctrl = new global::ASP.controls_itlinkscontrol_ascx(); Line 361: Line 362: #line default Line 363: #line hidden Line 364: this.ITLinksControl1 = @__ctrl; Line 365: Line 366: #line 37 "D:\intranet\IT\Default.aspx" Line 367: @__ctrl.InitializeAsUserControl(this.Page); Line 368: Line 369: #line default Line 370: #line hidden Line 371: Line 372: #line 37 "D:\intranet\IT\Default.aspx" Line 373: @__ctrl.ID = "ITLinksControl1"; Line 374: Line 375: #line default Line 376: #line hidden Line 377: return @__ctrl; Line 378: } Line 379: Line 380: [System.Diagnostics.DebuggerNonUserCodeAttribute()] Line 381: private void @__BuildControlContent3(System.Web.UI.Control @__ctrl) { Line 382: System.Web.UI.IParserAccessor @__parser = ((System.Web.UI.IParserAccessor)(@__ctrl)); Line 383: Line 384: #line 34 "D:\intranet\IT\Default.aspx" Line 385: @__parser.AddParsedSubObject(new System.Web.UI.LiteralControl("\r\n ")); Line 386: Line 387: #line default Line 388: #line hidden Line 389: global::ASP.controls_loginpersoncontrol_ascx @__ctrl1; Line 390: Line 391: #line 34 "D:\intranet\IT\Default.aspx" Line 392: @__ctrl1 = this.@__BuildControlLoginPersonControl1(); Line 393: Line 394: #line default Line 395: #line hidden Line 396: Line 397: #line 34 "D:\intranet\IT\Default.aspx" Line 398: @__parser.AddParsedSubObject(@__ctrl1); Line 399: Line 400: #line default Line 401: #line hidden Line 402: Line 403: #line 34 "D:\intranet\IT\Default.aspx" Line 404: @__parser.AddParsedSubObject(new System.Web.UI.LiteralControl("\r\n ")); Line 405: Line 406: #line default Line 407: #line hidden Line 408: global::ASP.controls_keylinkscontrol_ascx @__ctrl2; Line 409: Line 410: #line 34 "D:\intranet\IT\Default.aspx" Line 411: @__ctrl2 = this.@__BuildControlKeyLinksControl1(); Line 412: Line 413: #line default Line 414: #line hidden Line 415: Line 416: #line 34 "D:\intranet\IT\Default.aspx" Line 417: @__parser.AddParsedSubObject(@__ctrl2); Line 418: Line 419: #line default Line 420: #line hidden Line 421: Line 422: #line 34 "D:\intranet\IT\Default.aspx" Line 423: @__parser.AddParsedSubObject(new System.Web.UI.LiteralControl("\r\n ")); Line 424: Line 425: #line default Line 426: #line hidden Line 427: global::ASP.controls_itlinkscontrol_ascx @__ctrl3; Line 428: Line 429: #line 34 "D:\intranet\IT\Default.aspx" Line 430: @__ctrl3 = this.@__BuildControlITLinksControl1(); Line 431: Line 432: #line default Line 433: #line hidden Line 434: Line 435: #line 34 "D:\intranet\IT\Default.aspx" Line 436: @__parser.AddParsedSubObject(@__ctrl3); Line 437: Line 438: #line default Line 439: #line hidden Line 440: Line 441: #line 34 "D:\intranet\IT\Default.aspx" Line 442: @__parser.AddParsedSubObject(new System.Web.UI.LiteralControl("\r\n <br />\r\n")); Line 443: Line 444: #line default Line 445: #line hidden Line 446: } Line 447: Line 448: [System.Diagnostics.DebuggerNonUserCodeAttribute()] Line 449: private void @__BuildControlContent4(System.Web.UI.Control @__ctrl) { Line 450: System.Web.UI.IParserAccessor @__parser = ((System.Web.UI.IParserAccessor)(@__ctrl)); Line 451: Line 452: #line 40 "D:\intranet\IT\Default.aspx" Line 453: @__parser.AddParsedSubObject(new System.Web.UI.LiteralControl("\r\n")); Line 454: Line 455: #line default Line 456: #line hidden Line 457: } Line 458: Line 459: [System.Diagnostics.DebuggerNonUserCodeAttribute()] Line 460: private void @__BuildControlTree(it_default_aspx @__ctrl) { Line 461: Line 462: #line 1 "D:\intranet\IT\Default.aspx" Line 463: @__ctrl.Title = "Home Intranet -IT"; Line 464: Line 465: #line default Line 466: #line hidden Line 467: Line 468: #line 1 "D:\intranet\IT\Default.aspx" Line 469: @__ctrl.MasterPageFile = "~/Intranet.master"; Line 470: Line 471: #line default Line 472: #line hidden Line 473: Line 474: #line 1 "D:\intranet\IT\Default.aspx" Line 475: this.InitializeCulture(); Line 476: Line 477: #line default Line 478: #line hidden Line 479: Line 480: #line 7 "D:\intranet\IT\Default.aspx" Line 481: this.AddContentTemplate("PlaceHolderMenuItems", new System.Web.UI.CompiledTemplateBuilder(new System.Web.UI.BuildTemplateMethod(this.@__BuildControlContent1))); Line 482: Line 483: #line default Line 484: #line hidden Line 485: Line 486: #line 10 "D:\intranet\IT\Default.aspx" Line 487: this.AddContentTemplate("MainContent", new System.Web.UI.CompiledTemplateBuilder(new System.Web.UI.BuildTemplateMethod(this.@__BuildControlContent2))); Line 488: Line 489: #line default Line 490: #line hidden Line 491: Line 492: #line 34 "D:\intranet\IT\Default.aspx" Line 493: this.AddContentTemplate("SideContent", new System.Web.UI.CompiledTemplateBuilder(new System.Web.UI.BuildTemplateMethod(this.@__BuildControlContent3))); Line 494: Line 495: #line default Line 496: #line hidden Line 497: Line 498: #line 40 "D:\intranet\IT\Default.aspx" Line 499: this.AddContentTemplate("FooterContent", new System.Web.UI.CompiledTemplateBuilder(new System.Web.UI.BuildTemplateMethod(this.@__BuildControlContent4))); Line 500: Line 501: #line default Line 502: #line hidden Line 503: System.Web.UI.IParserAccessor @__parser = ((System.Web.UI.IParserAccessor)(@__ctrl)); Line 504: Line 505: #line 1 "D:\intranet\IT\Default.aspx" Line 506: @__parser.AddParsedSubObject(new System.Web.UI.LiteralControl("\r\n")); Line 507: Line 508: #line default Line 509: #line hidden Line 510: Line 511: #line 1 "D:\intranet\IT\Default.aspx" Line 512: @__parser.AddParsedSubObject(new System.Web.UI.LiteralControl("\r\n")); Line 513: Line 514: #line default Line 515: #line hidden Line 516: Line 517: #line 1 "D:\intranet\IT\Default.aspx" Line 518: @__parser.AddParsedSubObject(new System.Web.UI.LiteralControl("\r\n")); Line 519: Line 520: #line default Line 521: #line hidden Line 522: Line 523: #line 1 "D:\intranet\IT\Default.aspx" Line 524: @__parser.AddParsedSubObject(new System.Web.UI.LiteralControl("\r\n\r\n")); Line 525: Line 526: #line default Line 527: #line hidden Line 528: } Line 529: Line 530: Line 531: #line 912304 "D:\intranet\IT\Default.aspx.cs" Line 532: [System.Diagnostics.DebuggerNonUserCodeAttribute()] Line 533: protected override void FrameworkInitialize() { Line 534: base.FrameworkInitialize(); Line 535: this.SetStringResourcePointer(global::ASP.it_default_aspx.@__stringResource, 0); Line 536: this.@__BuildControlTree(this); Line 537: this.AddWrappedFileDependencies(global::ASP.it_default_aspx.@__fileDependencies); Line 538: this.Request.ValidateInput(); Line 539: } Line 540: Line 541: #line default Line 542: #line hidden Line 543: Line 544: [System.Diagnostics.DebuggerNonUserCodeAttribute()] Line 545: public override int GetTypeHashCode() { Line 546: return 436284461; Line 547: } Line 548: Line 549: [System.Diagnostics.DebuggerNonUserCodeAttribute()] Line 550: public override void ProcessRequest(System.Web.HttpContext context) { Line 551: base.ProcessRequest(context); Line 552: } Line 553: } Line 554: } Line 555:CPrakash82
All-Star
18284 Points
2841 Posts
Re: Black user by IP
Jul 29, 2012 02:41 PM|LINK
Add an using statement at top.
using System.Collections.Generic;
proviewmedia
Member
3 Points
6 Posts
Re: Black user by IP
Jul 29, 2012 02:48 PM|LINK
You are a STAR!
Thanks so much it worked