Search Results

Search found 36 results on 2 pages for 'loginview'.

Page 2/2 | < Previous Page | 1 2 

  • Binding menu items to a sitemap.

    - by Ricardo Deano
    Hello all..this is driving me nuts. I have a navigation menu I would like to display based upon user roles (using.net membership) After several hours and headaches (from banging my head against the desk) I was wondering if someone can point me in the error of my ways. Page: <body> <form runat="server"> <div class="page"> <div class="header"> <div class="loginDisplay"> <asp:LoginView ID="HeadLoginView" runat="server" EnableViewState="false"> <AnonymousTemplate> <a href="~/Login.aspx" ID="HeadLoginStatus" runat="server">Log In</a> </AnonymousTemplate> <LoggedInTemplate> Welcome <span class="bold"><asp:LoginName ID="HeadLoginName" runat="server" /></span>! [ <asp:LoginStatus ID="HeadLoginStatus" runat="server" LogoutAction="Redirect" LogoutText="Log Out" LogoutPageUrl="~/Open/Close.aspx"/> ] </LoggedInTemplate> </asp:LoginView> </div> <div class="clear hideSkiplink"> <asp:Menu ID="NavigationMenu" runat="server" CssClass="menu" IncludeStyleBlock="False" Orientation="Horizontal" DataSourceID="AugustSiteMap" /> <asp:SiteMapDataSource ID="AugustSiteMap" runat="server" ShowStartingNode="false"/> </div> </div> SiteMap: <?xml version="1.0" encoding="utf-8" ?> <siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" > <siteMapNode url="~/Default.aspx" title="Home" description="Home"> <siteMapNode title="Open Pages" description="Open Pages"> <siteMapNode url="~/Open/Login.aspx" title="Login Page" description="Login Page" roles="*"/> <siteMapNode url="~/Open/Close.aspx" title="Thank you for using Valpak Data Solutions Online Reporting" description="Thank you for using Valpak Data Solutions Online Reporting" roles="*"/> </siteMapNode> <siteMapNode title="Logged In Open Pages" description="Logged In Open Pages"> <siteMapNode url="~/Landing.aspx" title="Landing Page" description="Landing Page" roles="*"/> <siteMapNode url="~/ContactUs.aspx" title="Contact Us" description="Contact Us" roles="*"/> </siteMapNode> <siteMapNode title="Restricted Pages" description="Resticted Pages"> <siteMapNode url="~/Restricted/ProductSearch.aspx" title=" Product Search" description=" Product Search" roles="*"/> <siteMapNode url="~/Restricted/ReportOutput.aspx" title="Report Output" description="Report Output" roles="Admin"/> </siteMapNode> </siteMapNode> </siteMap> Webconfig: <roleManager enabled="true" /> <siteMap defaultProvider="XmlSiteMapProvider" enabled="true"> <providers> <add name="XmlSiteMapProvider" description="AugustSiteMap" type="System.Web.XmlSiteMapProvider " siteMapFile="AugustSiteMap.sitemap" securityTrimmingEnabled="true" /> </providers> </siteMap> How can I ensure that when the user is logged in, the appropriate menu items are displayed on the Landing page? Please excuse my ignorance. Still new to all of this and my current method of 'trial and error' has seen me reach suicide levels this morning!

    Read the article

  • How to debug SITE.MASTER ASPX file?

    - by salvationishere
    I am developing a C#/SQL VS 2008 website application and I'm trying to set breakpoints in my site.master file--is there a way to do this? The contents of this file are: <%@ Master Language="C#" AutoEventWireup="true" CodeFile="Site.master.cs" Inherits="Site" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head id="Head1" runat="server"> <title>Forms Authentication, Authorization, and User Accounts</title> <link href="Styles.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="wrapper"> <form id="form1" runat="server"> <div id="header"> <span class="title">User Account Tutorials</span><br /> <span class="breadcrumb"> <asp:SiteMapPath ID="SiteMapPath1" runat="server"> </asp:SiteMapPath> </span> </div> <div id="content"> <asp:ContentPlaceHolder ID="MainContent" runat="server"> <!-- Page-specific content will go here... --> </asp:ContentPlaceHolder> </div> <div id="navigation"> <asp:ContentPlaceHolder ID="LoginContent" runat="server"> <asp:LoginView ID="LoginView1" runat="server"> <LoggedInTemplate> Welcome back,<asp:LoginName ID="LoginName1" runat="server" /> </LoggedInTemplate> <AnonymousTemplate> Hello, stranger! </AnonymousTemplate> </asp:LoginView> <br /> <br /> </asp:ContentPlaceHolder> <asp:LoginStatus ID="LoginStatus1" runat="server" LogoutAction="Redirect" LogoutPageUrl="~/Logout.aspx" /> <ul> <li> <asp:HyperLink runat="server" ID="lnkHome" NavigateUrl="~/Default.aspx">Home</asp:HyperLink> </li> <asp:Repeater runat="server" ID="menu" DataSourceID="SiteMapDataSource1"> <ItemTemplate> <li> <asp:HyperLink ID="lnkMenuItem" runat="server" NavigateUrl='<%# Eval("Url") %>'><%# Eval("Title") %></asp:HyperLink> <asp:Repeater ID="submenu" runat="server" DataSource="<%# ((SiteMapNode) Container.DataItem).ChildNodes %>"> <HeaderTemplate> <ul> </HeaderTemplate> <ItemTemplate> <li> <asp:HyperLink ID="lnkMenuItem" runat="server" NavigateUrl='<%# Eval("Url") %>'><%# Eval("Title") %></asp:HyperLink> </li> </ItemTemplate> <FooterTemplate> </ul> </FooterTemplate> </asp:Repeater> </li> </ItemTemplate> </asp:Repeater> </ul> <asp:SiteMapDataSource ID="SiteMapDataSource1" runat="server" ShowStartingNode="false" /> </div> </form> </div> </body> </html>

    Read the article

  • Doesn't [UIWindow addSubView:] retain?

    - by Dan Ray
    Check it: NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; NSLog(@"Checking login--user value is %@", [defaults valueForKey:@"userID"]); if ([defaults valueForKey:@"userID"] == NULL){ LoginViewController *loginController = [[LoginViewController alloc] initWithNibName:@"LoginView" bundle:nil]; [window addSubview:loginController.view]; [loginController release]; } else { [window addSubview:[navigationController view]]; } Every other place when I put a subview into another view, I release that view after I've done that, because it's now owned by the view it's a subview of. HERE, though, when I do [loginController release], every IBAction on that loginController gets called against a deallocated instance. Commenting out that line makes everything work. I note the difference in approach between my loginController and the navigationController that came with the template; the navigationController is a synthesized property that gets released in -(void)dealloc{ }, so it's still around after being put into window.

    Read the article

  • Switch from a View (Login) to another View with a TabBarController

    - by Raphael
    Hi, i'm new at Iphone SDK Developing and now i need some help. I have a LoginView where the User have to authentificate his legitimacy. After he enter his Username and Passwort he click on the "Sign In" Button. Then i want to load my "Real-App". Here is the Problem because i can't switch from the LoginScreen to the TabBarController. I found many solutions but only for switching to other views. Is there a way to do it ?

    Read the article

  • Expression Web 4 - Master Page Error

    - by Eric J.
    I created an ASP.Net Web Application in VS 2010. That in turn creates an example Site.Master, Default.aspx, and several other example files. I then opened Default.aspx in Expression Web 4 and get the error message The Master Page file 'Site.Master' cannot be loaded. Default.aspx can still be displayed fine in VS 2010. Source.Master: <%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Site.master.cs" Inherits="SampleWebApp.SiteMaster" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head runat="server"> <title></title> <link href="~/Styles/Site.css" rel="stylesheet" type="text/css" /> <asp:ContentPlaceHolder ID="HeadContent" runat="server"> </asp:ContentPlaceHolder> <style type="text/css"> .style1 { font-family: Tunga; } </style> </head> <body> <form runat="server"> <div class="page"> <div class="header"> <div class="title"> <h1 class="style1"> My Application Master Page</h1> </div> <div class="loginDisplay"> <asp:LoginView ID="HeadLoginView" runat="server" EnableViewState="false"> <AnonymousTemplate> [ <a href="~/Account/Login.aspx" ID="HeadLoginStatus" runat="server">Log In</a> ] </AnonymousTemplate> <LoggedInTemplate> Welcome <span class="bold"><asp:LoginName ID="HeadLoginName" runat="server" /></span>! [ <asp:LoginStatus ID="HeadLoginStatus" runat="server" LogoutAction="Redirect" LogoutText="Log Out" LogoutPageUrl="~/"/> ] </LoggedInTemplate> </asp:LoginView> </div> <div class="clear hideSkiplink"> <asp:Menu ID="NavigationMenu" runat="server" CssClass="menu" EnableViewState="false" IncludeStyleBlock="false" Orientation="Horizontal"> <Items> <asp:MenuItem NavigateUrl="~/Default.aspx" Text="Home"> <asp:MenuItem NavigateUrl="~/Home/NewItem.aspx" Text="New Item" Value="New Item"></asp:MenuItem> <asp:MenuItem NavigateUrl="~/Home/AnotherItem.aspx" Text="Another Item" Value="Another Item"></asp:MenuItem> </asp:MenuItem> <asp:MenuItem NavigateUrl="~/About.aspx" Text="About"/> <asp:MenuItem NavigateUrl="~/ContactUs.aspx" Text="ContactUs" Value="ContactUs"> </asp:MenuItem> </Items> </asp:Menu> </div> </div> <div class="main"> <asp:ContentPlaceHolder ID="MainContent" runat="server"/> </div> <div class="clear"> </div> </div> <div class="footer"> </div> </form> </body> </html> Default.aspx: <%@ Page Title="Home Page" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="SampleWebApp._Default" %> <asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent"> <style type="text/css"> .style2 { color: #669900; } .style3 { background-color: #FFFFCC; } </style> </asp:Content> <asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent"> <h2> Welcome to MY page! </h2> <p> To learn more <span class="style2"><strong><em><span class="style3">about</span></em></strong></span> ASP.NET visit <a href="http://www.asp.net" title="ASP.NET Website">www.asp.net</a>. </p> <p> You can also find <a href="http://go.microsoft.com/fwlink/?LinkID=152368&amp;clcid=0x409" title="MSDN ASP.NET Docs">documentation on ASP.NET at MSDN</a>. </p> </asp:Content> Any idea how to get the master page to work properly in Expression Web 4?

    Read the article

  • How to dismiss modal view controller from UITabBarController

    - by user563697
    Currently im developing an iPhone Game...When app loaded a login page is seen...when logged in...from login view controller a welcome screen view controller with tabbar(UITabbarcontroller iVar declared inside and connected to tabbarcontroller with interface builder) is presented(using presentModalViewCotroller)..There the first tab is dealing with account ..loaded from accountController NIb and view controller...inside which there's a logout button...when clicked i need to go to login page under loginview controller... Inside logout button click action method...i had coded like this [self dismissModalViewControllerAnimated:NO]; but on button click nothing happening... first : parent--loginviewcontroller child--welcomescreen view controller Inside welcome screen,in account tab,on logout button click: how could i dismiss the above MVC.... can anyone give me a solution as soon as possible...its urgent...

    Read the article

  • Can't find asp:textbox in Javascript.

    - by Andrew
    I am trying to add the onkeydown attribute to an asp:textbox. For some reason my code can't find the textbox that is inside a loginview. Am I doing something wrong? <script type="text/javascript"> window.onload = function() { UserName.Attributes.Add("onKeyDown", "KeyDownHandler('" + btn.ClientID + "')"); Password.Attributes.Add("onKeyDown", "KeyDownHandler('" + btn.ClientID + "')"); } function KeyDownHandler(btn) { if (event.keyCode == 13) { event.returnValue=false; event.cancel = true; document.getElementById(btn).click(); } } </script>

    Read the article

  • How can I load a Class contained in a website from a DLL referenced by that website???

    - by Morgeh
    Ok so this is alittle bit obscure and I'm not sure its the best way of doing what I'm trying to do but here goes. Basically I have a Presentation Layer Dll in my web site which handles the Model View Presenter classes. The presentation layer also handles login for my website and then calls off to a web service. Currently whenever the presentation layer calls to a model it verifies the users details and if they are invalid it calls to a loginHandler which redirects the user to the login page. However I cannot dynamically load a new istance of the Login Page in my website from within my Presentation layer. I've tried to use reflection to dynamically load the class but Since the method call is in the presentation assembly it is only looking within that assembly while the page I want to load is in the website. heres the reflection code that loads the View: public ILoginView LoadView() { string viewName = ConfigurationManager.AppSettings["LoginView"].ToString(); Type type = Type.GetType(viewName, true); object newInstance = Activator.CreateInstance(type); return newInstance as ILoginView; } Anyone got any suggestions on how to search within the website assembly? Ideal I don't want to tie this implementation into the website specifically as the presentation layer is also used in a WPF application.

    Read the article

  • Keep width even when column changes. (HTML)

    - by Andrew
    I have a login on the left sidebar of my website. When a user is logged in, the sidebar width doesn't remain the same as it was when the user wasn't logged in. Is there a way to keep the width the same? <!-- Start Sidebar --> <td id="sidebar" valign="top" height="400px" style="width: 200px"> <!-- Login Form --> <table id="TABLE2"> <tr> <td valign="top"> <asp:LoginView ID="LoginView1" runat="server"> <LoggedInTemplate> <br /> <br /> You are currently logged in. </LoggedInTemplate> <AnonymousTemplate> <asp:Login ID="Login1" runat="server" BorderPadding="0" BorderStyle="None" BorderWidth="0px" Font-Names="Verdana" Font-Size="0.8em" CreateUserText="Sign Up Now!" CreateUserUrl="http://www.tiltonindustries.com/Tilton/Login/CreateAccount.aspx" Height="1px" PasswordRecoveryText="Forgot your password?" PasswordRecoveryUrl="http://www.tiltonindustries.com/Tilton/Login/ForgotPassword.aspx" TextLayout="TextOnTop" Width="200px" DestinationPageUrl="http://www.tiltonindustries.com/Tilton/default.aspx"> <TitleTextStyle Font-Bold="True" Font-Size="0.9em"/> <InstructionTextStyle Font-Italic="True" ForeColor="Black" /> <TextBoxStyle Font-Size="0.8em" /> <LoginButtonStyle BorderStyle="Solid" BorderWidth="1px" Font-Names="Verdana" Font-Size="0.8em" ForeColor="#990000" /> <LayoutTemplate> <table border="0" cellpadding="4" cellspacing="0" style="border-collapse: collapse; height: 159px;"> <tr> <td style="height: 176px; width: 135px;"> <table border="0" cellpadding="0" style="width: 219px; height: 1px" id="TABLE1"> <tr> <td align="center" style="font-weight: bold; font-size: 0.9em; color: white; height: 18px; background-color: #990000; text-align: center" colspan="2"> Log In</td> </tr> <tr> <td style="width: 94px; height: 10px;"> </td> <td style="height: 10px; width: 78px;"> </td> </tr> <tr> <td style="width: 94px; height: 20px; text-align: right"> <asp:Label ID="UserNameLabel" runat="server" AssociatedControlID="UserName">User Name:</asp:Label> &nbsp; </td> <td style="height: 20px; text-align: left; width: 78px;"> <asp:TextBox ID="UserName" runat="server" Font-Size="0.9em" EnableViewState="False" Width="100px" MaxLength="20"></asp:TextBox><asp:RequiredFieldValidator ID="UserNameRequired" runat="server" ControlToValidate="UserName" ErrorMessage="User Name is required." ToolTip="User Name is required." ValidationGroup="ctl01$Login1">*</asp:RequiredFieldValidator></td> </tr> <tr> <td style="width: 94px; text-align: right"> <asp:Label ID="PasswordLabel" runat="server" AssociatedControlID="Password">Password:</asp:Label> &nbsp; </td> <td style="text-align: left; width: 78px;"> <asp:TextBox ID="Password" runat="server" Font-Size="0.9em" TextMode="Password" Width="100px"></asp:TextBox><asp:RequiredFieldValidator ID="PasswordRequired" runat="server" ControlToValidate="Password" ErrorMessage="Password is required." ToolTip="Password is required." ValidationGroup="ctl01$Login1">*</asp:RequiredFieldValidator></td> </tr> <tr> <td style="height: 20px; width: 94px;"> &nbsp;</td> <td style="height: 20px; text-align: left; width: 78px;"> <asp:CheckBox ID="chkRememberMe" runat="server" Text="Remember Me" Width="104px" /></td> </tr> <tr> <td align="center" style="color: red; width: 94px; height: 20px;"> </td> <td align="center" style="color: red; text-align: left; width: 78px; height: 20px;"> <asp:Button ID="LoginButton" runat="server" BorderStyle="Solid" BorderWidth="1px" CommandName="Login" Font-Names="Verdana" Font-Size="1.0 em" Text="Log In" ValidationGroup="ctl01$Login1" Width="59px" BackColor="Gray" BorderColor="Black" Height="20px" /></td> </tr> <tr> <td align="center" style="width: 250px; color: red; height: 35px; text-align: center;" colspan="2"> <asp:Literal ID="FailureText" runat="server" EnableViewState="False"></asp:Literal></td> </tr> <tr> <td style="height: 26px; width: 94px;"> <asp:HyperLink ID="CreateUserLink" runat="server" NavigateUrl="http://www.tiltonindustries.com/Tilton/Login/CreateAccount.aspx">Sign Up Now!</asp:HyperLink>&nbsp; </td> <td style="width: 78px; height: 26px"> <asp:HyperLink ID="PasswordRecoveryLink" runat="server" NavigateUrl="http://www.tiltonindustries.com/Tilton/Login/ForgotPassword.aspx">Forgot your password?</asp:HyperLink></td> </tr> </table> </td> </tr> </table> </LayoutTemplate> </asp:Login> </AnonymousTemplate> </asp:LoginView> <!-- End Login Form --> <!-- Quick Links --> <br /> <br /> <p style="font-size: 14px; font-weight: bold; color: White"> Quick Links:<br /> </p> <br /> <p id="quicklinks"> <a href="default.aspx">Home</a><br /> <a href="services.aspx">Services</a><br /> <a href="matching.aspx">Color Matching</a><br /> <a href="packaging.aspx">Custom Packaging</a><br /> <a href="decorals.aspx">Decorals</a><br /> <a href="delivery.aspx">Delivery</a><br /> <a href="items.aspx">Items</a><br /> <a href="msds.aspx">MSDS</a><br /> <a href="plant.aspx">Plant Capabilities</a><br /> <a href="standard.aspx">Standard Colors</a><br /> <a href="special.aspx">Special Effects</a><br /> <a href="coatings.aspx">Spray Coatings</a><br /> <a href="warranty.aspx">Warranty</a><br /> <a href="http://www.tiltonindustries.com/Tilton/Login/Login.aspx">My Account</a><br /> <a href="gallery.aspx">Gallery</a><br /> <a href="about.aspx">About</a><br /> <a href="faq.aspx">F.A.Q</a><br /> <a href="links.aspx">Links</a><br /> <a href="careers.aspx">Careers</a><br /> <a href="contact.aspx">Contact</a><br /> <br /> </p> </td> </tr> </table> </td> <!-- End Sidebar -->

    Read the article

  • How to do URL authentication in struts2

    - by Enrique Malhotra
    Hi, I am using struts2.1.6 + Spring 2.5 I have four modules in my application. Registration Module Admin Module Quote Module Location Module. In registration module the customer can register himself and only after registering he is supposed to have access of the remaining three modules. I want to implement something like if the action being called belongs to the registration module it will work as normal but if the action being called belongs to the rest of those three modules it first should check if the user is logged-in and session has not timed-out. if yes it should proceed normally otherwise it should redirect to the login page. Through research I have found out that interceptors could be used for this purpose but before proceeding I thought its better to get some feedback on it from experts. Please suggest how it should be done and If possible put some code suggestions. Here is my struts.xml file(The struts.xml contains four different config files belonging to each module): <struts> <include file="struts-default.xml" /> <constant name="struts.i18n.reload" value="false" /> <constant name="struts.objectFactory" value="spring" /> <constant name="struts.devMode" value="false" /> <constant name="struts.serve.static.browserCache" value="false" /> <constant name="struts.enable.DynamicMethodInvocation" value="true" /> <constant name="struts.multipart.maxSize" value="10000000" /> <constant name="struts.multipart.saveDir" value="C:/Temporary_image_location" /> <include file="/com/action/mappingFiles/registration_config.xml" /> <include file="/com/action/mappingFiles/admin_config.xml" /> <include file="/com/action/mappingFiles/quote.xml" /> <include file="/com/action/mappingFiles/location_config.xml" /> </struts> The sample registration_config.xml file is: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" "http://struts.apache.org/dtds/struts-2.0.dtd"> <struts> <package name="registration" extends="struts-default" namespace="/my_company"> <action name="LoginView" class="registration" method="showLoginView"> <result>....</result> <result name="input">...</result> </action> </package> </struts> The sample admin_config.xml file is: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" "http://struts.apache.org/dtds/struts-2.0.dtd"> <struts> <package name="admin" extends="struts-default" namespace="/my_company"> <action name="viewAdmin" class="admin" method="showAdminView"> <result>....</result> <result name="input">...</result> </action> </package> </struts> Same code is there in the rest of two struts2 xml config files. I have used the same namespace in all the four config files with the different package names(As you can see)

    Read the article

  • Top 50 ASP.Net Interview Questions & Answers

    - by Samir R. Bhogayta
    1. What is ASP.Net? It is a framework developed by Microsoft on which we can develop new generation web sites using web forms(aspx), MVC, HTML, Javascript, CSS etc. Its successor of Microsoft Active Server Pages(ASP). Currently there is ASP.NET 4.0, which is used to develop web sites. There are various page extensions provided by Microsoft that are being used for web site development. Eg: aspx, asmx, ascx, ashx, cs, vb, html, xml etc. 2. What’s the use of Response.Output.Write()? We can write formatted output  using Response.Output.Write(). 3. In which event of page cycle is the ViewState available?   After the Init() and before the Page_Load(). 4. What is the difference between Server.Transfer and Response.Redirect?   In Server.Transfer page processing transfers from one page to the other page without making a round-trip back to the client’s browser.  This provides a faster response with a little less overhead on the server.  The clients url history list or current url Server does not update in case of Server.Transfer. Response.Redirect is used to redirect the user’s browser to another page or site.  It performs trip back to the client where the client’s browser is redirected to the new page.  The user’s browser history list is updated to reflect the new address. 5. From which base class all Web Forms are inherited? Page class.  6. What are the different validators in ASP.NET? Required field Validator Range  Validator Compare Validator Custom Validator Regular expression Validator Summary Validator 7. Which validator control you use if you need to make sure the values in two different controls matched? Compare Validator control. 8. What is ViewState? ViewState is used to retain the state of server-side objects between page post backs. 9. Where the viewstate is stored after the page postback? ViewState is stored in a hidden field on the page at client side.  ViewState is transported to the client and back to the server, and is not stored on the server or any other external source. 10. How long the items in ViewState exists? They exist for the life of the current page. 11. What are the different Session state management options available in ASP.NET? In-Process Out-of-Process. In-Process stores the session in memory on the web server. Out-of-Process Session state management stores data in an external server.  The external server may be either a SQL Server or a State Server.  All objects stored in session are required to be serializable for Out-of-Process state management. 12. How you can add an event handler?  Using the Attributes property of server side control. e.g. [csharp] btnSubmit.Attributes.Add(“onMouseOver”,”JavascriptCode();”) [/csharp] 13. What is caching? Caching is a technique used to increase performance by keeping frequently accessed data or files in memory. The request for a cached file/data will be accessed from cache instead of actual location of that file. 14. What are the different types of caching? ASP.NET has 3 kinds of caching : Output Caching, Fragment Caching, Data Caching. 15. Which type if caching will be used if we want to cache the portion of a page instead of whole page? Fragment Caching: It caches the portion of the page generated by the request. For that, we can create user controls with the below code: [xml] <%@ OutputCache Duration=”120? VaryByParam=”CategoryID;SelectedID”%> [/xml] 16. List the events in page life cycle.   1) Page_PreInit 2) Page_Init 3) Page_InitComplete 4) Page_PreLoad 5) Page_Load 6) Page_LoadComplete 7) Page_PreRender 8)Render 17. Can we have a web application running without web.Config file?   Yes 18. Is it possible to create web application with both webforms and mvc? Yes. We have to include below mvc assembly references in the web forms application to create hybrid application. [csharp] System.Web.Mvc System.Web.Razor System.ComponentModel.DataAnnotations [/csharp] 19. Can we add code files of different languages in App_Code folder?   No. The code files must be in same language to be kept in App_code folder. 20. What is Protected Configuration? It is a feature used to secure connection string information. 21. Write code to send e-mail from an ASP.NET application? [csharp] MailMessage mailMess = new MailMessage (); mailMess.From = “[email protected]”; mailMess.To = “[email protected]”; mailMess.Subject = “Test email”; mailMess.Body = “Hi This is a test mail.”; SmtpMail.SmtpServer = “localhost”; SmtpMail.Send (mailMess); [/csharp] MailMessage and SmtpMail are classes defined System.Web.Mail namespace.  22. How can we prevent browser from caching an ASPX page?   We can SetNoStore on HttpCachePolicy object exposed by the Response object’s Cache property: [csharp] Response.Cache.SetNoStore (); Response.Write (DateTime.Now.ToLongTimeString ()); [/csharp] 23. What is the good practice to implement validations in aspx page? Client-side validation is the best way to validate data of a web page. It reduces the network traffic and saves server resources. 24. What are the event handlers that we can have in Global.asax file? Application Events: Application_Start , Application_End, Application_AcquireRequestState, Application_AuthenticateRequest, Application_AuthorizeRequest, Application_BeginRequest, Application_Disposed,  Application_EndRequest, Application_Error, Application_PostRequestHandlerExecute, Application_PreRequestHandlerExecute, Application_PreSendRequestContent, Application_PreSendRequestHeaders, Application_ReleaseRequestState, Application_ResolveRequestCache, Application_UpdateRequestCache Session Events: Session_Start,Session_End 25. Which protocol is used to call a Web service? HTTP Protocol 26. Can we have multiple web config files for an asp.net application? Yes. 27. What is the difference between web config and machine config? Web config file is specific to a web application where as machine config is specific to a machine or server. There can be multiple web config files into an application where as we can have only one machine config file on a server. 28.  Explain role based security ?   Role Based Security used to implement security based on roles assigned to user groups in the organization. Then we can allow or deny users based on their role in the organization. Windows defines several built-in groups, including Administrators, Users, and Guests. [xml] <AUTHORIZATION>< authorization > < allow roles=”Domain_Name\Administrators” / >   < !– Allow Administrators in domain. — > < deny users=”*”  / >                            < !– Deny anyone else. — > < /authorization > [/xml] 29. What is Cross Page Posting? When we click submit button on a web page, the page post the data to the same page. The technique in which we post the data to different pages is called Cross Page posting. This can be achieved by setting POSTBACKURL property of  the button that causes the postback. Findcontrol method of PreviousPage can be used to get the posted values on the page to which the page has been posted. 30. How can we apply Themes to an asp.net application? We can specify the theme in web.config file. Below is the code example to apply theme: [xml] <configuration> <system.web> <pages theme=”Windows7? /> </system.web> </configuration> [/xml] 31: What is RedirectPermanent in ASP.Net?   RedirectPermanent Performs a permanent redirection from the requested URL to the specified URL. Once the redirection is done, it also returns 301 Moved Permanently responses. 32: What is MVC? MVC is a framework used to create web applications. The web application base builds on  Model-View-Controller pattern which separates the application logic from UI, and the input and events from the user will be controlled by the Controller. 33. Explain the working of passport authentication. First of all it checks passport authentication cookie. If the cookie is not available then the application redirects the user to Passport Sign on page. Passport service authenticates the user details on sign on page and if valid then stores the authenticated cookie on client machine and then redirect the user to requested page 34. What are the advantages of Passport authentication? All the websites can be accessed using single login credentials. So no need to remember login credentials for each web site. Users can maintain his/ her information in a single location. 35. What are the asp.net Security Controls? <asp:Login>: Provides a standard login capability that allows the users to enter their credentials <asp:LoginName>: Allows you to display the name of the logged-in user <asp:LoginStatus>: Displays whether the user is authenticated or not <asp:LoginView>: Provides various login views depending on the selected template <asp:PasswordRecovery>:  email the users their lost password 36: How do you register JavaScript for webcontrols ? We can register javascript for controls using <CONTROL -name>Attribtues.Add(scriptname,scripttext) method. 37. In which event are the controls fully loaded? Page load event. 38: what is boxing and unboxing? Boxing is assigning a value type to reference type variable. Unboxing is reverse of boxing ie. Assigning reference type variable to value type variable. 39. Differentiate strong typing and weak typing In strong typing, the data types of variable are checked at compile time. On the other hand, in case of weak typing the variable data types are checked at runtime. In case of strong typing, there is no chance of compilation error. Scripts use weak typing and hence issues arises at runtime. 40. How we can force all the validation controls to run? The Page.Validate() method is used to force all the validation controls to run and to perform validation. 41. List all templates of the Repeater control. ItemTemplate AlternatingltemTemplate SeparatorTemplate HeaderTemplate FooterTemplate 42. List the major built-in objects in ASP.NET?  Application Request Response Server Session Context Trace 43. What is the appSettings Section in the web.config file? The appSettings block in web config file sets the user-defined values for the whole application. For example, in the following code snippet, the specified ConnectionString section is used throughout the project for database connection: [csharp] <em><configuration> <appSettings> <add key=”ConnectionString” value=”server=local; pwd=password; database=default” /> </appSettings></em> [/csharp] 44.      Which data type does the RangeValidator control support? The data types supported by the RangeValidator control are Integer, Double, String, Currency, and Date. 45. What is the difference between an HtmlInputCheckBox control and anHtmlInputRadioButton control? In HtmlInputCheckBoxcontrol, multiple item selection is possible whereas in HtmlInputRadioButton controls, we can select only single item from the group of items. 46. Which namespaces are necessary to create a localized application? System.Globalization System.Resources 47. What are the different types of cookies in ASP.NET? Session Cookie – Resides on the client machine for a single session until the user does not log out. Persistent Cookie – Resides on a user’s machine for a period specified for its expiry, such as 10 days, one month, and never. 48. What is the file extension of web service? Web services have file extension .asmx.. 49. What are the components of ADO.NET? The components of ADO.Net are Dataset, Data Reader, Data Adaptor, Command, connection. 50. What is the difference between ExecuteScalar and ExecuteNonQuery? ExecuteScalar returns output value where as ExecuteNonQuery does not return any value but the number of rows affected by the query. ExecuteScalar used for fetching a single value and ExecuteNonQuery used to execute Insert and Update statements.

    Read the article

< Previous Page | 1 2