Search Results

Search found 16 results on 1 pages for 'mickyjtwin'.

Page 1/1 | 1 

  • Pass object to dynamically loaded ListView ItemTemplate

    - by mickyjtwin
    I have been following the following post on using multiple ItemTemplates in a ListView control. While following this example does produce output, I am trying ot figure out how to psas an object through to the ItemTemplate's user control, which I do not seem to be able to do/figure out. protected void lvwComments_OnItemCreated(object sender, ListViewItemEventArgs e) { ListViewDataItem currentItem = (e.Item as ListViewDataItem); Comment comment = (Comment)currentItem.DataItem; if (comment == null) return; string controlPath = string.Empty; switch (comment.Type) { case CommentType.User: controlPath = "~/layouts/controls/General Comment.ascx"; break; case CommentType.Official: controlPath = "~/layouts/controls/Official Comment.ascx"; break; } lvwComments.ItemTemplate = LoadTemplate(Controlpath); } The User Control is as follows: public partial class OfficialComment : UserControl { protected void Page_Load(object sender, EventArgs e) { } } In the example, the values are being output in the ascx page: <%# Eval("ItemName") %> however I need to access the ListItem in this control to do other logic. I cannot figure out how I to send through my Comment item. The sender object and EventArgs do not contain the info.

    Read the article

  • Wrapping mailmessage headers in .net for Sendgrid

    - by mickyjtwin
    Am using SendGrid for some email notifications, specifically utilising their SMTP API's. While they have PHP examples, c# is not so helpful. Essentially, a json string is built that contains the to email addresses, and other custom filters etc, which is then added to a MailMessage header to send. // json string example {"to":["[email protected]", [email protected]", "", ""],"sub":{"<name>":["Name1", Name2"]}} MailMessage m = new MailMessage("[email protected]", "[email protected]"); m.Headers.Add("X-SMTPAPI", jsonString); The problem I am having is that for some MTA's, headers can only be 1000 characters long, and also quoted-principle encoding required only 76 character per line. In their php example, they are splitting the string and adding a linebreak (\n) every 72 characters. While I am doing this in .NET, I am receiving a invalid character exception. After some digging, it seems that pre-.NET4.0 Beta2 MailMessage will not process CLLR characters. Sengrid support is not proving helpful, and looking at ways to make this work?

    Read the article

  • Persist header data across reply emails

    - by mickyjtwin
    Am trying to determine the best way to persist information from an originating email, through to a reply back. Essentially, it is to pass a GUID from the original email (c#), whereby when the receiver replies back, that GUID is also sent back for reference. I have tried setting the MessageID, whereby using Outlook, the In-Reply-To value is set with the original ID, however using some webclient email systems, that value is not created on reply. Is there another way to sent this info through email headers?

    Read the article

  • Is it possible to search through json result with jQuery

    - by mickyjtwin
    What I'm trying to achieve, is to output a json list that contains a list of Css classes, and their corresponding url records, i.e. var jsonList = [{"CSSClass":"testclass1","VideoUrl":"/Movies/movie.flv"},{"CSSClass":"testclass2","VideoUrl":"/Movies/movie2.flx"}]; //]]> foreach item in the list I am adding a click event to the class... $.each(script, function() { $("." + this.CSSClass, "#pageContainer").live('click', function(e) { videoPlayer.playMovie(this); return false; }); }); What I'm wondering, is if I can somehow get the corresponding url from the jsonlist, without having to loop through them all again, searching for CSSClass, or adding the url to the link as an attribute?

    Read the article

  • Compile Error: Ticks must be between DateTime.MinValue.Ticks and DateTime.MaxValue.Ticks. Parameter

    - by mickyjtwin
    I have a Visual Studio 2008 solution that when I build, returns the following error: Ticks must be between DateTime.MinValue.Ticks and DateTime.MaxValue.Ticks. Parameter name: ticks There is no reference file/line/column in the error. Becoming quite frustrating as the solution builds in the end, however I cannot debug. In the solution, there is no reference/using to DateTime.MinValue.Ticks at all...

    Read the article

  • Use msbuild community tasks without installing

    - by mickyjtwin
    In our developer environment, no users have administration rights. As such, it's not possible to install MSBuild.CommunityTasks without getting admin to do so. What I'm wondering is similar to NAnt, i.e. is it possible to include the files in your solution directory, and just reference it from there? This way, will not matter if the person has it installed, when they checkout latest code, the msbuild community files will come with, and solution will build. \SolutionDir\{solution}.sln \SolutionDir\Project\{files} \SolutionDir\MSBuild.Community\files

    Read the article

  • Formatting address of different types

    - by mickyjtwin
    I have various classes which all contain address details, i.e. AddressLine1, AddressLine2, AddressLine3, Suburb, Town, etc. On the front end, I need to format the address in a particular way, i.e. AddressLine1<br /> AddressLine2<br /> Suburb State Postcode If AddressLine2 does not exist or empty, don't show it. Quite straight-forward. I am trying to determine the best way to show this info. At the moment, the Address property of each class calls a FormatAddress method which writes out the html string. This exists as a method of the class. My opinion is that any formatting should exist from the front-end control i.e. ascx etc. However, if these DetailClasses need to format the same address info, what would be the best option, also making it easier to maintain?

    Read the article

  • Managing/Storing complex application form

    - by mickyjtwin
    I am developing an online application form, which can be of two categories, either domestic/international. Each different type has commong questions, and also specific questions. They are approx 6 pages/steps of questions. The application form can also be saved at the end of each step, and can be completed at a later date. Some questions will vary depending on answers to previous questions, so there are some complex business rules. In terms of storage of results, would it be best to store the answers in and XML field in SQL? What would be the best way to reference a question to an answer. There is no need for the form to be dynamic in rendering questions etc. e.g. <Application id="123" type="Domestic"> <Answers> <EmailAddress>[email protected]</EmailAddress> <HomePhone>555-5555</HomePhone> <Suburb>MySuburb</Suburb> <Guardians> <Guardian type="Mother"> <FirstName>Mom</FirstName> </Guardian> </Guardians> <Answers> </Application>

    Read the article

  • debug javascript in release mode with yui compressions

    - by mickyjtwin
    In our build scripts, we are using YUI compressor to minify/compress javascript and css files. As this combines the js into one file, it needs to be referenced in the Master Layout script, e.g. First question is what is best way to use both, so that if we are developing (in debug mode) it will reference each js file individually? Second question, is once on production, would there be any steps/solution to debugging the javascript on the production server, i.e. conditionallly load the javascript files based on setting a "debug=true" setting in either js or .net?

    Read the article

  • Assign delegate event handler from dynamically added child control

    - by mickyjtwin
    I have a control that handles commenting. In this control, I have set a delegate event handler for sending an email. I then have various types of controls, e.g. blog, articles etc, each of which may or may not have the commenting control added (which is done dynamically with me not knowing the id's), i.e. the commenting control is added outside this control. Each of these controls handles it's emailing differently(hence the event). What I'm trying to determine, is how to assign the event in the parent control. At the moment, I'm having to recursively search through all the controls on the page until I find the comment control, and set it that way. Example below explains: COMMENTING CONTROL public delegate void Commenting_OnSendEmail(); public partial class Commenting : UserControl { public Commenting_OnSendEmail OnComment_SendEmail(); private void Page_Load(object sender, EventArgs e) { if(OnComment_SendEmail != null) { OnComment_SendEmail(); } } } PARENT CONTROL public partial class Blog : UserControl { private void Page_Load(object sender, EventArgs e) { Commenting comControl = (Commenting)this.FindControl<Commenting>(this); if(comControl != null) { comCtrol.OnComment_SendEmail += new Commenting_OnSendMail(Blog_Comment_OnSendEmail); } } } Is there an easier way?

    Read the article

  • Passing variables to callback functions

    - by mickyjtwin
    I am trying to write a jQuery plugin, that can be applied to a selector. Within this plugin, there are multiple calls to webservices, where callback methods are required. The problem I am having is maintaining the current context item in the each loop of the selector. (function($){ $.fn.myMethod = function(){ return this.each(function(){ var c = $(this); $.api.methodToCall("", CallbackFunction); }); }; function CallbackFunction(data, result){ // do stuff based on c } })(jQuery); Normally, you would provide the callback function straight away, which allows me to access c, however within the callback function, there potentially is another api call, so it would start to get messy. Is there any way to do this?

    Read the article

  • Export products and variants from MSSQL

    - by mickyjtwin
    I have a SQL DB that has a table of products, and another table which contains a list of the sku variants of each product if it has one. I want to export all the products and their SKU's into excel. At the moment, I have a helper SQL function which performs the subquery against a product_id and concatenates all the SKU's into a comma-delimited string, e.g: Product Code, Name, SKUs 111 P1 77, 22, 11 Is there an easier way to do this, so that each SKU is a row which the associated product code as well, i.e: Product Code, Name, SKUs 111 P1 77 111 P1 22 111 P1 11

    Read the article

  • Export products and variants from SQL Server

    - by mickyjtwin
    I have a SQL Server DB that has a table of products, and another table which contains a list of the sku variants of each product if it has one. I want to export all the products and their SKU's into excel. At the moment, I have a helper SQL function which performs the subquery against a product_id and concatenates all the SKU's into a comma-delimited string, e.g: Product Code, Name, SKUs 111 P1 77, 22, 11 Is there an easier way to do this, so that each SKU is a row which the associated product code as well, i.e: Product Code, Name, SKUs 111 P1 77 111 P1 22 111 P1 11

    Read the article

  • When calling twitter api favorites, get favourite_count

    - by mickyjtwin
    Using the Twitter REST API Method: favorites for a user, this returns a list of statuses of each favourite. Is there a way to get the favourite count other than calling users/show, and accessing the property this way? Seems an ineffecient way of determining if there are more than 20 favourites for paging purposes.

    Read the article

  • jquery :last missing multiple classes

    - by mickyjtwin
    I have an unordered list, and am using jquery to find the last ul and apply a class. jQuery("ul.class1:last").addClass("lastUi"); The html is as follows: <ul class="class1"></ul> <ul class="class1"></ul> This is working fine, however it has now changed in that another class is being added to the list so the html looks like: <ul class="class1"></ul> <ul class="class1 class2"></ul> <ul class="class1"></ul> <ul class="class1 class2"></ul> The jQuery code is now not picking up the last ul with both class1 and class2 as the last element and isn't adding the lastUI class.

    Read the article

  • Using DAO's or static methods in Domain Object with nHibernate

    - by mickyjtwin
    I am using nHibernate for the first time, and after alot of reading/researching, plus looking at other projects done with nHibernate, have seen a couple of implementation practices. I am looking for opinions about which would be best to use and why. Essentially the two methods are as follows: Using Data Access Objects and a DAO Factory. Example usage: INotificationListDAO nListDAO = NHDaoFactory.GetNotificationListDAO(); NotificationList list = nListDAO.GetByListID(""); Use Static methods in the Domain Object. Example usage: NotificationList list = NotificationList.GetByListID(""); NHHelper.Session.Get(id); NHHelper.Session basically calls the NHibernateSessionManager.Instace.GetSessionFrom(""). While both look similar, it is more to do with best practice. From what I understand, the first option is more so if you are developing enterprise level applications, where my requirements are more for mid-range websites.

    Read the article

1