Jack @ ASP.NET

As a software engineer, I focus on .NET, especially asp.net, C#, WCF and so on, and I am also very interested in Search Engine Optimization.

Entries Tagged ‘control’

get the selected item text from a ‘select’ html control

it is quite simple via jquery,

$("#yourSelectCtrlId option:selected").text();

Interview Questions on asp.net

  • Whats MSIL, and why should my developers need an appreciation of it if at all? MSIL is the Microsoft Intermediate Language. All .NET compatible languages will get converted to MSIL. asp.net-design-logo
  • Which method do you invoke on the DataAdapter control to load your generated dataset with data? The .Fill() method
  • Can you edit data in the Repeater control? No, it just reads the information from its data source
  • What base class do all Web Forms inherit from? The Page class.
  • Name two properties common in every validation control? ControlToValidate property and Text property.
  • What tags do you need to add within the asp:datagrid tags to bind columns manually? Set AutoGenerateColumns Property to false on the datagrid tag
  • How can you provide an alternating color scheme in a Repeater control? Use the AlternatingItemTemplate
  • What property must you set, and what method must you call in your code, in order to bind the data from some data source to the Repeater control? You must set the DataSource property and call the DataBind method.
  • What tag do you use to add a hyperlink column to the DataGrid? <asp:HyperLinkColumn>
  • What is the transport protocol you use to call a Web service? SOAP is the preferred protocol.
  • True or False: A Web service can only be written in .NET? False
  • What does WSDL stand for? (Web Services Description Language)
  • Explain what a diffgram is, and a good use for one? The DiffGram is one of the two XML formats that you can use to render DataSet object contents to XML. For reading database data to an XML file to be sent to a Web Service.
  • Which template must you provide, in order to display data in a Repeater control? ItemTemplate
  • Terminal Services Manager Tool

    image The Terminal Services Manager tool, Tsadmin.exe, is the main administration tool used to manage existing Terminal Services sessions, users, and processes which are connected to, or running on the Terminal Services server. The Terminal Services Manager tool can be used to manage a single Terminal Services server, or multiple Terminal Services servers. The administrative tasks that can be performed using the Terminal Services Manager tool are listed below:

    • View information on existing Terminal Services servers, users, and any connected or running sessions and processes.
    • Connect to sessions, and disconnect from sessions.
    • Terminate existing sessions and processes
    • Log off users from sessions.
    • Send messages to users and sessions.
    • Monitor users, sessions, and processes

    The Actions menu on the Terminal Services Manager window contains various options which enable you to perform different tasks or actions for users, sessions and processes. The Actions menu options, and the permissions required to perform these actions are listed below:

    • Connect: The Connect option can be used only from a session, and it enables a user to connect from a session to a different session. The required permissions is Full Control, or User Access
    • Disconnect: This Action menu option disconnects the user from the existing session. The session is however saved, and applications still continue to run. The required permission is Full Control.
    • Send Message: The Send Message option enables a user to transmit a message to a single session, or to all sessions. The required permission is Full Control, or User Access.
    • Remote Control: This option enables a user to utilize the existing session to examine or control the session of another user. The required permission is Full Control.
    • Reset: This option is used to immediately end a session. All unsaved user data is lost. The required permission is Full Control.
    • Status: This option can be used to display information on a particular session. The required permission is Full Control, or User Access
    • Log Off: The Logoff option can be used to log off a user from a session. The required permission is Full Control.
    • End Process: This option can be used to end a process in a session. The required permission is Full Control.

    Several issues in built in asp.net pager control

    • Paging Events
      In order to handle paging you have to deal with paging events. The events fire at specific time instances in the page pipeline and because of this you often have to handle data binding in a way to work around the paging events or else end up double binding your data sources based on paging. Yuk.
    • Styling
      The GridView pager is a royal pain to beat into submission for styled rendering. The DataPager control has many more options and template layout and it renders somewhat cleaner, but it too is not exactly easy to get a decent display for.
    • Not a Generic Solution
      The problem with the ASP.NET controls too is that it’s not generic. GridView, DataGrid use their own internal paging, ListView can use a DataPager and if you want to manually create data layout – well you’re on your own. IOW, depending on what you use you likely have very different looking Paging experiences.
    • DataSource Controls required for Efficient Data Paging Retrieval
      The only way you can get paging to work efficiently where only the few records you display on the page are queried for and retrieved from the database you have to use a DataSource control – only the Linq and Entity DataSource controls  support this natively. While you can retrieve this data yourself manually, there’s no way to just assign the page number and render the pager based on this custom subset. Other than that default paging requires a full resultset for ASP.NET to filter the data and display only a subset which can be very resource intensive and wasteful if you’re dealing with largish resultsets (although I’m a firm believer in returning actually usable sets :-}). If you use your own business layer that doesn’t fit an ObjectDataSource you’re SOL. That’s a real shame too because with LINQ based querying it’s real easy to retrieve a subset of data that is just the data you want to display but the native Pager functionality doesn’t support just setting properties to display just the subset AFAIK.
    • DataPager is not Free Standing
      The DataPager control is the closest thing to a decent Pager implementation that ASP.NET has, but alas it’s not a free standing component – it works off a related control and the only one that it effectively supports from the stock ASP.NET controls is the ListView control. This means you can’t use the same data pager formatting for a grid and a list view or vice versa and you’re always tied to the control.
    • Postback and JavaScript requirements
      If you look at paging links in ASP.NET they are always postback links with javascript:__doPostback() calls that go back to the server. While that works fine and actually has some benefit like the fact that paging saves changes to the page and post them back, it’s not very SEO friendly. Basically if you use javascript based navigation nosearch engine will follow the paging links which effectively cuts off list content on the first page. The DataPager control does support GET based links via the QueryStringParameter property, but the control is effectively tied to the ListView control (which is the only control that implements IPageableItemContainer).