Loading...
DotNetKicks.com
.NET links, community driven
login
register
submit a story
upcoming stories
about
blog
Why not
join our community?
, there are
9 users online
home
users
aquinas
comments
DotNetKick.com is an
open-source project
. Please
report any bugs
and let us know
your great suggestions
.
Currently running svn revision
620
(rss)
Kick Spy!
,
Kick Zeitgeist
and
Kick Widgets
aquinas
Profile
Kicked
Submitted
Comments
Tags
Friends
Kicked By Friends
Submitted By Friends
Comments:
Which kind of cast should you use in C#?
I don't think "as" is faster.
posted by
aquinas
17 days, 2 hours ago
ASP.NET: officially unmaintainable
"All MVC frameworks (not just the .NET ones) give you complete control over the HTML."
Because you have to write all the HTML yourself, correct? You can write all the HTML yourself in ASP.NET, just don't use any controls. Like you said: repeater works wonders. For many applications, you may need to do a lot of that. Depends on what you're doing.
"I found some things are just broken. I still have a site in production, with a single TextBox and asp:Button that will not work if you hit "Enter" in the TextBox."
For the case you mentioned you need to add defaultbutton="your button" to the form. This only is an issue with IE actually. Also, no offense but did you actually google this problem? e.g., google: "single textbox button submit onclick asp.net".
What else is broken?
posted by
aquinas
1 month, 15 days ago
ASP.NET: officially unmaintainable
# The ridiculous amount of time I spend in Reflector trying to figure out why things that are supposed to "just work" when wired up "just don't"
I don't think I've ever had to use reflector to figure out why something in asp.net isn't working. Really? You're CONSTANTLY in reflector? I find that hard to believe.
# Not having control over the HTML that is spit out.
HTML that is rendered by server controls you mean? Does MonoRail give you control magically over server control output, or do you just not USE server controls when using monorail? Either write your own controls or you could use control adapters.
Trying to do anything with AJAX or DHTML with the insane control names controlName.ClientID anyone?
Whatever.
posted by
aquinas
1 month, 15 days ago
Frans Bourma comparing OR mappers to Entity Framework.
Sheesh people are being pretty freaking harsh. Has anyone actually tried using EF yet?
posted by
aquinas
1 month, 16 days ago
Wake up ASP.NET developers!
I'm going back to sleep
posted by
aquinas
1 month, 28 days ago
Massive BlogEngine.Net Security Hole - Fix Provided
Why is the password stored in plain text?
posted by
aquinas
2 months, 22 days ago
Using aliases for better code readability
Yeah, I've never been a big fan of aliases myself. When reading the code you have classnames in your code that don't actually exist. Maybe it's just me but I find that a bit confusing.
posted by
aquinas
3 months, 5 days ago
C# html table builder
How about you change the functions so that they return the builder. Then you could do this:
TableBuilder tb = new TableBuilder();
tb.AddHeaderRow("Col 1", "Col2", "Col 3")
.AddRow("col 1", "col 2", "col 3")
.AddRow("col 1a", "col 2a", "col 3a");
Just a thought
posted by
aquinas
3 months, 10 days ago
C# HTML Helper Class
Well, you stated that "There is more overhead associated with HTMTextWriter." That's why I included the timings, so that those who might wish to use your code were aware that their did not appear to be any significant overhead as far as time goes. If you meant some other overhead besides time, then sorry, my bad.
posted by
aquinas
3 months, 26 days ago
C# HTML Helper Class
try this:
System.Diagnostics.Stopwatch stopw = new System.Diagnostics.Stopwatch();
stopw.Start();
for (int i = 0; i < 1000; i++) {
System.Text.StringBuilder sb = new StringBuilder();
List<ElementAttribute> attributes = new List<ElementAttribute>();
attributes.Clear();
attributes.Add(new ElementAttribute(HTMLHelper.ID, "gallery"));
//attributes.Add(new ElementAttribute(HTMLHelper.CLASS, "\" <hello>blah</hello>"));
attributes.Add(new ElementAttribute(HTMLHelper.CLASS, "whatever"));
attributes.Add(new ElementAttribute("onclick", "whatever()"));
for (int j = 0; j < 1000; j++) {
sb.Append(HTMLHelper.BeginDiv(attributes));
sb.Append("blah");
sb.Append(HTMLHelper.EndDiv());
}
}
stopw.Stop();
Console.WriteLine(stopw.ElapsedMilliseconds);
stopw.Reset();
stopw.Start();
for (int i = 0; i < 1000; i++) {
System.IO.StringWriter sw = new System.IO.StringWriter();
HtmlTextWriter writer = new HtmlTextWriter(sw);
for (int j = 0; j < 1000; j++) {
writer.AddAttribute(HtmlTextWriterAttribute.Id, "gallery");
//writer.AddAttribute(HtmlTextWriterAttribute.Class, "\" <hello>blah</hello>");
writer.AddAttribute(HtmlTextWriterAttribute.Class, "whatever");
writer.AddAttribute(HtmlTextWriterAttribute.Onclick, "whatever()");
writer.RenderBeginTag(HtmlTextWriterTag.Div);
writer.Write("blah");
writer.RenderEndTag();
//string tstring = sw.GetStringBuilder().ToString();
}
}
stopw.Stop();
Console.WriteLine(stopw.ElapsedMilliseconds);
Console.ReadLine();
On my machine the version that uses HtmlTextWriter is about 300 milliseconds FASTER. If you uncomment out the lines that are commented out, it's about 100 ms slower. The reason why it's slower is because it properly esacapes HTML entities, which the HTMLHelperClass does not. That's what [)amien was referring to when he said your version is open to HTML injection.
I'm not trying to rail against you. I just take exception with your comment of "After reading these comments I am realizing that it is the tendency of most developers to over-complicate almost everything." It just seems a bit odd that you're saying people over complicate things, when there is an existing class that does what your class does, but you've invented your own. AND you have to tell people that use it to be careful because you need to do your own html escaping.
posted by
aquinas
3 months, 26 days ago
C# HTML Helper Class
Why not HtmlTextWriter?
posted by
aquinas
3 months, 27 days ago
Create Windows Services That Can Install Themselves
Try:
http://www.codeproject.com/KB/dotnet/WinSvcSelfInstaller.aspx
posted by
aquinas
7 months, 1 day ago
Visual Studio 2008 RTM available for download
Microsoft's website doesn't say anything...
posted by
aquinas
7 months, 17 days ago
The Gospel of the GUID - And Why It Matters!
Regarding making a round trip to the database: what kind of database would one be using that doesn't support identity fields or sequences that you have to make a round trip to the database to get the next id? Please tell me you're not doing a select max(id)+1 from table. Hello race conditions.
"Reason 3: Type/Table Ignorance" Yeah, now you also don't get any foreign key constraints / cascading deletes on your "ParentGUID".
posted by
aquinas
8 months ago
Visual Studio 2008 to RTM in Movember
Movember! Mo Visual Studio!
posted by
aquinas
8 months, 1 day ago
Regions == Evil
? Regions == Evil
False
Maybe he meant to assign Evil to Regions, rather than comparing them? =)
posted by
aquinas
8 months, 5 days ago
« Previous
1
2
Next »
Sponsored Link:
www.carlist.ie
Search:
Ads via The Lounge
DotNetKicks is an open source project from
Incremental Systems