tag:blogger.com,1999:blog-9220389270062827818.post1151785806955389224..comments2024-03-24T13:07:36.760+00:00Comments on Design, Code, Release: Asp.Net Dynamic Data – Default ValueNathanhttp://www.blogger.com/profile/02284010981286464436noreply@blogger.comBlogger5125tag:blogger.com,1999:blog-9220389270062827818.post-37428756224598264132011-09-28T14:04:44.981+01:002011-09-28T14:04:44.981+01:00Thanks Nathan, it works!Thanks Nathan, it works!Diego Correahttps://www.blogger.com/profile/16683951985628050982noreply@blogger.comtag:blogger.com,1999:blog-9220389270062827818.post-88879210878817653582011-09-27T21:37:13.917+01:002011-09-27T21:37:13.917+01:00@Francisco you could do it one of two ways.
If yo...@Francisco you could do it one of two ways.<br /><br />If you are going to want to reuse this in other projects and all over the current project look into an attribute.<br /><br />If you want it for just one specific thing you could just create a custom field template, which is dead easy, then just use the UIHint attribute to get DD to use that for your field.Nathanhttps://www.blogger.com/profile/02284010981286464436noreply@blogger.comtag:blogger.com,1999:blog-9220389270062827818.post-44226097134155241272011-09-27T20:52:55.937+01:002011-09-27T20:52:55.937+01:00Ok Nathan, thank you for your idea, now I have a b...Ok Nathan, thank you for your idea, now I have a better notion of that, but I want to put these value in a textbox control in the markup. How can I do that?<br /><br />Thanks in advance.Diego Correahttps://www.blogger.com/profile/16683951985628050982noreply@blogger.comtag:blogger.com,1999:blog-9220389270062827818.post-88964929283899388032011-09-27T20:09:08.091+01:002011-09-27T20:09:08.091+01:00@Francisco unfortunately you can't. The value ...@Francisco unfortunately you can't. The value has to be set at run time but there is a way round this.<br /><br />If you can create your own attribute you can easily make it provide whatever value you want to.<br /><br />If you only need it once on the page, which with logon name is likley, you could simply create a custom template and write the value directly in the markup.<br /><br />Hope this helps.Nathanhttps://www.blogger.com/profile/02284010981286464436noreply@blogger.comtag:blogger.com,1999:blog-9220389270062827818.post-10253798228130599302011-09-27T20:02:49.802+01:002011-09-27T20:02:49.802+01:00How can I use the DefaultValue attributes to put t...How can I use the DefaultValue attributes to put the windowsidentity instead of a constant value like "user" for example [DefaultValue(HttpContext.Current.Request.ServerVariables["LOGON_NAME].ToString()]?Diego Correahttps://www.blogger.com/profile/16683951985628050982noreply@blogger.com