Ian (Fluxtah) Warwick's blog RSS 2.0
# Sunday, March 08, 2009

A cool thing, did not realise this, you can use a @MasterType directive in an ASP.NET page to strongly type the Master property, quite cool.

<%@ MasterType TypeName="BaseMaster" %>
Sunday, March 08, 2009 3:59:00 PM (GMT Standard Time, UTC+00:00)  #    Comments [0] -
General | ASP.NET
# Thursday, February 19, 2009

I had a second interview today for a job that I am very keen on getting, after the interview it struck me that somehow I must have done something wrong, infact it was during the question 'Do you have any questions?' I realised that I had somehow missed an opportunity or somehow screwed up. Even further it was after something said to me along the lines of 'well, you are just one of a number and we will have some feedback for you as soon as possible', followed again by 'Do you have any questions?'.

This sounded a lot like 'This is your last chance to ask us some deal breaking questions right now?' but I am hoping that this is just the way that I percieved it. Still I had no questions. Well, saying that I did have one question but that was asking wether they had used LINQ to NHibernate and then following up on that by saying how great LINQ is, which ended up sounding like an instruction (according to one of the interviewers, I am not sure if it was meant literaly however it made me feel uncomfortable, like I just gave an instruction to use LINQ to NHibernate, but this is not what I was indicating).

Although this was the only question I did ask, I don't think it was the right question, I failed to ask about the job, about what I might be doing, what my responsibilities would be and where I would fit into the team, it stands to reason that if your going to a job and the job details do not specifically answer these questions then maybe they should be asked.

The thing that I think stopped me from asking them is that I just assumed that, since I am going for a C# Developer role that I would pretty much be involved in writing C# Code in answer to some business idea, plan or problem, which is infact the case since I was already told that the position involves writing B2B enterprise applications.

Reflecting on myself after this interview, I think I may have babbled to much, when asked a direct questions, I seem to have gave an entire story rather than a direct answer, I am not sure why I did this, I think it may have been that I felt I had to prove something, which, I guess I did since thats what your supposed to do in job interviews? right?

I still feel, that getting this job will be the next step in my career, even though it ended on an anti-climax, assuming that the interview was a climax or a superficial climax for me and an anti-climax for them with me babbling on that it made me seem as if I am some big head who knows it all.

Anyway, I hope I get this job!

Thursday, February 19, 2009 11:43:00 AM (GMT Standard Time, UTC+00:00)  #    Comments [0] -
General
# Sunday, October 05, 2008

In an SnippetCallback, when defining mapping between a web service method parameter and a control, there is a client-side function for each control type that deals with extracting the value from the control and passing it as the web service methods parameter.

By default most of the simple web controls (TextBox, Checkbox, RadioButtonList, etc) that come out-of-the-box with ASP.NET already have a corresponding client-side value extractor function defined, but obviously this is not good enough if you want to use custom controls.

To override these or add new ones there are two things that need to be done, first off a new extractor function would have to be defined in configuration.

<configSections>
  <section name="ajaxSnippets" type="AjaxSnippets.Configuration.AjaxSnippetsConfigurationSection, AjaxSnippets"/>
</configSections>
<ajaxSnippets>
  <extractors>
    <add controlType="System.Web.UI.WebControls.TextBox" functionName="myCustomTextBoxExtractor" />
    <add controlType="My.Custom.Control" functionName="fromMyCustomControl" />
  </extractors>
</ajaxSnippets>

In this example, I am overriding the textbox extractor with my own function myCustomTextBoxExtractor, secondly I am defining a new value extractor fromMyCustomControl for My.Custom.Control.

Now the next thing that needs to be done is to write the client functions, this can be done by creating a new javascript file, which would need to be included in the page that Ajax Snippets are being used.

AjaxSnippets.ValueExtractors.prototype.myCustomTextBoxExtractor = function(id){
 var el = $get(id);
 // Extract value from el and return it here 
}
AjaxSnippets.ValueExtractors.prototype.fromMyCustomControl = function(id){
 var el = $get(id);
 // Extract value from el and return it here 
}

Ajax Snippets has a ValueExtractors class, and its simply just a job of adding functions to its prototype.

To give a better example, the ValueExtractors default prototype is below in full, in its current state from Ajax Snippets 0.3a release.

AjaxSnippets.ValueExtractors.prototype = {
    fromAny: function(id) {
        return id;
    },
    fromTextBox: function(id) {
        return $get(id).value;
    },
    fromDropDown: function(id) {
        var el = $get(id);
        return el.options[el.selectedIndex].value;
    },
    fromRadioList: function(id) {
        var i, els = $get(id).getElementsByTagName('input');
        for (i = 0; i < els.length; i++) {
            if (els[i].checked) { return els[i].value; }
        }
        return null;
    },
    fromCheckList: function(id) {
        var i, els = $get(id).getElementsByTagName('input'), vals = new Array();
        for (i = 0; i < els.length; i++) {
            vals.push(els[i].checked);
        }
        return vals;
    },
    fromListBox: function(id) {
        var i, el = $get(id), vals = new Array();
        for (i = 0; i < el.options.length; i++) {
            if (el.options[i].selected) { vals.push(el.options[i].value); }
        }
        return vals;
    },
    fromCheckBox: function(id) {
        return $get(id).checked;
    }
};
Sunday, October 05, 2008 5:19:00 PM (GMT Daylight Time, UTC+01:00)  #    Comments [0] -
ASP.NET | General

After a busy weekend I finally got a wizard working to help with the configuration of a SnippetCallback. In the latest build of Ajax Snippets there is now an option from the action list of a SnippetCallback on the designer named 'Configure...'.

After clicking this option a wizard will popup where an asmx file can be selected and a web method from this service.

One problem with this is that the web application must be compiled before the wizard can get access to the web service method list, the wizard basically pulls out web service type defined by the class attribute in the asmx file and tries to use Type.GetType() on it, if the web application is not compiled with asmx file then the methods do not show up in the wizards list, but I did stick in a red warning label under the drop-down-list if this happens.

The next step allows the mapping of controls to the selected web methods parameters.

The main benefit of the wizard is it avoids any mapping mistakes and typos, it could also do with a page to configure other options of a SnippetCallback but at least these two steps cover the main options.

 

Sunday, October 05, 2008 4:41:00 PM (GMT Daylight Time, UTC+01:00)  #    Comments [0] -
General
Archive
<February 2012>
SunMonTueWedThuFriSat
2930311234
567891011
12131415161718
19202122232425
26272829123
45678910
Blogroll
About the author/Disclaimer

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

© Copyright 2012
Ian Warwick
Sign In
Statistics
Total Posts: 33
This Year: 0
This Month: 0
This Week: 0
Comments: 4
Themes
Pick a theme:
All Content © 2012, Ian Warwick
DasBlog theme 'Business' created by Christoph De Baene (delarou)