News:

SQL Table To C# Entity Model ConverterEntity Model (Class Properties) to SQL Table ConverterIf you encounter any trouble visiting our site, please contact us.

Mcq Answers for Asp.net

public static void RegisterRoutes(RouteCollectionroutes) 
{  
  routes.Add(new DynamicDataRoute("{table}/ListDetails.aspx") { Action = PageAction.List,ViewName = "ListDetails",  Model = DefaultModel});

  routes.Add(new DynamicDataRoute("{table}/ListDetails.aspx") {Action = PageAction.Details,ViewName = "ListDetails",Model = DefaultModel});
}

You need to display the items in a table named Products by using a custom layout. What should you do?

  1. Add a new Web page named Products.aspx to the Dynamic Data\PageTemplates folder of the Web site.

  2. Add a new folder named Products to the Dynamic Data\CustomPages folder of the Web site. Add a new Web page named ListDetails.aspx to the Products folder.

  3. Add a new Web user control named Products.ascx to the Dynamic Data\Filters folder of the Web site.In the code-behind file for the control, change the base class from UserControl to System.Web.
    DynamicData.QueryableFilterUserControl.

  4. Add a new Web user control named Products_ListDetails.ascx to the Dynamic Data\EntityTemplates folder of the Web site. In the code-behind file for the control, chan

Answer: Answer is a

  1. Add a DynamicDataManager control to the Web page.

  2. Disable the auto-generated fields on GridView1. Add a DynamicField control for each field of the Product class.

  3. Add the following code segment to the Application_Start method in the Global.asax.cs file.

    DefaultModel.RegisterContext(typeof(System.Web.UI.WebControls.ObjectDataSource),new ContextConfiguration() {ScaffoldAllTables = true});
    
  4. Add the following code segment to the Page_Init method of the Web page

    GridView1.EnableDynamicData(typeof(Product));
    
Answer: Answer is b, d

  1. <asp:TextBox ID="txt1" runat="server" CausesValidation="true" ValidationGroup="Numeric" />
  2.  <asp:TextBox ID="txt1" runat="server" EnableClientScript="true" ValidationGroup="Numeric" />
  3.  <asp:TextBox ID="txt1" runat="server" />
    <asp:RegularExpressionValidator ID="val1" runat="server" ControlToValidate="txt1" ValidationExpression="[0-9]*" ErrorMessage="Invalid input value" />
  4.  <asp:TextBox ID="txt1" runat="server" />
    <asp:RegularExpressionValidator ID="val1" EnableClientScript="true" ControlToValidate="txt1" ValidationExpression="[0-9]*" ErrorMessage="Invalid input value" />
Answer: Answer is c

  1. <script type="text/javascript">
    function validate_value(obj, args) {
    return
    (args.Value >= 1 && args.Value <= 10);
    }
    </script>
  2. <script type="text/javascript">
    function validate_value(obj, args) {
    args.IsValid =
    (args.Value >= 1 && args.Value <= 10);
    }
    </script>
  3. <asp:TextBox ID="txt1" runat="server" />
    <asp:CustomValidator ID="val1" runat="server" ControlToValidate="txt1" ClientValidationFunction="validate_value" ErrorMessage="Value invalid" />
  4.  <asp:TextBox ID="txt1" runat="server" onChange="validate_value(this, args)" />
Answer: Answer is b, c

  1. Add an HTML input type="file" control. Add an onSubmit handler to the form to check the file size and cancel the form submission if the file size is too large.

  2. Add an HTML input type="file" control. Add an onChange handler to the input control to check the file size and cancel the upload if the file size is too large.

  3. Add an ASP.NET FileUpload control and configure it to run on the server. Add a server-side OnClick handler to the form's Submit button to save the file only if the file size is allowed

  4. Add an ASP.NET FileUpload control and configure it to run on the server. Add a server-side OnDataBinding handler that saves the file only if the file size is allowed.

Answer: Answer is c

  1. For each column, output the following HTML, where COL is replaced by the name of the column.

    <label>COL</label>
    <input name="COL" type="text" id="COL" />
  2. For each column, output the following HTML, where COL is replaced by the name of the column.

    <label AssociatedControlID="COL">COL</label>
    <input name="COL" type="text" id="COL" />
  3. For each column, create an asp:Label control and a corresponding asp:TextBox that have the same ID.

  4. For each column, create an asp:Label control and set the AssociatedControlID to the ID of the corresponding asp:Textbox control.

Answer: Answer is d

  1. Write a JavaScript function that uses document.write to write out an asp:MenuItem for each string array element.

  2. In the Page_Render handler, use Response.Write to write out an asp:MenuItem for each string array element.

  3. Set the DataSource attribute of asp:Menu to the name of the array.

  4. In the Page_Load handler, create an instance of asp:MenuItem for each string array element, and add each of these instances to the menu's Items collection

Answer: Answer is d

  1. Call document.write.

  2. Call Response.Write.

  3. Call HttpUtility.UrlEncode

  4. Call HttpUtility.HtmlEncode

Answer: Answer is d

<div class="dropdown-menu">
<div class="menu-title">Menu One</div>
<div class="menu-items" style="display:none;">
<div><a href="#">Item One</a></div>
<div><a href="#">Item Two</a></div>
</div>
</div>
<div class="dropdown-menu">
<div class="menu-title">Menu Two</div>
<div class="menu-items" style="display:none;">
<div><a href="#">Item Three</a></div>
<div><a href="#">Item Four</a></div>
</div>
</div>

You need to write a JavaScript function that will enable the drop-down menus to activate when the user positions the mouse over the menu title. Which code segment should you use?

  1. $(".dropdown-menu").hover(
    function () {
    $(".menu-items").slideDown(100);
    },
    function () {
    $(".menu-items").slideUp(100);
    }
    );
  2. $(".dropdown-menu").hover(
    function () {
    $(".menu-items", this).slideDown(100);
    },
    function () {
    $(".menu-items",this).slideUp(100);
    }
    );
  3. $(".dropdown-menu").hover(
    function () {
    $(this)".slideDown(100);
    },
    function () {
    $(this).slideUp(100);
    }
    );
  4. $(".dropdown-menu").hover(
    function () {
    $("this,".menu-title",).slideDown(100);
    },
    function () {
    $("this.menu-title",).slideUp(100);
    }
    );
Answer: Answer is b

  1. In your site's master page, add a call to Sys.loader.defineScripts to define each of the scripts that are used in the site.

  2. In your site's master page, add a call to Sys.loader.registerScript to define each of the scripts that are used in the site.

  3. In each page that uses scripts, add a call to Sys.get for each script that is needed in that page.

  4. In each page that uses scripts, add a call to Sys.require for each script that is needed in that page.

Answer: Answer is a

Advertisement

BCS Preparation now even more easy. ReadBD is the place where you can find all kind of resources to be successful in BCS,Bank,Islami Bank exam and interview.

Looking for job. Try JobLoader- First ever job search engine in Bangladesh. All open bd jobs now a single mouse click away.

;