Search Results

Search found 14626 results on 586 pages for 'hidden features'.

Page 4/586 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • set overflow hidden in some cases

    - by Richard
    Hello, my question is How can I set overflow hidden in cases where the html go's outside the screen Right now I have set html {overflow: hidden;} in the head tag off the page. So, it's hidden all the time In my particular case the errors that I show in the registration process cannot be seen on my 13inch laptop, but I don't want to show the scrollbars all the time. That's why I want it to set(or unset) based on the fact if there is overflow or not. What would be the best way? thanks, Richard

    Read the article

  • hidden row causing issue with tablesorter zebra striping

    - by Harvengure
    Sorry if this has already been solved elsewhere but my searches have been able to turn up nothing and my attempts at solving the issue myself have made even less progress. :P Put quite simply I have a table that is using the jquery tablesorter and it's zebra widget. In this table there is a hidden column. I've so far been able to make it so that when a tr contains specific text (I was aiming for * but was seemingly unable to get \* to work for whatever reason...and I suspect my selector is perhaps not specific enough) the containing row is set not to display by ".hide()". The problem I am having though is when the row is hidden, tablesorter does exactly what it should do and stripes all the rows their specific colours based on their odd and even values. Of course .remove doesn't do the trick either as the table still sees some funny striping. Any thoughts on how to make it so that when a row is hidden, the striping compensates?

    Read the article

  • Reading int from a hidden field in .aspx

    - by vikp
    Hi, I'm struggling to read an int from the hidden field on aspx page. <input type = "hidden" id = "myIntegerId" name = "integerId" value= "<%: Model.MyObjectId %>" runat = "server" /> The value is definately on the form, I can see it in the debugger and print it with <%: % When I read the form values in the controller, instead of an int I recieve a following string: <%: Model.MyObjectId % I have tried casting data in the hidden field to string and calling ToString() method on that field, neither has worked. The data is submitted using the post event. I have a feeling that I'm missing something very basic... Any help is greately appreciated. Thanks

    Read the article

  • Hidden text and links appearing just on click for SEO?

    - by CamSpy
    I am working on a site that has neat clean/minimalistic design/layout. Menu items are "hidden" behind an icon, to see them, users need to click on that icon to get a javascript toggled overlay with the list of menu items. Then there are blocks with photos and users need to click on a small icon/button on each of them to get a block of text shown for each of the photo. While I don't like such "design" myself, making me click lots of time just to read, I also think that for SEO purpose this model is really wrong. Is such model bad for SEO? Are there ways to keep design like this but have "safe" methods of displaying text content on click that will not hurt SEO?

    Read the article

  • Server.transfer causing HttpException

    - by salvationishere
    I am developing a C#/SQL ASP.NET web application in VS 2008. Currently I am using the Server.Transfer method to transfer control from one ASPX.CS file to another ASPX file. The first time through, this works. But after control is transferred to this new file it encounters a condition: if (restart == false) { where "restart" is a boolean variable. After this statement it immediately transfers control back to the same ASPX.CS file and tries to reexecute the Server.Transfer method. This time it gives me the following exception and stack trace. Do you know what is causing this? I tried to read this but it didn't make much sense to me. System.Web.HttpException was unhandled by user code Message="Error executing child request for DataMatch.aspx." Source="System.Web" ErrorCode=-2147467259 StackTrace: at System.Web.HttpServerUtility.Execute(String path, TextWriter writer, Boolean preserveForm) at System.Web.HttpServerUtility.Transfer(String path, Boolean preserveForm) at System.Web.HttpServerUtility.Transfer(String path) at AddFileToSQL._Default.btnAppend_Click(Object sender, EventArgs e) in C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\AddFileToSQL\AddFileToSQL\Default.aspx.cs:line 109 at System.Web.UI.HtmlControls.HtmlInputButton.OnServerClick(EventArgs e) at System.Web.UI.HtmlControls.HtmlInputButton.RaisePostBackEvent(String eventArgument) at System.Web.UI.HtmlControls.HtmlInputButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) InnerException: System.Web.HttpCompileException Message="c:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\AddFileToSQL\AddFileToSQL\DataMatch.aspx(14): error CS1502: The best overloaded method match for 'System.Web.UI.HtmlControls.HtmlTableRowCollection.Add(System.Web.UI.HtmlControls.HtmlTableRow)' has some invalid arguments" Source="System.Web" ErrorCode=-2147467259 SourceCode="#pragma checksum \"C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\AddFileToSQL\AddFileToSQL\DataMatch.aspx\" \"{406ea660-64cf-4c82-b6f0-42d48172a799}\" \"76750ABD913CF678D216C1E9CFB62BDF\"\r\n//------------------------------------------------------------------------------\r\n// \r\n// This code was generated by a tool.\r\n// Runtime Version:2.0.50727.3603\r\n//\r\n// Changes to this file may cause incorrect behavior and will be lost if\r\n// the code is regenerated.\r\n// \r\n//------------------------------------------------------------------------------\r\n\r\nnamespace ASP {\r\n \r\n #line 285 \"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Config\web.config\"\r\n using System.Web.Profile;\r\n \r\n #line default\r\n #line hidden\r\n \r\n #line 280 \"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Config\web.config\"\r\n using System.Text.RegularExpressions;\r\n \r\n #line default\r\n #line hidden\r\n \r\n #line 282 \"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Config\web.config\"\r\n using System.Web.Caching;\r\n \r\n #line default\r\n #line hidden\r\n \r\n #line 278 \"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Config\web.config\"\r\n using System.Configuration;\r\n \r\n #line default\r\n #line hidden\r\n \r\n #line 277 \"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Config\web.config\"\r\n using System.Collections.Specialized;\r\n \r\n #line default\r\n #line hidden\r\n \r\n #line 19 \"C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\AddFileToSQL\AddFileToSQL\DataMatch.aspx\"\r\n using System.Web.UI.WebControls.WebParts;\r\n \r\n #line default\r\n #line hidden\r\n \r\n #line 289 \"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Config\web.config\"\r\n using System.Web.UI.HtmlControls;\r\n \r\n #line default\r\n #line hidden\r\n \r\n #line 19 \"C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\AddFileToSQL\AddFileToSQL\DataMatch.aspx\"\r\n using System.Web.UI.WebControls;\r\n \r\n #line default\r\n #line hidden\r\n \r\n #line 19 \"C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\AddFileToSQL\AddFileToSQL\DataMatch.aspx\"\r\n using System.Web.UI;\r\n \r\n #line default\r\n #line hidden\r\n \r\n #line 276 \"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Config\web.config\"\r\n using System.Collections;\r\n \r\n #line default\r\n #line hidden\r\n \r\n #line 275 \"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Config\web.config\"\r\n using System;\r\n \r\n #line default\r\n #line hidden\r\n \r\n #line 284 \"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Config\web.config\"\r\n using System.Web.Security;\r\n \r\n #line default\r\n #line hidden\r\n \r\n #line 281 \"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Config\web.config\"\r\n using System.Web;\r\n \r\n #line default\r\n #line hidden\r\n \r\n #line 283 \"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Config\web.config\"\r\n using System.Web.SessionState;\r\n \r\n #line default\r\n #line hidden\r\n \r\n #line 279 \"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Config\web.config\"\r\n using System.Text;\r\n \r\n #line default\r\n #line hidden\r\n \r\n \r\n [System.Runtime.CompilerServices.CompilerGlobalScopeAttribute()]\r\n public class datamatch_aspx : global::AddFileToSQL.DataMatch, System.Web.SessionState.IRequiresSessionState, System.Web.IHttpHandler {\r\n \r\n private static bool @_initialized;\r\n \r\n private static object @_fileDependencies;\r\n \r\n [System.Diagnostics.DebuggerNonUserCodeAttribute()]\r\n public datamatch_aspx() {\r\n string[] dependencies;\r\n ((global::AddFileToSQL.DataMatch)(this)).AppRelativeVirtualPath = \"~/DataMatch.aspx\";\r\n if ((global::ASP.datamatch_aspx.@__initialized == false)) {\r\n dependencies = new string[1];\r\n dependencies[0] = \"~/DataMatch.aspx\";\r\n global::ASP.datamatch_aspx.@__fileDependencies = this.GetWrappedFileDependencies(dependencies);\r\n global::ASP.datamatch_aspx.@__initialized = true;\r\n }\r\n this.Server.ScriptTimeout = 30000000;\r\n }\r\n \r\n protected System.Web.Profile.DefaultProfile Profile {\r\n get {\r\n return ((System.Web.Profile.DefaultProfile)(this.Context.Profile));\r\n }\r\n }\r\n \r\n protected ASP.global_asax ApplicationInstance {\r\n get {\r\n return ((ASP.global_asax)(this.Context.ApplicationInstance));\r\n }\r\n }\r\n \r\n [System.Diagnostics.DebuggerNonUserCodeAttribute()]\r\n private global::System.Web.UI.HtmlControls.HtmlTitle @_BuildControl_control3() {\r\n global::System.Web.UI.HtmlControls.HtmlTitle @_ctrl;\r\n \r\n #line 6 \"C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\AddFileToSQL\AddFileToSQL\DataMatch.aspx\"\r\n @_ctrl = new global::System.Web.UI.HtmlControls.HtmlTitle();\r\n \r\n #line default\r\n #line hidden\r\n return @_ctrl;\r\n }\r\n \r\n [System.Diagnostics.DebuggerNonUserCodeAttribute()]\r\n private global::System.Web.UI.HtmlControls.HtmlHead @_BuildControl_control2() {\r\n global::System.Web.UI.HtmlControls.HtmlHead @_ctrl;\r\n \r\n #line 5 \"C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\AddFileToSQL\AddFileToSQL\DataMatch.aspx\"\r\n @_ctrl = new global::System.Web.UI.HtmlControls.HtmlHead(\"head\");\r\n \r\n #line default\r\n #line hidden\r\n global::System.Web.UI.HtmlControls.HtmlTitle @_ctrl1;\r\n \r\n #line 5 \"C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\AddFileToSQL\AddFileToSQL\DataMatch.aspx\"\r\n @_ctrl1 = this.@_BuildControl_control3();\r\n \r\n #line default\r\n #line hidden\r\n System.Web.UI.IParserAccessor @_parser = ((System.Web.UI.IParserAccessor)(@_ctrl));\r\n \r\n #line 5 \"C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\AddFileToSQL\AddFileToSQL\DataMatch.aspx\"\r\n @_parser.AddParsedSubObject(@_ctrl1);\r\n \r\n #line default\r\n #line hidden\r\n \r\n #line 5 \"C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\AddFileToSQL\AddFileToSQL\DataMatch.aspx\"\r\n @_parser.AddParsedSubObject(new System.Web.UI.LiteralControl(\"\r\n \r\n \r\n \r\n \r\n\"));\r\n \r\n #line default\r\n #line hidden\r\n return @_ctrl;\r\n }\r\n \r\n [System.Diagnostics.DebuggerNonUserCodeAttribute()]\r\n private global::System.Web.UI.HtmlControls.HtmlTableRow @_BuildControl_control5() {\r\n global::System.Web.UI.HtmlControls.HtmlTableRow @_ctrl;\r\n \r\n #line 15 \"C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\AddFileToSQL\AddFileToSQL\DataMatch.aspx\"\r\n @_ctrl = new global::System.Web.UI.HtmlControls.HtmlTableRow();\r\n \r\n #line default\r\n #line hidden\r\n return @_ctrl;\r\n }\r\n \r\n [System.Diagnostics.DebuggerNonUserCodeAttribute()]\r\n private global::System.Web.UI.WebControls.PlaceHolder @_BuildControlphTextBoxes() {\r\n global::System.Web.UI.WebControls.PlaceHolder @_ctrl;\r\n \r\n #line 19 \"C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\AddFileToSQL\AddFileToSQL\DataMatch.aspx\"\r\n @_ctrl = new global::System.Web.UI.WebControls.PlaceHolder();\r\n \r\n #line default\r\n #line hidden\r\n this.phTextBoxes = @_ctrl;\r\n \r\n #line 19 \"C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\AddFileToSQL\AddFileToSQL\DataMatch.aspx\"\r\n @_ctrl.ID = \"phTextBoxes\";\r\n \r\n #line default\r\n #line hidden\r\n return @_ctrl;\r\n }\r\n \r\n [System.Diagnostics.DebuggerNonUserCodeAttribute()]\r\n private global::System.Web.UI.HtmlControls.HtmlTableCell @_BuildControl_control8() {\r\n global::System.Web.UI.HtmlControls.HtmlTableCell @_ctrl;\r\n \r\n #line 18 \"C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\AddFileToSQL\AddFileToSQL\DataMatch.aspx\"\r\n @_ctrl = new global::System.Web.UI.HtmlControls.HtmlTableCell(\"td\");\r\n \r\n #line default\r\n #line hidden\r\n \r\n #line 18 \"C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\AddFileToSQL\AddFileToSQL\DataMatch.aspx\"\r\n @_ctrl.Align = \"center\";\r\n \r\n #line default\r\n #line hidden\r\n \r\n #line 18 \"C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\AddFileToSQL\AddFileToSQL\DataMatch.aspx\"\r\n @_ctrl.VAlign = \"top\";\r\n \r\n #line default\r\n #line hidden\r\n System.Web.UI.IParserAccessor @_parser = ((System.Web.UI.IParserAccessor)(@_ctrl));\r\n \r\n #line 18 \"C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\AddFileToSQL\AddFileToSQL\DataMatch.aspx\"\r\n @_parser.AddParsedSubObject(new System.Web.UI.LiteralControl(\"\r\n \"));\r\n \r\n #line default\r\n #line hidden\r\n global::System.Web.UI.WebControls.PlaceHolder @_ctrl1;\r\n \r\n #line 18 \"C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\AddFileToSQL\AddFileToSQL\DataMatch.aspx\"\r\n @_ctrl1 = this.@_BuildControlphTextBoxes();\r\n \r\n #line default\r\n #line hidden\r\n \r\n #line 18 \"C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\AddFileToSQL\AddFileToSQL\DataMatch.aspx\"\r\n @_parser.AddParsedSubObject(@_ctrl1);\r\n \r\n #line default\r\n #line hidden\r\n \r\n #line 18 \"C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\AddFileToSQL\AddFileToSQL\DataMatch.aspx\"\r\n @_parser.AddParsedSubObject(new System.Web.UI.LiteralControl(\"\r\n \"));\r\n \r\n #line default\r\n #line hidden\r\n return @_ctrl;\r\n }\r\n \r\n [System.Diagnostics.DebuggerNonUserCodeAttribute()]\r\n private global::System.Web.UI.WebControls.Label @_BuildControlInstructions() {\r\n global::System.Web.UI.WebControls.Label @_ctrl;\r\n \r\n #line 22 \"C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\AddFileToSQL\AddFileToSQL\DataMatch.aspx\"\r\n @_ctrl = new global::System.Web.UI.WebControls.Label();\r\n \r\n #line default\r\n #line hidden\r\n this.Instructions = @_ctrl;\r\n @_ctrl.ApplyStyleSheetSkin(this);\r\n \r\n #line 22 \"C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\AddFileToSQL\AddFileToSQL\DataMatch.aspx\"\r\n @_ctrl.ID = \"Instructions\";\r\n \r\n #line default\r\n #line hidden\r\n \r\n #line 22 \"C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\AddFileToSQL\AddFileToSQL\DataMatch.aspx\"\r\n @_ctrl.Font.Italic = true;\r\n \r\n #line default\r\n #line hidden\r\n \r\n #line 22 \"C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\AddFileToSQL\AddFileToSQL\DataMatch.aspx\"\r\n @_ctrl.Text = \"Now select from the dropdownlists which table columns from my database you want t\" +\r\n \"o map these fields to\";\r\n \r\n #line default\r\n #line hidden\r\n return @_ctrl;\r\n }\r\n \r\n [System.Diagnostics.DebuggerNonUserCodeAttribute()]\r\n private global::System.Web.UI.HtmlControls.HtmlTableCell @_BuildControl_control9() {\r\n global::System.Web.UI.HtmlControls.HtmlTableCell @_ctrl;\r\n \r\n #line 21 \"C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\AddFileToSQL\AddFileToSQL\DataMatch.aspx\"\r\n @_ctrl = new global::System.Web.UI.HtmlControls.HtmlTableCell(\"td\");\r\n \r\n #line default\r\n #line hidden\r\n System.Web.UI.IParserAccessor @_parser = ((System.Web.UI.IParserAccessor)(@_ctrl));\r\n \r\n #line 21 \"C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\AddFileToSQL\AddFileToSQL\DataMatch.aspx\"\r\n @_parser.AddParsedSubObject(new System.Web.UI.LiteralControl(\"\r\n \"));\r\n \r\n #line default\r\n #line hidden\r\n global::System.Web.UI.WebControls.Label @_ctrl1;\r\n \r\n #line 21 \"C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\AddFileToSQL\AddFileToSQL\DataMatch.aspx\"\r\n @_ctrl1 = this.@_BuildControlInstructions();\r\n \r\n #line default\r\n #line hidden\r\n \r\n #line 21 \"C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\AddFileToSQL\AddFileToSQL\DataMatch.aspx\"\r\n @_parser.AddParsedSubObject(@_ctrl1);\r\n \r\n #line default\r\n #line hidden\r\n \r\n #line 21 \"C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\AddFileToSQL\AddFileToSQL\DataMatch.aspx\"\r\n @_parser.AddParsedSubObject(new System.Web.UI.LiteralControl(\"\r\n \"));\r\n \r\n #line default\r\n #line hidden\r\n return @_ctrl;\r\n }\r\n \r\n [System.Diagnostics.DebuggerNonUserCodeAttribute()]\r\n private global::System.Web.UI.WebControls.Button @_BuildControlbtnSubmit() {\r\n global::System.Web.UI.WebControls.Button @_ctrl;\r\n \r\n #line 26 \"C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\AddFileToSQL\AddFileToSQL\DataMatch.aspx\"\r\n @_ctrl = new global::System.Web.UI.WebControls.Button();\r\n \r\n #line default\r\n #line hidden\r\n this.btnSubmit = @_ctrl;\r\n @_ctrl.ApplyStyleSheetSkin(this);\r\n \r\n #line 26 \"C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\AddFileToSQL\AddFileToSQL\DataMatch.aspx\"\r\n @_ctrl.ID = \"btnSubmit\";\r\n \r\n #line default\r\n #line hidden\r\n \r\n #line 26 \"C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\AddFileToSQL\AddFileToSQL\DataMatch.aspx\"\r\n @_ctrl.Text = \"Submit\";\r\n \r\n #line default\r\n #line hidden\r\n \r\n #line 26 \"C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\AddFileToSQL\AddFileToSQL\DataMatch.aspx\"\r\n @_ctrl.Width = new System.Web.UI.WebControls.Unit(150, System.Web.UI.WebControls.UnitType.Pixel);\r\n \r\n #line default\r\n #line hidden\r\n \r\n #line 26 \"C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\AddFileToSQL\AddFileToSQL\DataMatch.aspx\"\r\n ((System.Web.UI.IAttributeAccessor)(@_ctrl)).SetAttribute(\"style\", \"top:auto; left:auto\");\r\n \r\n #line default\r\n #line hidden\r\n \r\n #line 26 \"C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\AddFileToSQL\AddFileToSQL\DataMatch.aspx\"\r\n ((System.Web.UI.IAttributeAccessor)(@_ctrl)).SetAttribute(\"top\", \"100px\");\r\n \r\n #line default\r\n #line hidden\r\n \r\n #line 26 \"C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\AddFileToSQL\AddFileToSQL\DataMatch.aspx\"\r\n @_ctrl.Click -= new System.EventHandler(this.btnSubmit_Click);\r\n \r\n #line default\r\n #line hidden\r\n \r\n #line 26 \"C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\AddFileToSQL\AddFileToSQL\DataMatch.aspx\"\r\n @__ctrl.Click += new System.EventHandler(this.btnSubmit_Click);\r\n \r\n #line default\r\n #line hidden\r\n return @_ctrl;\r\n }\r\n \r\n [System.Diagnostics.DebuggerNonUserCodeAttribute()]\r\n private global::System.Web.UI.HtmlControls.HtmlTableCell @_BuildControl_control10() {\r\n global::System.Web.UI.HtmlControls.HtmlTableCell @_ctrl;\r\n \r\n #line 25 \"C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\AddFileToSQL\AddFileToSQL\DataMatch.aspx\"\r\n @_ctrl = new global::System.Web.UI.HtmlControls.HtmlTableCell(\"td\");\r\n \r\n #line default\r\n #line hidden\r\n \r\n #line 25 \"C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\AddFileToSQL\AddFileToSQL\DataMatch.aspx\"\r\n @_ctrl.Align = \"center\";\r\n \r\n #line default\r\n #line hidden\r\n System.Web.UI.IParserAccessor @_parser = ((System.Web.UI.IParserAccessor)(@_ctrl));\r\n \r\n #line 25 \"C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\AddFileToSQL\AddFileToSQL\DataMatch.aspx\"\r\n @_parser.AddParsedSubObject(new System.Web.UI.LiteralControl(\"\r\n \"));\r\n \r\n #line default\r\n #line hidden\r\n global::System.Web.UI.WebControls.Button @_ctrl1;\r\n \r\n #line 25 \"C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\AddFileToSQL\AddFileToSQL\DataMatch.aspx\"\r\n @_ctrl1 = this.@_BuildControlbtnSubmit();\r\n \r\n #line default\r\n #line hidden\r\n \r\n #line 25 \"C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\AddFileToSQL\AddFileToSQL\DataMatch.aspx\"\r\n @_parser.AddParsedSubObject(@_ctrl1);\r\n \r\n #line default\r\n #line hidden\r\n \r\n #line 25 \"C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\AddFileToSQL\AddFileToSQL\DataMatch.aspx\"\r\n @_parser.AddParsedSubObject(new System.Web.UI.LiteralControl(\"\r\n  \r\n \"));\r\n \r\n #line default\r\n #line hidden\r\n return @_ctrl;\r\n }\r\n \r\n [System.Diagnostics.DebuggerNonUserCodeAttribute()]\r\n private void @_BuildControl_control7(System.Web.UI.HtmlControls.HtmlTableCellCollection @_ctrl) {\r\n global::System.Web.UI.HtmlControls.HtmlTableCell @_ctrl1;\r\n \r\n #line 17 \"C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\AddFileToSQL\AddFileToSQL\DataMatch.aspx\"\r\n @_ctrl1 = this.@_BuildControl_control8();\r\n \r\n #line default\r\n #line hidden\r\n \r\n #line 17 \"C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\AddFileToSQL\AddFileToSQL\DataMatch.aspx\"\r\n @_ctrl.Add(@_ctrl1);\r\n \r\n #line default\r\n #line hidden\r\n global::System.Web.UI.HtmlControls.HtmlTableCell @_ctrl2;\r\n \r\n #line 17 \"C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\AddFileToSQL\AddFileToSQL\DataMatch.aspx\"\r\n @_ctrl2 = this.@_BuildControl_control9();\r\n \r\n #line default\r\n #line hidden\r\n \r\n #line 17 \"C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\AddFileToSQL\AddFileToSQL\DataMatch.aspx\"\r\n @_ctrl.Add(@_ctrl2);\r\n \r\n #line default\r\n #line hidden\r\n global::System.Web.UI.HtmlControls.HtmlTableCell @_ctrl3;\r\n \r\n #line 17 \"C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\AddFileToSQL\AddFileToSQL\DataMatch.aspx\"\r\n @_ctrl3 = this.@_BuildControl_control10();\r\n \r\n #line default\r\n #line hidden\r\n \r\n #line 17 \"C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\AddFileToSQL\AddFileToSQL\DataMatch.aspx\"\r\n @_ctrl.Add(@_ctrl3);\r\n \r\n #line default\r\n #line hidden\r\n }\r\n \r\n [System.Diagnostics.DebuggerNonUserCodeAttribute()]\r\n private global::System.Web.UI.HtmlControls.HtmlTableRow @_BuildControl_control6() {\r\n global::System.Web.UI.HtmlControls.HtmlTableRow @_ctrl;\r\n \r\n #line 17 \"C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\AddFileToSQL\AddFileToSQL\DataMatch.aspx\"\r\n @_ctrl = new global::System.Web.UI.HtmlControls.HtmlTableRow();\r\n \r\n #line default\r\n #line hidden\r\n \r\n #line 17 \"C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\AddFileToSQL\AddFileToSQL\DataMatch.aspx\"\r\n @_ctrl.Align = \"center\";\r\n \r\n #line default\r\n #line hidden\r\n \r\n #line 17 \"C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\AddFileToSQL\AddFileToSQL\DataMatch.aspx\"\r\n this.@_BuildControl_control7(@_ctrl.Cells);\r\n \r\n #line default\r\n #line hidden\r\n return @_ctrl;\r\n }\r\n \r\n [System.Diagnostics.DebuggerNonUserCodeAttribute()]\r\n private global::System.Web.UI.WebControls.Literal @_BuildControllTextData() {\r\n global::System.Web.UI.WebControls.Literal @_ctrl;\r\n \r\n #line 34 \"C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\AddFileToSQL\AddFileToSQL\DataMatch.aspx\"\r\n @_ctrl = new global::System.Web.UI.WebControls.Literal();\r\n \r\n #line default\r\n #line hidden\r\n this.lTextData = @_ctrl;\r\n \r\n #line 34 \"C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\AddFileToSQL\AddFileToSQL\DataMatch.aspx\"\r\n @_ctrl.ID = \"lTextData\";\r\n \r\n #line default\r\n #line hidden\r\n return @_ctrl;\r\n }\r\n \r\n [System.Diagnostics.DebuggerNonUserCodeAttribute()]\r\n private global::System.Web.UI.WebControls.Panel @_BuildControlpnlDisplayData() {\r\n global::System.Web.UI.WebControls.Panel @_ctrl;\r\n \r\n #line 31 \"C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\AddFileToSQL\AddFileToSQL\DataMatch.aspx\"\r\n @_ctrl = new global::System.Web.UI.WebControls.Panel();\r\n \r\n #line default\r\n #line hidden\r\n this.pnlDisplayData = @_ctrl;\r\n @_ctrl.ApplyStyleSheetSkin(this);\r\n \r\n #line 31 \"C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\AddFileToSQL\AddFileToSQL\DataMatch.aspx\"\r\n @_ctrl.ID = \"pnlDisplayData\";\r\n \r\n #line default\r\n #line hidden\r\n \r\n #line 31 \"C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\AddFileToSQL\AddFileToSQL\DataMatch.aspx\"\r\n @_ctrl.Visible = false;\r\n \r\n #line default\r\n #line hidden\r\n System.Web.UI.IParserAccessor @_parser = ((System.Web.UI.IParserAccessor)(@_ctrl));\r\n \r\n #line 31 \"C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\AddFileToSQL\AddFileToSQL\DataMatch.aspx\"\r\n @_parser.AddParsedSubObject(new System.Web.UI.LiteralControl(\"\r\n \r\n \r\n \" +\r\n \" \"));\r\n \r\n #line default\r\n #line hidden\r\n global::System.Web.UI.WebControls.Literal @_ctrl1;\r\n \r\n #line 31 \"C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\AddFileToSQL\AddFileToSQL\DataMatch.aspx\"\r\n @_ctrl1 = this.@_BuildControllTextData();\r\n \r\n #line default\r\n #line hidden\r\n \r\n #line 31 \"C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\AddFileToSQL\AddFileToSQL\DataMatch.aspx\"\r\n @_parser.AddParsedSubObject(@_ctrl1);\r\n \r\n #line default\r\n #line hidden\r\n \r\n #line 31 \"C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\AddFileToSQL\AddFileToSQL\DataMatch.aspx\"\r\n @_parser.AddParsedSubObject(new System.Web.UI.LiteralCont

    Read the article

  • Server 2008R2 Server Manager Roles and Features won't refresh or allow addition of new roles or features

    - by MattChorba
    I have a standalone DC in an isolated lab. I have installed the SUR tool and found no errors. I ran SFC and found no errors. I have attempted to install Windows Backup feature using Powershell, but received the same error about the computer needing to be restarted. Powershell cmdlets will list all of the installed roles and features. The rest of Server Manager works without problems. What can I do to get Server Manager Roles and Features working properly again? Picture of Error: CheckSUR.log: ================================= Checking System Update Readiness. Binary Version 6.1.7601.21645 Package Version 13.0 2011-11-28 13:20 Checking Windows Servicing Packages Checking Package Manifests and Catalogs Checking Package Watchlist Checking Component Watchlist Checking Packages Checking Component Store Summary: Seconds executed: 413 No errors detected (w) Unable to get system disk properties 0x0000045D IOCTL_STORAGE_QUERY_PROPERTY Disk Cache CheckSUR.persist.log: ================================= Checking System Update Readiness. Binary Version 6.1.7601.21645 Package Version 13.0 2011-11-28 13:20 Checking Windows Servicing Packages Checking Package Manifests and Catalogs Checking Package Watchlist Checking Component Watchlist Checking Packages Checking Component Store Summary: Seconds executed: 413 No errors detected (w) Unable to get system disk properties 0x0000045D IOCTL_STORAGE_QUERY_PROPERTY Disk Cache

    Read the article

  • Responsive Inline Elements with Twitter Bootstrap

    - by MightyZot
    Originally posted on: http://geekswithblogs.net/MightyZot/archive/2013/11/12/responsive-inline-elements-with-twitter-bootstrap.aspxTwitter Boostrap is a responsive css platform created by some dudes affiliated with Twitter and since supported and maintained by an open source following. I absolutely love the new version of this css toolkit. They rebuilt it with a mobile first strategy and it’s very easy to layout pages once you get the hang of it. Using a css / javascript framework like bootstrap is certainly much easier than coding your layout by hand. And, you get a “leg up” when it comes to adding responsive features to your site. Bootstrap includes column layout classes that let you specify size and placement based upon the viewport width. In addition, there are a handful of responsive helpers to hide and show content based upon the user’s device size. Most notably, the visible-xs, visible-sm, visible-md, and visible-lg classes let you show content for devices corresponding to those sizes (they are listed in the bootstrap docs.) hidden-xs, hidden-sm, hidden-md, and hidden-lg let you hide content for devices with those respective sizes. These helpers work great for showing and hiding block elements. Unfortunately, there isn’t a provision yet in Twitter Bootstrap (as of the time of this writing) for inline elements. We are using the navbar classes to create a navigation bar at the top of our website, www.crowdit.com. When you shrink the width of the screen to tablet or phone size, the tools in the navbar are turned into a drop down menu, and a button appears on the right side of the navbar. This is great! But, we wanted different content to display based upon whether the items were on the navbar versus when they were in the dropdown menu. The visible-?? and hidden-?? classes make this easy for images and block elements. In our case, we wanted our anchors to show different text depending upon whether they’re in the navbar, or in the dropdown. span is inherently inline and it can be a block element. My first approach was to create two anchors for each options, one set visible when the navbar is on a desktop or laptop with a wide display and another set visible when the elements converted to a dropdown menu. That works fine with the visible-?? and hidden-?? classes, but it just doesn’t seem that clean to me. I put up with that for about a week…last night I created the following classes to augment the block-based classes provided by bootstrap. .cdt-hidden-xs, .cdt-hidden-sm, .cdt-hidden-md, .cdt-hidden-lg {     display: inline !important; } @media (max-width:767px) {     .cdt-hidden-xs, .cdt-hidden-sm.cdt-hidden-xs, .cdt-hidden-md.cdt-hidden-xs, .cdt-hidden-lg.cdt-hidden-xs {         display: none !important;     } } @media (min-width:768px) and (max-width:991px) {     .cdt-hidden-xs.cdt-hidden-sm, .cdt-hidden-sm, .cdt-hidden-md.cdt-hidden-sm, .cdt-hidden-lg.cdt-hidden-sm {         display: none !important;     } } @media (min-width:992px) and (max-width:1199px) {     .cdt-hidden-xs.cdt-hidden-md, .cdt-hidden-sm.cdt-hidden-md, .cdt-hidden-md, .cdt-hidden-lg.cdt-hidden-md {         display: none !important;     } } @media (min-width:1200px) {     .cdt-hidden-xs.cdt-hidden-lg, .cdt-hidden-sm.cdt-hidden-lg, .cdt-hidden-md.cdt-hidden-lg, .cdt-hidden-lg {         display: none !important;     } } .cdt-visible-xs, .cdt-visible-sm, .cdt-visible-md, .cdt-visible-lg {     display: none !important; } @media (max-width:767px) {     .cdt-visible-xs, .cdt-visible-sm.cdt-visible-xs, .cdt-visible-md.cdt-visible-xs, .cdt-visible-lg.cdt-visible-xs {         display: inline !important;     } } @media (min-width:768px) and (max-width:991px) {     .cdt-visible-xs.cdt-visible-sm, .cdt-visible-sm, .cdt-visible-md.cdt-visible-sm, .cdt-visible-lg.cdt-visible-sm {         display: inline !important;     } } @media (min-width:992px) and (max-width:1199px) {     .cdt-visible-xs.cdt-visible-md, .cdt-visible-sm.cdt-visible-md, .cdt-visible-md, .cdt-visible-lg.cdt-visible-md {         display: inline !important;     } } @media (min-width:1200px) {     .cdt-visible-xs.cdt-visible-lg, .cdt-visible-sm.cdt-visible-lg, .cdt-visible-md.cdt-visible-lg, .cdt-visible-lg {         display: inline !important;     } } I created these by looking at the example provided by bootstrap and consolidating the styles. “cdt” is just a prefix that I’m using to distinguish these classes from the block-based classes in bootstrap. You are welcome to change the prefix to whatever feels right for you. These classes can be applied to spans in textual content to hide and show text based upon the browser width. Applying the styles is simple… <span class=”cdt-visible-xs”>This text is visible in extra small</span> <span class=”cdt-visible-sm”>This text is visible in small</span> Why would you want to do this? Here are a couple of examples, shown in screen shots. This is the CrowdIt navbar on larger displays. Notice how the text is two line and certain words are capitalized? Now, check this out! Here is a screen shot showing the dropdown menu that’s displayed when the browser window is tablet or phone sized. The markup to make this happen is quite simple…take a look. <li>     <a href="@Url.Action("what-is-crowdit","home")" title="Learn about what CrowdIt can do for your Small Business">         <span class="cdt-hidden-xs">WHAT<br /><small>is CrowdIt?</small></span>         <span class="cdt-visible-xs">What is CrowdIt?</span>     </a> </li> There is a single anchor tag in this example and only the spans change visibility based on browser width. I left them separate for readability and because I wanted to use the small tag; however, you could just as easily hide the “WHAT” and the br tag on small displays and replace them with “What “, consolidating this even further to text containing a single span. <span class=”cdt-hidden-xs”>WHAT<br /></span><span class=”cdt-visible-xs”>What </span>is CrowdIt? You might be a master of css and have a better method of handling this problem. If so, I’d love to hear about your solution…leave me some feedback! You’ll be entered into a drawing for a chance to win an autographed picture of ME! Yay!

    Read the article

  • Hidden Features of C#?

    - by Serhat Özgel
    This came to my mind after I learned the following from this question: where T : struct We, C# developers, all know the basics of C#. I mean declarations, conditionals, loops, operators, etc. Some of us even mastered the stuff like Generics, anonymous types, lambdas, linq, ... But what are the most hidden features or tricks of C# that even C# fans, addicts, experts barely know? Here are the revealed features so far: Keywords yield by Michael Stum var by Michael Stum using() statement by kokos readonly by kokos as by Mike Stone as / is by Ed Swangren as / is (improved) by Rocketpants default by deathofrats global:: by pzycoman using() blocks by AlexCuse volatile by Jakub Šturc extern alias by Jakub Šturc Attributes DefaultValueAttribute by Michael Stum ObsoleteAttribute by DannySmurf DebuggerDisplayAttribute by Stu DebuggerBrowsable and DebuggerStepThrough by bdukes ThreadStaticAttribute by marxidad FlagsAttribute by Martin Clarke ConditionalAttribute by AndrewBurns Syntax ?? operator by kokos number flaggings by Nick Berardi where T:new by Lars Mæhlum implicit generics by Keith one-parameter lambdas by Keith auto properties by Keith namespace aliases by Keith verbatim string literals with @ by Patrick enum values by lfoust @variablenames by marxidad event operators by marxidad format string brackets by Portman property accessor accessibility modifiers by xanadont ternary operator (?:) by JasonS checked and unchecked operators by Binoj Antony implicit and explicit operators by Flory Language Features Nullable types by Brad Barker Currying by Brian Leahy anonymous types by Keith __makeref __reftype __refvalue by Judah Himango object initializers by lomaxx format strings by David in Dakota Extension Methods by marxidad partial methods by Jon Erickson preprocessor directives by John Asbeck DEBUG pre-processor directive by Robert Durgin operator overloading by SefBkn type inferrence by chakrit boolean operators taken to next level by Rob Gough pass value-type variable as interface without boxing by Roman Boiko programmatically determine declared variable type by Roman Boiko Static Constructors by Chris Easier-on-the-eyes / condensed ORM-mapping using LINQ by roosteronacid Visual Studio Features select block of text in editor by Himadri snippets by DannySmurf Framework TransactionScope by KiwiBastard DependantTransaction by KiwiBastard Nullable<T> by IainMH Mutex by Diago System.IO.Path by ageektrapped WeakReference by Juan Manuel Methods and Properties String.IsNullOrEmpty() method by KiwiBastard List.ForEach() method by KiwiBastard BeginInvoke(), EndInvoke() methods by Will Dean Nullable<T>.HasValue and Nullable<T>.Value properties by Rismo GetValueOrDefault method by John Sheehan Tips & Tricks nice method for event handlers by Andreas H.R. Nilsson uppercase comparisons by John access anonymous types without reflection by dp a quick way to lazily instantiate collection properties by Will JavaScript-like anonymous inline-functions by roosteronacid Other netmodules by kokos LINQBridge by Duncan Smart Parallel Extensions by Joel Coehoorn

    Read the article

  • Are there any "undocumented features" in Silverlight?

    - by Sorskoot
    I was wondering if there are any features in Silverlight 2 or 3 that aren't documented or are hidden very deep in the framework? Stuff that can be very helpful in some cases, but can be a pain to find. Are there any "hidden" gems? I'm thinking about stuff you normaly don't find in tutorials and in demos. For example, finding information about the operating system the Silverlight Application is running on thru the System.OperatingSystem class.

    Read the article

  • Hidden Features of Delphi

    - by JosephStyons
    The "Hidden Features" series here on StackOverflow has generated some really interesting feedback. So what about my favorite IDE, Delphi? What are some hidden features there? I'll start with one of my own: You can invoke inline find by typing Ctrl+E, then typing your search term.

    Read the article

  • Hidden features of C

    - by bernardn
    I know there is a standard behind all C compiler implementations, so there should be no hidden features. Despite that, I am sure all C developers have hidden/secret tricks they use all the time.

    Read the article

  • How to detect hidden field tampering?

    - by Myron
    On a form of my web app, I've got a hidden field that I need to protect from tampering for security reasons. I'm trying to come up with a solution whereby I can detect if the value of the hidden field has been changed, and react appropriately (i.e. with a generic "Something went wrong, please try again" error message). The solution should be secure enough that brute force attacks are infeasible. I've got a basic solution that I think will work, but I'm not security expert and I may be totally missing something here. My idea is to render two hidden inputs: one named "important_value", containing the value I need to protect, and one named "important_value_hash" containing the SHA hash of the important value concatenated with a constant long random string (i.e. the same string will be used every time). When the form is submitted, the server will re-compute the SHA hash, and compare against the submitted value of important_value_hash. If they are not the same, the important_value has been tampered with. I could also concatenate additional values with the SHA's input string (maybe the user's IP address?), but I don't know if that really gains me anything. Will this be secure? Anyone have any insight into how it might be broken, and what could/should be done to improve it? Thanks!

    Read the article

  • New features of C# 4.0

    This article covers New features of C# 4.0. Article has been divided into below sections. Introduction. Dynamic Lookup. Named and Optional Arguments. Features for COM interop. Variance. Relationship with Visual Basic. Resources. Other interested readings… 22 New Features of Visual Studio 2008 for .NET Professionals 50 New Features of SQL Server 2008 IIS 7.0 New features Introduction It is now close to a year since Microsoft Visual C# 3.0 shipped as part of Visual Studio 2008. In the VS Managed Languages team we are hard at work on creating the next version of the language (with the unsurprising working title of C# 4.0), and this document is a first public description of the planned language features as we currently see them. Please be advised that all this is in early stages of production and is subject to change. Part of the reason for sharing our plans in public so early is precisely to get the kind of feedback that will cause us to improve the final product before it rolls out. Simultaneously with the publication of this whitepaper, a first public CTP (community technology preview) of Visual Studio 2010 is going out as a Virtual PC image for everyone to try. Please use it to play and experiment with the features, and let us know of any thoughts you have. We ask for your understanding and patience working with very early bits, where especially new or newly implemented features do not have the quality or stability of a final product. The aim of the CTP is not to give you a productive work environment but to give you the best possible impression of what we are working on for the next release. The CTP contains a number of walkthroughs, some of which highlight the new language features of C# 4.0. Those are excellent for getting a hands-on guided tour through the details of some common scenarios for the features. You may consider this whitepaper a companion document to these walkthroughs, complementing them with a focus on the overall language features and how they work, as opposed to the specifics of the concrete scenarios. C# 4.0 The major theme for C# 4.0 is dynamic programming. Increasingly, objects are “dynamic” in the sense that their structure and behavior is not captured by a static type, or at least not one that the compiler knows about when compiling your program. Some examples include a. objects from dynamic programming languages, such as Python or Ruby b. COM objects accessed through IDispatch c. ordinary .NET types accessed through reflection d. objects with changing structure, such as HTML DOM objects While C# remains a statically typed language, we aim to vastly improve the interaction with such objects. A secondary theme is co-evolution with Visual Basic. Going forward we will aim to maintain the individual character of each language, but at the same time important new features should be introduced in both languages at the same time. They should be differentiated more by style and feel than by feature set. The new features in C# 4.0 fall into four groups: Dynamic lookup Dynamic lookup allows you to write method, operator and indexer calls, property and field accesses, and even object invocations which bypass the C# static type checking and instead gets resolved at runtime. Named and optional parameters Parameters in C# can now be specified as optional by providing a default value for them in a member declaration. When the member is invoked, optional arguments can be omitted. Furthermore, any argument can be passed by parameter name instead of position. COM specific interop features Dynamic lookup as well as named and optional parameters both help making programming against COM less painful than today. On top of that, however, we are adding a number of other small features that further improve the interop experience. Variance It used to be that an IEnumerable<string> wasn’t an IEnumerable<object>. Now it is – C# embraces type safe “co-and contravariance” and common BCL types are updated to take advantage of that. Dynamic Lookup Dynamic lookup allows you a unified approach to invoking things dynamically. With dynamic lookup, when you have an object in your hand you do not need to worry about whether it comes from COM, IronPython, the HTML DOM or reflection; you just apply operations to it and leave it to the runtime to figure out what exactly those operations mean for that particular object. This affords you enormous flexibility, and can greatly simplify your code, but it does come with a significant drawback: Static typing is not maintained for these operations. A dynamic object is assumed at compile time to support any operation, and only at runtime will you get an error if it wasn’t so. Oftentimes this will be no loss, because the object wouldn’t have a static type anyway, in other cases it is a tradeoff between brevity and safety. In order to facilitate this tradeoff, it is a design goal of C# to allow you to opt in or opt out of dynamic behavior on every single call. The dynamic type C# 4.0 introduces a new static type called dynamic. When you have an object of type dynamic you can “do things to it” that are resolved only at runtime: dynamic d = GetDynamicObject(…); d.M(7); The C# compiler allows you to call a method with any name and any arguments on d because it is of type dynamic. At runtime the actual object that d refers to will be examined to determine what it means to “call M with an int” on it. The type dynamic can be thought of as a special version of the type object, which signals that the object can be used dynamically. It is easy to opt in or out of dynamic behavior: any object can be implicitly converted to dynamic, “suspending belief” until runtime. Conversely, there is an “assignment conversion” from dynamic to any other type, which allows implicit conversion in assignment-like constructs: dynamic d = 7; // implicit conversion int i = d; // assignment conversion Dynamic operations Not only method calls, but also field and property accesses, indexer and operator calls and even delegate invocations can be dispatched dynamically: dynamic d = GetDynamicObject(…); d.M(7); // calling methods d.f = d.P; // getting and settings fields and properties d[“one”] = d[“two”]; // getting and setting thorugh indexers int i = d + 3; // calling operators string s = d(5,7); // invoking as a delegate The role of the C# compiler here is simply to package up the necessary information about “what is being done to d”, so that the runtime can pick it up and determine what the exact meaning of it is given an actual object d. Think of it as deferring part of the compiler’s job to runtime. The result of any dynamic operation is itself of type dynamic. Runtime lookup At runtime a dynamic operation is dispatched according to the nature of its target object d: COM objects If d is a COM object, the operation is dispatched dynamically through COM IDispatch. This allows calling to COM types that don’t have a Primary Interop Assembly (PIA), and relying on COM features that don’t have a counterpart in C#, such as indexed properties and default properties. Dynamic objects If d implements the interface IDynamicObject d itself is asked to perform the operation. Thus by implementing IDynamicObject a type can completely redefine the meaning of dynamic operations. This is used intensively by dynamic languages such as IronPython and IronRuby to implement their own dynamic object models. It will also be used by APIs, e.g. by the HTML DOM to allow direct access to the object’s properties using property syntax. Plain objects Otherwise d is a standard .NET object, and the operation will be dispatched using reflection on its type and a C# “runtime binder” which implements C#’s lookup and overload resolution semantics at runtime. This is essentially a part of the C# compiler running as a runtime component to “finish the work” on dynamic operations that was deferred by the static compiler. Example Assume the following code: dynamic d1 = new Foo(); dynamic d2 = new Bar(); string s; d1.M(s, d2, 3, null); Because the receiver of the call to M is dynamic, the C# compiler does not try to resolve the meaning of the call. Instead it stashes away information for the runtime about the call. This information (often referred to as the “payload”) is essentially equivalent to: “Perform an instance method call of M with the following arguments: 1. a string 2. a dynamic 3. a literal int 3 4. a literal object null” At runtime, assume that the actual type Foo of d1 is not a COM type and does not implement IDynamicObject. In this case the C# runtime binder picks up to finish the overload resolution job based on runtime type information, proceeding as follows: 1. Reflection is used to obtain the actual runtime types of the two objects, d1 and d2, that did not have a static type (or rather had the static type dynamic). The result is Foo for d1 and Bar for d2. 2. Method lookup and overload resolution is performed on the type Foo with the call M(string,Bar,3,null) using ordinary C# semantics. 3. If the method is found it is invoked; otherwise a runtime exception is thrown. Overload resolution with dynamic arguments Even if the receiver of a method call is of a static type, overload resolution can still happen at runtime. This can happen if one or more of the arguments have the type dynamic: Foo foo = new Foo(); dynamic d = new Bar(); var result = foo.M(d); The C# runtime binder will choose between the statically known overloads of M on Foo, based on the runtime type of d, namely Bar. The result is again of type dynamic. The Dynamic Language Runtime An important component in the underlying implementation of dynamic lookup is the Dynamic Language Runtime (DLR), which is a new API in .NET 4.0. The DLR provides most of the infrastructure behind not only C# dynamic lookup but also the implementation of several dynamic programming languages on .NET, such as IronPython and IronRuby. Through this common infrastructure a high degree of interoperability is ensured, but just as importantly the DLR provides excellent caching mechanisms which serve to greatly enhance the efficiency of runtime dispatch. To the user of dynamic lookup in C#, the DLR is invisible except for the improved efficiency. However, if you want to implement your own dynamically dispatched objects, the IDynamicObject interface allows you to interoperate with the DLR and plug in your own behavior. This is a rather advanced task, which requires you to understand a good deal more about the inner workings of the DLR. For API writers, however, it can definitely be worth the trouble in order to vastly improve the usability of e.g. a library representing an inherently dynamic domain. Open issues There are a few limitations and things that might work differently than you would expect. · The DLR allows objects to be created from objects that represent classes. However, the current implementation of C# doesn’t have syntax to support this. · Dynamic lookup will not be able to find extension methods. Whether extension methods apply or not depends on the static context of the call (i.e. which using clauses occur), and this context information is not currently kept as part of the payload. · Anonymous functions (i.e. lambda expressions) cannot appear as arguments to a dynamic method call. The compiler cannot bind (i.e. “understand”) an anonymous function without knowing what type it is converted to. One consequence of these limitations is that you cannot easily use LINQ queries over dynamic objects: dynamic collection = …; var result = collection.Select(e => e + 5); If the Select method is an extension method, dynamic lookup will not find it. Even if it is an instance method, the above does not compile, because a lambda expression cannot be passed as an argument to a dynamic operation. There are no plans to address these limitations in C# 4.0. Named and Optional Arguments Named and optional parameters are really two distinct features, but are often useful together. Optional parameters allow you to omit arguments to member invocations, whereas named arguments is a way to provide an argument using the name of the corresponding parameter instead of relying on its position in the parameter list. Some APIs, most notably COM interfaces such as the Office automation APIs, are written specifically with named and optional parameters in mind. Up until now it has been very painful to call into these APIs from C#, with sometimes as many as thirty arguments having to be explicitly passed, most of which have reasonable default values and could be omitted. Even in APIs for .NET however you sometimes find yourself compelled to write many overloads of a method with different combinations of parameters, in order to provide maximum usability to the callers. Optional parameters are a useful alternative for these situations. Optional parameters A parameter is declared optional simply by providing a default value for it: public void M(int x, int y = 5, int z = 7); Here y and z are optional parameters and can be omitted in calls: M(1, 2, 3); // ordinary call of M M(1, 2); // omitting z – equivalent to M(1, 2, 7) M(1); // omitting both y and z – equivalent to M(1, 5, 7) Named and optional arguments C# 4.0 does not permit you to omit arguments between commas as in M(1,,3). This could lead to highly unreadable comma-counting code. Instead any argument can be passed by name. Thus if you want to omit only y from a call of M you can write: M(1, z: 3); // passing z by name or M(x: 1, z: 3); // passing both x and z by name or even M(z: 3, x: 1); // reversing the order of arguments All forms are equivalent, except that arguments are always evaluated in the order they appear, so in the last example the 3 is evaluated before the 1. Optional and named arguments can be used not only with methods but also with indexers and constructors. Overload resolution Named and optional arguments affect overload resolution, but the changes are relatively simple: A signature is applicable if all its parameters are either optional or have exactly one corresponding argument (by name or position) in the call which is convertible to the parameter type. Betterness rules on conversions are only applied for arguments that are explicitly given – omitted optional arguments are ignored for betterness purposes. If two signatures are equally good, one that does not omit optional parameters is preferred. M(string s, int i = 1); M(object o); M(int i, string s = “Hello”); M(int i); M(5); Given these overloads, we can see the working of the rules above. M(string,int) is not applicable because 5 doesn’t convert to string. M(int,string) is applicable because its second parameter is optional, and so, obviously are M(object) and M(int). M(int,string) and M(int) are both better than M(object) because the conversion from 5 to int is better than the conversion from 5 to object. Finally M(int) is better than M(int,string) because no optional arguments are omitted. Thus the method that gets called is M(int). Features for COM interop Dynamic lookup as well as named and optional parameters greatly improve the experience of interoperating with COM APIs such as the Office Automation APIs. In order to remove even more of the speed bumps, a couple of small COM-specific features are also added to C# 4.0. Dynamic import Many COM methods accept and return variant types, which are represented in the PIAs as object. In the vast majority of cases, a programmer calling these methods already knows the static type of a returned object from context, but explicitly has to perform a cast on the returned value to make use of that knowledge. These casts are so common that they constitute a major nuisance. In order to facilitate a smoother experience, you can now choose to import these COM APIs in such a way that variants are instead represented using the type dynamic. In other words, from your point of view, COM signatures now have occurrences of dynamic instead of object in them. This means that you can easily access members directly off a returned object, or you can assign it to a strongly typed local variable without having to cast. To illustrate, you can now say excel.Cells[1, 1].Value = "Hello"; instead of ((Excel.Range)excel.Cells[1, 1]).Value2 = "Hello"; and Excel.Range range = excel.Cells[1, 1]; instead of Excel.Range range = (Excel.Range)excel.Cells[1, 1]; Compiling without PIAs Primary Interop Assemblies are large .NET assemblies generated from COM interfaces to facilitate strongly typed interoperability. They provide great support at design time, where your experience of the interop is as good as if the types where really defined in .NET. However, at runtime these large assemblies can easily bloat your program, and also cause versioning issues because they are distributed independently of your application. The no-PIA feature allows you to continue to use PIAs at design time without having them around at runtime. Instead, the C# compiler will bake the small part of the PIA that a program actually uses directly into its assembly. At runtime the PIA does not have to be loaded. Omitting ref Because of a different programming model, many COM APIs contain a lot of reference parameters. Contrary to refs in C#, these are typically not meant to mutate a passed-in argument for the subsequent benefit of the caller, but are simply another way of passing value parameters. It therefore seems unreasonable that a C# programmer should have to create temporary variables for all such ref parameters and pass these by reference. Instead, specifically for COM methods, the C# compiler will allow you to pass arguments by value to such a method, and will automatically generate temporary variables to hold the passed-in values, subsequently discarding these when the call returns. In this way the caller sees value semantics, and will not experience any side effects, but the called method still gets a reference. Open issues A few COM interface features still are not surfaced in C#. Most notably these include indexed properties and default properties. As mentioned above these will be respected if you access COM dynamically, but statically typed C# code will still not recognize them. There are currently no plans to address these remaining speed bumps in C# 4.0. Variance An aspect of generics that often comes across as surprising is that the following is illegal: IList<string> strings = new List<string>(); IList<object> objects = strings; The second assignment is disallowed because strings does not have the same element type as objects. There is a perfectly good reason for this. If it were allowed you could write: objects[0] = 5; string s = strings[0]; Allowing an int to be inserted into a list of strings and subsequently extracted as a string. This would be a breach of type safety. However, there are certain interfaces where the above cannot occur, notably where there is no way to insert an object into the collection. Such an interface is IEnumerable<T>. If instead you say: IEnumerable<object> objects = strings; There is no way we can put the wrong kind of thing into strings through objects, because objects doesn’t have a method that takes an element in. Variance is about allowing assignments such as this in cases where it is safe. The result is that a lot of situations that were previously surprising now just work. Covariance In .NET 4.0 the IEnumerable<T> interface will be declared in the following way: public interface IEnumerable<out T> : IEnumerable { IEnumerator<T> GetEnumerator(); } public interface IEnumerator<out T> : IEnumerator { bool MoveNext(); T Current { get; } } The “out” in these declarations signifies that the T can only occur in output position in the interface – the compiler will complain otherwise. In return for this restriction, the interface becomes “covariant” in T, which means that an IEnumerable<A> is considered an IEnumerable<B> if A has a reference conversion to B. As a result, any sequence of strings is also e.g. a sequence of objects. This is useful e.g. in many LINQ methods. Using the declarations above: var result = strings.Union(objects); // succeeds with an IEnumerable<object> This would previously have been disallowed, and you would have had to to some cumbersome wrapping to get the two sequences to have the same element type. Contravariance Type parameters can also have an “in” modifier, restricting them to occur only in input positions. An example is IComparer<T>: public interface IComparer<in T> { public int Compare(T left, T right); } The somewhat baffling result is that an IComparer<object> can in fact be considered an IComparer<string>! It makes sense when you think about it: If a comparer can compare any two objects, it can certainly also compare two strings. This property is referred to as contravariance. A generic type can have both in and out modifiers on its type parameters, as is the case with the Func<…> delegate types: public delegate TResult Func<in TArg, out TResult>(TArg arg); Obviously the argument only ever comes in, and the result only ever comes out. Therefore a Func<object,string> can in fact be used as a Func<string,object>. Limitations Variant type parameters can only be declared on interfaces and delegate types, due to a restriction in the CLR. Variance only applies when there is a reference conversion between the type arguments. For instance, an IEnumerable<int> is not an IEnumerable<object> because the conversion from int to object is a boxing conversion, not a reference conversion. Also please note that the CTP does not contain the new versions of the .NET types mentioned above. In order to experiment with variance you have to declare your own variant interfaces and delegate types. COM Example Here is a larger Office automation example that shows many of the new C# features in action. using System; using System.Diagnostics; using System.Linq; using Excel = Microsoft.Office.Interop.Excel; using Word = Microsoft.Office.Interop.Word; class Program { static void Main(string[] args) { var excel = new Excel.Application(); excel.Visible = true; excel.Workbooks.Add(); // optional arguments omitted excel.Cells[1, 1].Value = "Process Name"; // no casts; Value dynamically excel.Cells[1, 2].Value = "Memory Usage"; // accessed var processes = Process.GetProcesses() .OrderByDescending(p =&gt; p.WorkingSet) .Take(10); int i = 2; foreach (var p in processes) { excel.Cells[i, 1].Value = p.ProcessName; // no casts excel.Cells[i, 2].Value = p.WorkingSet; // no casts i++; } Excel.Range range = excel.Cells[1, 1]; // no casts Excel.Chart chart = excel.ActiveWorkbook.Charts. Add(After: excel.ActiveSheet); // named and optional arguments chart.ChartWizard( Source: range.CurrentRegion, Title: "Memory Usage in " + Environment.MachineName); //named+optional chart.ChartStyle = 45; chart.CopyPicture(Excel.XlPictureAppearance.xlScreen, Excel.XlCopyPictureFormat.xlBitmap, Excel.XlPictureAppearance.xlScreen); var word = new Word.Application(); word.Visible = true; word.Documents.Add(); // optional arguments word.Selection.Paste(); } } The code is much more terse and readable than the C# 3.0 counterpart. Note especially how the Value property is accessed dynamically. This is actually an indexed property, i.e. a property that takes an argument; something which C# does not understand. However the argument is optional. Since the access is dynamic, it goes through the runtime COM binder which knows to substitute the default value and call the indexed property. Thus, dynamic COM allows you to avoid accesses to the puzzling Value2 property of Excel ranges. Relationship with Visual Basic A number of the features introduced to C# 4.0 already exist or will be introduced in some form or other in Visual Basic: · Late binding in VB is similar in many ways to dynamic lookup in C#, and can be expected to make more use of the DLR in the future, leading to further parity with C#. · Named and optional arguments have been part of Visual Basic for a long time, and the C# version of the feature is explicitly engineered with maximal VB interoperability in mind. · NoPIA and variance are both being introduced to VB and C# at the same time. VB in turn is adding a number of features that have hitherto been a mainstay of C#. As a result future versions of C# and VB will have much better feature parity, for the benefit of everyone. Resources All available resources concerning C# 4.0 can be accessed through the C# Dev Center. Specifically, this white paper and other resources can be found at the Code Gallery site. Enjoy! span.fullpost {display:none;}

    Read the article

  • Animated background image in a hidden <div> doesn't load or loads not animated

    - by Guanche
    Hello, I have spent the whole day trying to make a script which on "submit" hides the form and shows hidden with animated progress bar. The problem is that Internet Explorer doesn't show animated gif images in hidden divs. The images are static. I visited many websites and found a script which uses: document.getElementById(id).style.backgroundImage = 'url(/images/load.gif)'; Finally, my script works in Internet Explorer, Firefox, Opera but... Google Chrome doesn't display the image at all. I see only div text. After many tests I discovered the following: the only way to see the background image in Google Chrome is to include the same image somewhere in the page (outside of hidden div) with 1px dimensions: <img src="/images/load.gif" width="1" heigh="1" /> This did the trick but... after this dirty solution Microsoft Explorer for some reason shows the image as static again. So, my question is: is there any way how to force Gogle Chrome to show the image? Thanks. This is my script: <script language="JavaScript" type="text/javascript"> function ver (id, elementId){ if (document.getElementById('espera').style.visibility == "visible") { return false; }else{ var esplit = document.forms[0]['userfile'].value.split("."); ext = esplit[esplit.length-1]; if (document.forms[0]['userfile'].value == '') { alert('Please select a file'); return false; }else{ if ((ext.toLowerCase() == 'jpg')) { document.getElementById(id).style.position = 'absolute'; document.getElementById(id).style.display = 'inline'; document.getElementById(id).style.visibility = "visible"; document.getElementById(id).style.backgroundImage = 'url(/images/load.gif)'; document.getElementById(id).style.height = "100px"; document.getElementById(id).style.backgroundColor = '#f3f3f3'; document.getElementById(id).style.backgroundRepeat = "no-repeat"; document.getElementById(id).style.backgroundPosition = "50% 50%"; var element; if (document.all) element = document.all[elementId]; else if (document.getElementById) element = document.getElementById(elementId); if (element && element.style) element.style.display = 'none'; return true; }else{ alert('This is not a jpg file'); return false; } } } } </script> <div id="frmDiv"> <form enctype="multipart/form-data" action="/upload.php" method="post" name="upload3" onsubmit="return ver('espera','frmDiv');"> <input type="hidden" name="max_file_size" value="4194304" /> <table border="0" cellspacing="1" cellpadding="2" width="100%"> <tr bgcolor="#f5f5f5"> <td>File (jpg)</td> <td> <input type="file" name="userfile" class="upf" /></td></tr> <tr bgcolor="#f5f5f5"> <td>&nbsp;</td> <td> <input class="upf2" type="submit" name="add" value="Upload" /> </td></tr></table></form> </div> <div id="espera" style="display:none;text-align:center;float:left;width:753px;">&nbsp;<br />&nbsp;<br />&nbsp;<br />&nbsp;<br /> &nbsp;<br />Please wait...<br />&nbsp; </div>

    Read the article

  • Hidden Features of ASP.NET

    - by Vaibhav
    There are always features that would be useful in fringe scenarios, but for that very reason most people don't know them. I am asking for features that are not typically taught by the text books. What are the ones that you know?

    Read the article

  • Favorite Django Tips & Features?

    - by Haes
    Inspired by the question series 'Hidden features of ...', I am curious to hear about your favorite Django tips or lesser known but useful features you know of. Please, include only one tip per answer. Add Django version requirements if there are any.

    Read the article

  • Hidden Features of Grails

    - by knorv
    Inspired by the question series "Hidden features of ..", I am curious to hear about your favorite Grails tips or lesser known but useful features you know of. Rules: One feature per answer Give an example and short description of the feature, not just a link to documentation Label the feature using bold title as the first line

    Read the article

  • Media Player is missing from the list in "Turn Windows features on or off"

    - by arsaKasra
    I decided to reinstall Media Player in Vista [this way], so I figured I should turn it off as a Windows feature. But when I continue with the procedure, I get an incomplete list of features, here's an image: I looked around a bit, wondering if that is only an option available in 7, and I have seen people saying different things. So, is this only available for 7 or is there something wrong going on here? Can I make Media Player to show up in here? I am on a Toshiba Satellite A100 with Vista Home Premium OEM. I don't have my recovery disks or any restore point. Just to mention, I currently do have Media Player and it's working fine. Sorry if I can't think of any more details to add, please ask me for anything I should have included.

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >